Class: HDLRuby::High::Transmit
- Inherits:
-
Low::Transmit
- Object
- Base::Statement
- Low::Statement
- Low::Transmit
- HDLRuby::High::Transmit
- Includes:
- HStatement
- Defined in:
- lib/HDLRuby/hruby_high.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
Attributes inherited from Low::Transmit
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Transmit
constructor
Creates a new transmission from a +right+ expression to a +left+ reference, ensuring left is not a constant.
-
#to_expr ⇒ Object
Converts the transmission to a comparison expression.
-
#to_low ⇒ Object
Converts the transmit to HDLRuby::Low.
Methods included from HStatement
Methods inherited from Low::Transmit
#boolean_in_assign2select!, #break_concat_assigns, #clone, #each_block, #each_block_deep, #each_node, #each_node_deep, #each_statement_deep, #eql?, #explicit_types!, #extract_selects!, #hash, #map_nodes!, #replace_expressions!, #set_left!, #set_right!, #to_c, #to_high, #to_verilog, #to_vhdl
Methods inherited from Low::Statement
#add_blocks_code, #block, #blocks2seq!, #break_types!, #clone, #delete_unless!, #eql?, #explicit_types!, #extract_declares!, #hash, #mix?, #replace_expressions!, #replace_names!, #to_c, #to_high, #to_upper_space!, #to_vhdl, #top_block, #top_scope, #with_boolean!
Methods included from Low::Low2Symbol
Constructor Details
#initialize(left, right) ⇒ Transmit
Creates a new transmission from a +right+ expression to a +left+ reference, ensuring left is not a constant.
2750 2751 2752 2753 2754 2755 |
# File 'lib/HDLRuby/hruby_high.rb', line 2750 def initialize(left,right) if left.constant? then raise AnyError, "Cannot assign to constant: #{left}" end super(left,right) end |
Instance Method Details
#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.
2761 2762 2763 2764 2765 2766 2767 2768 |
# File 'lib/HDLRuby/hruby_high.rb', line 2761 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 |