Class: HDLRuby::High::Connection
- Inherits:
-
Low::Connection
- Object
- Base::Statement
- Low::Statement
- Low::Transmit
- Low::Connection
- HDLRuby::High::Connection
- Defined in:
- lib/HDLRuby/hruby_high.rb
Overview
Describes a connection.
Constant Summary collapse
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Low::Transmit
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#at(event) ⇒ Object
Creates a new behavior sensitive to +event+ including the connection converted to a transmission, and replace the former by the new behavior.
-
#hif(condition) ⇒ Object
Creates a new behavior with an if statement from +condition+ enclosing the connection converted to a transmission, and replace the former by the new behavior.
-
#to_expr ⇒ Object
Converts the connection to a comparison expression.
-
#to_low ⇒ Object
Converts the connection to HDLRuby::Low.
Methods inherited from Low::Connection
#array_connection, #break_concat_assigns, #eql?, #hash, #parent_system, #reassign_expressions!, #to_high, #to_verilog, #top_block, #top_scope
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, #initialize, #map_nodes!, #replace_expressions!, #set_left!, #set_right!, #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
Constructor Details
This class inherits a constructor from HDLRuby::Low::Transmit
Instance Method Details
#at(event) ⇒ Object
Creates a new behavior sensitive to +event+ including the connection converted to a transmission, and replace the former by the new behavior.
3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 |
# File 'lib/HDLRuby/hruby_high.rb', line 3607 def at(event) # Creates the behavior. left, right = self.left, self.right # Detached left and right from their connection since they will # be put in a new behavior instead. left.parent = right.parent = nil # Create the new behavior replacing the connection. behavior = Behavior.new(:par,event) do left <= right end # Adds the behavior. High.top_user.add_behavior(behavior) # Remove the connection High.top_user.delete_connection!(self) end |
#hif(condition) ⇒ Object
Creates a new behavior with an if statement from +condition+ enclosing the connection converted to a transmission, and replace the former by the new behavior.
NOTE: the else part is defined through the helse method.
3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 |
# File 'lib/HDLRuby/hruby_high.rb', line 3628 def hif(condition) # Creates the behavior. left, right = self.left, self.right # Detached left and right from their connection since they will # be put in a new behavior instead. left.parent = right.parent = nil # Create the new behavior replacing the connection. behavior = Behavior.new(:par) do hif(condition) do left <= right end end # Adds the behavior. High.top_user.add_behavior(behavior) # Remove the connection High.top_user.delete_connection!(self) end |
#to_expr ⇒ Object
Converts the connection to a comparison expression.
NOTE: required because the <= operator is ambigous and by default produces a Transmit or a Connection.
3597 3598 3599 3600 3601 3602 |
# File 'lib/HDLRuby/hruby_high.rb', line 3597 def to_expr # Remove the connection from the system type. High.top_user.delete_connection(self) # Generate an expression. return Binary.new(:<=,self.left,self.right) end |
#to_low ⇒ Object
Converts the connection to HDLRuby::Low.
3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 |
# File 'lib/HDLRuby/hruby_high.rb', line 3647 def to_low # return HDLRuby::Low::Connection.new(self.left.to_low, # self.right.to_low) connectionL = HDLRuby::Low::Connection.new(self.left.to_low, self.right.to_low) # # For debugging: set the source high object # connectionL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = connectionL return connectionL end |