Class: HDLRuby::High::Print
- Inherits:
-
Low::Print
- Object
- 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 more...
Overview
Describes a print statement: not synthesizable!
Constant Summary collapse
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary collapse
-
#rcstatement ⇒ Object
readonly
Extends the Print class for hybrid Ruby-C simulation.
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.
-
#get_vars_with_idstr(vars_with_idstr = {}) ⇒ Object
Gets the VCD variables with their id string.
-
#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!, #signal2subs!, #to_c, #to_high, #to_verilog, #to_vhdl, #to_viz_node
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!, #fix_scope_refnames!, #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
#absolute_ref, #hierarchy, #no_parent!, #scope
Constructor Details
permalink #initialize(*args) ⇒ Print
Creates a new statement for printing +args+.
3899 3900 3901 3902 |
# File 'lib/HDLRuby/hruby_high.rb', line 3899 def initialize(*args) # Process the arguments. super(*args.map(&:to_expr)) end |
Instance Attribute Details
permalink #rcstatement ⇒ Object (readonly)
Extends the Print class for hybrid Ruby-C simulation.
637 638 639 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 637 def rcstatement @rcstatement end |
Instance Method Details
permalink #execute(mode) ⇒ Object
Executes the statement.
825 826 827 828 829 830 831 832 833 834 835 836 837 838 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 825 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 |
permalink #get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
375 376 377 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 375 def get_vars_with_fullname(vars_with_fullname = {}) # By default: nothing to do end |
permalink #get_vars_with_idstr(vars_with_idstr = {}) ⇒ Object
Gets the VCD variables with their id string.
380 381 382 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 380 def get_vars_with_idstr(vars_with_idstr = {}) # By default: nothing to do end |
permalink #init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
820 821 822 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 820 def init_sim(systemT) @sim = systemT end |
permalink #show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
370 371 372 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 370 def show_hierarchy(vcdout) # By default: nothing to do. end |
permalink #to_low ⇒ Object
Converts the connection to HDLRuby::Low.
3905 3906 3907 |
# File 'lib/HDLRuby/hruby_high.rb', line 3905 def to_low return HDLRuby::Low::Print.new(*self.each_arg.map(&:to_low)) end |
permalink #to_rcsim ⇒ Object
Generate the C description of the print.
640 641 642 643 644 645 646 647 648 649 650 651 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 640 def to_rcsim # Create the print C object. @rcstatement = RCSim.rcsim_make_print() # Adds the arguments. if self.each_arg.any? then RCSim.rcsim_add_print_args(@rcstatement, self.each_arg.map(&:to_rcsim)) end return @rcstatement end |