class Hash

Extends the Hash class for declaring signals of structure types.

Public Instance Methods

constant(hsh) click to toggle source

Declares high-level untyped constant signals by name and value given by hsh of the current type.

Retuns the last declared constant.

# File lib/HDLRuby/hruby_high.rb, line 4397
def constant(hsh)
    res = nil
    hsh.each do |name,value|
        res = HDLRuby::High.top_user.
            add_inner(SignalC.new(name,
                      TypeStruct.new(:"",:little,self),:inner,value))
    end
    return res
end
inner(*names) click to toggle source

Declares high-level untyped inner signals named names of the current type.

Retuns the last declared inner.

# File lib/HDLRuby/hruby_high.rb, line 4383
def inner(*names)
    res = nil
    names.each do |name|
        res = HDLRuby::High.top_user.
            add_inner(SignalI.new(name,
                            TypeStruct.new(:"",:little,self),:inner))
    end
    return res
end
inout(*names) click to toggle source

Declares high-level untyped inout signals named names of the current type.

Retuns the last declared inout.

# File lib/HDLRuby/hruby_high.rb, line 4369
def inout(*names)
    res = nil
    names.each do |name|
        res = HDLRuby::High.top_user.
            add_inout(SignalI.new(name,
                            TypeStruct.new(:"",:little,self),:inout))
    end
    return res
end
input(*names) click to toggle source

Declares high-level input signals named names of the current type.

Retuns the last declared input.

# File lib/HDLRuby/hruby_high.rb, line 4341
def input(*names)
    res = nil
    names.each do |name|
        res = HDLRuby::High.top_user.
            add_input(SignalI.new(name,
                            TypeStruct.new(:"",:little,self),:input))
    end
    return res
end
output(*names) click to toggle source

Declares high-level untyped output signals named names of the current type.

Retuns the last declared output.

# File lib/HDLRuby/hruby_high.rb, line 4355
def output(*names)
    res = nil
    names.each do |name|
        res = HDLRuby::High.top_user.
            add_output(SignalI.new(name,
                            TypeStruct.new(:"",:little,self),:output))
    end
    return res
end
to_type() click to toggle source

Converts to a new type.

# File lib/HDLRuby/hruby_high.rb, line 4329
def to_type
    return TypeStruct.new(:"",:little,self)
end
typedef(name) click to toggle source

Declares a new type definition with name equivalent to current one.

# File lib/HDLRuby/hruby_high.rb, line 4334
def typedef(name)
    return self.to_type.typedef(name)
end