Class: Hash
- Inherits:
-
Object
- Object
- Hash
- 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
Instance Method Summary collapse
-
#constant(hsh) ⇒ Object
Declares high-level untyped constant signals by name and value given by +hsh+ of the current type.
-
#inner(*names) ⇒ Object
Declares high-level untyped inner signals named +names+ of the current type.
-
#inout(*names) ⇒ Object
Declares high-level untyped inout signals named +names+ of the current type.
-
#input(*names) ⇒ Object
Declares high-level input signals named +names+ of the current type.
-
#output(*names) ⇒ Object
Declares high-level untyped output signals named +names+ of the current type.
-
#shared(*names) ⇒ Object
Create new shared signals from +args+.
-
#to_type ⇒ Object
Converts to a new type.
-
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
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.
5148 5149 5150 5151 5152 5153 5154 5155 5156 |
# File 'lib/HDLRuby/hruby_high.rb', line 5148 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.
5134 5135 5136 5137 5138 5139 5140 5141 5142 |
# File 'lib/HDLRuby/hruby_high.rb', line 5134 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.
5120 5121 5122 5123 5124 5125 5126 5127 5128 |
# File 'lib/HDLRuby/hruby_high.rb', line 5120 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.
5092 5093 5094 5095 5096 5097 5098 5099 5100 |
# File 'lib/HDLRuby/hruby_high.rb', line 5092 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.
5106 5107 5108 5109 5110 5111 5112 5113 5114 |
# File 'lib/HDLRuby/hruby_high.rb', line 5106 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_type ⇒ Object
Converts to a new type.
5080 5081 5082 |
# File 'lib/HDLRuby/hruby_high.rb', line 5080 def to_type return TypeStruct.new(:"",:little,self) end |
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
5085 5086 5087 |
# File 'lib/HDLRuby/hruby_high.rb', line 5085 def typedef(name) return self.to_type.typedef(name) end |