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

Instance Method Details

#<=(expr) ⇒ Object

Creates a transmit, or connection with an +expr+.

NOTE: it is converted afterward to an expression if required.



2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
# File 'lib/HDLRuby/hruby_high.rb', line 2774

def <=(expr)
    # Cast expr to self if required.
    expr = expr.to_expr.match_type(self.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.to_expr))
            add_statement(Transmit.new(self.to_ref,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.to_expr))
            add_connection(Connection.new(self.to_ref,expr))
    end
end