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.



5428
5429
5430
5431
5432
5433
5434
5435
5436
# File 'lib/HDLRuby/hruby_high.rb', line 5428

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.



5414
5415
5416
5417
5418
5419
5420
5421
5422
# File 'lib/HDLRuby/hruby_high.rb', line 5414

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.



5400
5401
5402
5403
5404
5405
5406
5407
5408
# File 'lib/HDLRuby/hruby_high.rb', line 5400

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.



5372
5373
5374
5375
5376
5377
5378
5379
5380
# File 'lib/HDLRuby/hruby_high.rb', line 5372

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.



5386
5387
5388
5389
5390
5391
5392
5393
5394
# File 'lib/HDLRuby/hruby_high.rb', line 5386

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.



5360
5361
5362
# File 'lib/HDLRuby/hruby_high.rb', line 5360

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

#typedef(name) ⇒ Object

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



5365
5366
5367
# File 'lib/HDLRuby/hruby_high.rb', line 5365

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