class RubyRTL::Compiler
Public Class Methods
new()
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 12 def initialize header @printer=DSLPrinter.new @dot_printer=ASTPrinter.new @analyzer=ContextualAnalyzer.new @checker=TypeChecker.new @vgen=VhdlGenerator.new @sexp_gen=SexpGenerator.new end
Public Instance Methods
analyze(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 44 def analyze circuit @analyzer.analyze(circuit) end
compile(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 26 def compile circuit print_ast(circuit) analyze(circuit) print_dsl(circuit) type_check(circuit) print_dsl(circuit) generate(circuit) generate_sexp(circuit) end
generate(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 52 def generate circuit @vgen.generate(circuit) end
generate_sexp(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 56 def generate_sexp circuit @sexp_gen.generate(circuit) end
header()
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 22 def header puts "RubyRTL compiler " end
print_ast(circuit,file_suffix="")
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 40 def print_ast circuit,file_suffix="" @dot_printer.run(circuit,file_suffix) end
print_dsl(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 36 def print_dsl circuit @printer.print circuit end
type_check(circuit)
click to toggle source
# File lib/ruby_rtl/compiler.rb, line 48 def type_check circuit @checker.check circuit end