Class: HDLRuby::High::Print
- Inherits:
-
Low::Print
- Object
- Base::Statement
- Low::Statement
- Low::Print
- HDLRuby::High::Print
- Includes:
- HStatement
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rsim.rb,
lib/HDLRuby/hruby_rcsim.rb,
lib/HDLRuby/hruby_rsim_vcd.rb
Overview
Enhance the Print class with VCD support.
Constant Summary collapse
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary collapse
-
#rcstatement ⇒ Object
readonly
Returns the value of attribute rcstatement.
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#execute(mode) ⇒ Object
Executes the statement.
-
#get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
-
#init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
-
#initialize(*args) ⇒ Print
constructor
Creates a new statement for printing +args+.
-
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
-
#to_low ⇒ Object
Converts the connection to HDLRuby::Low.
-
#to_rcsim ⇒ Object
Generate the C description of the print.
Methods included from HStatement
Methods inherited from Low::Print
#boolean_in_assign2select!, #casts_without_expression!, #clone, #delete_arg!, #each_arg, #each_block, #each_block_deep, #each_deep, #each_node, #each_node_deep, #each_statement_deep, #eql?, #explicit_types!, #extract_selects!, #hash, #map_args!, #replace_args!, #to_c, #to_high, #to_verilog, #to_vhdl
Methods inherited from Low::Statement
#add_blocks_code, #add_make_block, #behavior, #block, #blocks2seq!, #break_types!, #clone, #delete_related!, #delete_unless!, #each_deep, #each_statement, #eql?, #explicit_types!, #extract_declares!, #hash, #mix?, #par_in_seq2seq!, #parent_system, #replace_expressions!, #replace_names!, #scope, #to_c, #to_ch, #to_hdr, #to_high, #to_seq!, #to_upper_space!, #to_vhdl, #top_block, #top_scope, #use_name?, #with_boolean!
Methods included from Low::Low2Symbol
Methods included from Low::Hparent
#hierarchy, #no_parent!, #scope
Constructor Details
#initialize(*args) ⇒ Print
Creates a new statement for printing +args+.
3661 3662 3663 3664 |
# File 'lib/HDLRuby/hruby_high.rb', line 3661 def initialize(*args) # Process the arguments. super(*args.map(&:to_expr)) end |
Instance Attribute Details
#rcstatement ⇒ Object (readonly)
Returns the value of attribute rcstatement.
523 524 525 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 523 def rcstatement @rcstatement end |
Instance Method Details
#execute(mode) ⇒ Object
Executes the statement.
657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 657 def execute(mode) self.each_arg.map do |arg| case arg when StringE @sim.show_string(arg.content) when SignalI @sim.show_signal(arg) when SignalC @sim.show_signal(arg) else @sim.show_value(arg.execute(mode)) end end end |
#get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
205 206 207 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 205 def get_vars_with_fullname(vars_with_fullname = {}) # By default: nothing to do end |
#init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
652 653 654 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 652 def init_sim(systemT) @sim = systemT end |
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
200 201 202 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 200 def show_hierarchy(vcdout) # By default: nothing to do. end |
#to_low ⇒ Object
Converts the connection to HDLRuby::Low.
3667 3668 3669 |
# File 'lib/HDLRuby/hruby_high.rb', line 3667 def to_low return HDLRuby::Low::Print.new(*self.each_arg.map(&:to_low)) end |
#to_rcsim ⇒ Object
Generate the C description of the print.
526 527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 526 def to_rcsim # Create the print C object. @rcstatement = RCSim.rcsim_make_print() # Adds the arguments. # self.each_arg do |arg| # RCSim.rcsim_add_print_arg(@rcstatement,arg.to_rcsim) # end RCSim.rcsim_add_print_args(@rcstatement, self.each_arg.map(&:to_rcsim)) return @rcstatement end |