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
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.
3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 |
# File 'lib/HDLRuby/hruby_high.rb', line 3100 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 |