Module: HDLRuby::High::HArrow
- Defined in:
- lib/HDLRuby/hruby_high.rb
Overview
Module giving high-level properties for handling the arrow (<=) operator.
Constant Summary collapse
- High =
HDLRuby::High
Instance Method Summary collapse
-
#<=(expr) ⇒ Object
Creates a transmit, or connection with an +expr+.
Instance Method Details
#<=(expr) ⇒ Object
Creates a transmit, or connection with an +expr+.
NOTE: it is converted afterward to an expression if required.
3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 |
# File 'lib/HDLRuby/hruby_high.rb', line 3417 def <=(expr) # Generate a ref from self for the left of the transmit. left = self.to_ref # Cast expr to self if required. expr = expr.to_expr.match_type(left.type) # Ensure expr is an expression. expr = expr.to_expr # Cast it to left if necessary. expr = expr.as(left.type) unless expr.type.eql?(left.type) # Generate the transmit. if High.top_user.is_a?(HDLRuby::Low::Block) then # We are in a block, so generate and add a Transmit. High.top_user. # add_statement(Transmit.new(self.to_ref,expr)) add_statement(Transmit.new(left,expr)) else # We are in a system type, so generate and add a Connection. High.top_user. # add_connection(Connection.new(self.to_ref,expr)) add_connection(Connection.new(left,expr)) end end |