Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/HDLRuby/hruby_high.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.
-
#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.
4909 4910 4911 4912 4913 4914 4915 4916 4917 |
# File 'lib/HDLRuby/hruby_high.rb', line 4909 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.
4895 4896 4897 4898 4899 4900 4901 4902 4903 |
# File 'lib/HDLRuby/hruby_high.rb', line 4895 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.
4881 4882 4883 4884 4885 4886 4887 4888 4889 |
# File 'lib/HDLRuby/hruby_high.rb', line 4881 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.
4853 4854 4855 4856 4857 4858 4859 4860 4861 |
# File 'lib/HDLRuby/hruby_high.rb', line 4853 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.
4867 4868 4869 4870 4871 4872 4873 4874 4875 |
# File 'lib/HDLRuby/hruby_high.rb', line 4867 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 ⇒ Object
Converts to a new type.
4841 4842 4843 |
# File 'lib/HDLRuby/hruby_high.rb', line 4841 def to_type return TypeStruct.new(:"",:little,self) end |
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
4846 4847 4848 |
# File 'lib/HDLRuby/hruby_high.rb', line 4846 def typedef(name) return self.to_type.typedef(name) end |