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.
4815 4816 4817 4818 4819 4820 4821 4822 4823 |
# File 'lib/HDLRuby/hruby_high.rb', line 4815 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.
4801 4802 4803 4804 4805 4806 4807 4808 4809 |
# File 'lib/HDLRuby/hruby_high.rb', line 4801 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.
4787 4788 4789 4790 4791 4792 4793 4794 4795 |
# File 'lib/HDLRuby/hruby_high.rb', line 4787 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.
4759 4760 4761 4762 4763 4764 4765 4766 4767 |
# File 'lib/HDLRuby/hruby_high.rb', line 4759 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.
4773 4774 4775 4776 4777 4778 4779 4780 4781 |
# File 'lib/HDLRuby/hruby_high.rb', line 4773 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.
4747 4748 4749 |
# File 'lib/HDLRuby/hruby_high.rb', line 4747 def to_type return TypeStruct.new(:"",:little,self) end |
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
4752 4753 4754 |
# File 'lib/HDLRuby/hruby_high.rb', line 4752 def typedef(name) return self.to_type.typedef(name) end |