class HDLRuby::High::Select

Describes a section operation (generalization of the ternary operator).

NOTE: choice is using the value of select as an index.

Public Instance Methods

to_expr() click to toggle source

Converts to a new expression.

# File lib/HDLRuby/hruby_high.rb, line 2814
def to_expr
    return Select.new(self.type,"?",self.select.to_expr,
    *self.each_choice.map do |choice|
        choice.to_expr
    end)
end
to_low() click to toggle source

Converts the selection expression to HDLRuby::Low.

# File lib/HDLRuby/hruby_high.rb, line 2822
def to_low
    # return HDLRuby::Low::Select.new(self.type.to_low,"?",
    #                                 self.select.to_low,
    # *self.each_choice.map do |choice|
    #     choice.to_low
    # end)
    selectL = HDLRuby::Low::Select.new(self.type.to_low,"?",
                                    self.select.to_low,
    *self.each_choice.map do |choice|
        choice.to_low
    end)
    # For debugging: set the source high object
    selectL.properties[:low2high] = self.hdr_id
    self.properties[:high2low] = selectL
    return selectL
end