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.
4927 4928 4929 4930 4931 4932 4933 4934 4935 |
# File 'lib/HDLRuby/hruby_high.rb', line 4927 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.
4913 4914 4915 4916 4917 4918 4919 4920 4921 |
# File 'lib/HDLRuby/hruby_high.rb', line 4913 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.
4899 4900 4901 4902 4903 4904 4905 4906 4907 |
# File 'lib/HDLRuby/hruby_high.rb', line 4899 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.
4871 4872 4873 4874 4875 4876 4877 4878 4879 |
# File 'lib/HDLRuby/hruby_high.rb', line 4871 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.
4885 4886 4887 4888 4889 4890 4891 4892 4893 |
# File 'lib/HDLRuby/hruby_high.rb', line 4885 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.
4859 4860 4861 |
# File 'lib/HDLRuby/hruby_high.rb', line 4859 def to_type return TypeStruct.new(:"",:little,self) end |
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
4864 4865 4866 |
# File 'lib/HDLRuby/hruby_high.rb', line 4864 def typedef(name) return self.to_type.typedef(name) end |