Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/std/sequencer_sync.rb

Overview

Extends the Hash class for declaring signals of structure types.

Direct Known Subclasses

HDLRuby::Low::HashName

Instance Method Summary collapse

Instance Method Details

#constant(hsh) ⇒ Object

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

Retuns the last declared constant.



5329
5330
5331
5332
5333
5334
5335
5336
5337
# File 'lib/HDLRuby/hruby_high.rb', line 5329

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) ⇒ Object

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

Retuns the last declared inner.



5315
5316
5317
5318
5319
5320
5321
5322
5323
# File 'lib/HDLRuby/hruby_high.rb', line 5315

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) ⇒ Object

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

Retuns the last declared inout.



5301
5302
5303
5304
5305
5306
5307
5308
5309
# File 'lib/HDLRuby/hruby_high.rb', line 5301

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) ⇒ Object

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

Retuns the last declared input.



5273
5274
5275
5276
5277
5278
5279
5280
5281
# File 'lib/HDLRuby/hruby_high.rb', line 5273

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) ⇒ Object

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

Retuns the last declared output.



5287
5288
5289
5290
5291
5292
5293
5294
5295
# File 'lib/HDLRuby/hruby_high.rb', line 5287

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

#shared(*names) ⇒ Object

Create new shared signals from +args+.



392
393
394
# File 'lib/HDLRuby/std/sequencer_sync.rb', line 392

def shared(*names)
    return self.to_type.shared(*names)
end

#to_typeObject

Converts to a new type.



5261
5262
5263
# File 'lib/HDLRuby/hruby_high.rb', line 5261

def to_type
    return TypeStruct.new(:"",:little,self)
end

#typedef(name) ⇒ Object

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



5266
5267
5268
# File 'lib/HDLRuby/hruby_high.rb', line 5266

def typedef(name)
    return self.to_type.typedef(name)
end