class HDLRuby::High::Transmit
Decribes a transmission statement.
Constants
- High
High-level libraries for describing digital hardware.
Public Class Methods
new(left,right)
click to toggle source
Creates a new transmission from a right
expression to a left
reference, ensuring left is not a constant.
Calls superclass method
HDLRuby::Low::Transmit::new
# File lib/HDLRuby/hruby_high.rb, line 3257 def initialize(left,right) if left.constant? then raise AnyError, "Cannot assign to constant: #{left}" end super(left,right) end
Public Instance Methods
to_expr()
click to toggle source
Converts the transmission to a comparison expression.
NOTE: required because the <= operator is ambigous and by default produces a Transmit
or a Connection
.
# File lib/HDLRuby/hruby_high.rb, line 3268 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()
click to toggle source
Converts the transmit to HDLRuby::Low
.
# File lib/HDLRuby/hruby_high.rb, line 3278 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