Class: HDLRuby::High::Transmit
- Inherits:
-
Low::Transmit
- Object
- Low::Statement
- Low::Transmit
- HDLRuby::High::Transmit
- 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
Decribes a transmission statement.
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 Transmit class for hybrid Ruby-C simulation.
Attributes inherited from Low::Transmit
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(left, right) ⇒ Transmit
constructor
Creates a new transmission from a +right+ expression to a +left+ reference, ensuring left is not a constant.
-
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
-
#to_expr ⇒ Object
Converts the transmission to a comparison expression.
-
#to_low ⇒ Object
Converts the transmit to HDLRuby::Low.
-
#to_rcsim ⇒ Object
Generate the C description of the transmit.
Methods included from HStatement
Methods inherited from Low::Transmit
#boolean_in_assign2select!, #break_concat_assigns, #casts_without_expression!, #clone, #each_block, #each_block_deep, #each_deep, #each_node, #each_node_deep, #each_statement_deep, #eql?, #explicit_types!, #extract_selects!, #hash, #map_nodes!, #replace_expressions!, #set_left!, #set_right!, #signal2subs!, #to_c, #to_hdr, #to_high, #to_verilog, #to_vhdl, #use_name?
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(left, right) ⇒ Transmit
Creates a new transmission from a +right+ expression to a +left+ reference, ensuring left is not a constant.
3679 3680 3681 3682 3683 3684 |
# File 'lib/HDLRuby/hruby_high.rb', line 3679 def initialize(left,right) if left.constant? then raise AnyError, "Cannot assign to constant: #{left}" end super(left,right) end |
Instance Attribute Details
#rcstatement ⇒ Object (readonly)
Extends the Transmit class for hybrid Ruby-C simulation.
538 539 540 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 538 def rcstatement @rcstatement end |
Instance Method Details
#execute(mode) ⇒ Object
Executes the statement.
719 720 721 722 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 719 def execute(mode) # puts "execute Transmit in mode=#{mode} for left=#{self.left.object.fullname}" if left.is_a?(RefObject) self.left.assign(mode,self.right.execute(mode)) end |
#get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
314 315 316 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 314 def get_vars_with_fullname(vars_with_fullname = {}) # By default: nothing to do end |
#get_vars_with_idstr(vars_with_idstr = {}) ⇒ Object
Gets the VCD variables with their id string.
319 320 321 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 319 def get_vars_with_idstr(vars_with_idstr = {}) # By default: nothing to do end |
#init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
713 714 715 716 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 713 def init_sim(systemT) self.left.init_sim(systemT) self.right.init_sim(systemT) end |
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
309 310 311 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 309 def show_hierarchy(vcdout) # By default: nothing to do. end |
#to_expr ⇒ Object
Converts the transmission to a comparison expression.
NOTE: required because the <= operator is ambigous and by default produces a Transmit or a Connection.
3690 3691 3692 3693 3694 3695 3696 3697 |
# File 'lib/HDLRuby/hruby_high.rb', line 3690 def to_expr # Remove the transission from the block. High.top_user.delete_statement!(self) # Generate an expression. return Binary.new( self.left.to_expr.type.send(:<=,self.right.to_expr.type), :<=,self.left.to_expr,self.right.to_expr) end |
#to_low ⇒ Object
Converts the transmit to HDLRuby::Low.
3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 |
# File 'lib/HDLRuby/hruby_high.rb', line 3700 def to_low # return HDLRuby::Low::Transmit.new(self.left.to_low, # self.right.to_low) transmitL = HDLRuby::Low::Transmit.new(self.left.to_low, self.right.to_low) # # For debugging: set the source high object # transmitL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = transmitL return transmitL end |
#to_rcsim ⇒ Object
Generate the C description of the transmit.
541 542 543 544 545 546 547 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 541 def to_rcsim # Create the transmit C object. @rcstatement = RCSim.rcsim_make_transmit(self.left.to_rcsim, self.right.to_rcsim) return @rcstatement end |