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, #use_name?
Methods inherited from Low::Statement
#add_blocks_code, #behavior, #block, #blocks2seq!, #break_types!, #clone, #delete_related!, #delete_unless!, #eql?, #explicit_types!, #extract_declares!, #hash, #mix?, #parent_system, #replace_expressions!, #replace_names!, #scope, #to_c, #to_high, #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
#initialize(left, right) ⇒ Transmit
Creates a new transmission from a +right+ expression to a +left+ reference, ensuring left is not a constant.
2971 2972 2973 2974 2975 2976 |
# File 'lib/HDLRuby/hruby_high.rb', line 2971 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.
2982 2983 2984 2985 2986 2987 2988 2989 |
# File 'lib/HDLRuby/hruby_high.rb', line 2982 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 |