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.
3965 3966 3967 3968 3969 3970 3971 3972 3973 |
# File 'lib/HDLRuby/hruby_high.rb', line 3965 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.
3951 3952 3953 3954 3955 3956 3957 3958 3959 |
# File 'lib/HDLRuby/hruby_high.rb', line 3951 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.
3937 3938 3939 3940 3941 3942 3943 3944 3945 |
# File 'lib/HDLRuby/hruby_high.rb', line 3937 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.
3909 3910 3911 3912 3913 3914 3915 3916 3917 |
# File 'lib/HDLRuby/hruby_high.rb', line 3909 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.
3923 3924 3925 3926 3927 3928 3929 3930 3931 |
# File 'lib/HDLRuby/hruby_high.rb', line 3923 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.
3897 3898 3899 |
# File 'lib/HDLRuby/hruby_high.rb', line 3897 def to_type return TypeStruct.new(:"",:little,self) end |
#typedef(name) ⇒ Object
Declares a new type definition with +name+ equivalent to current one.
3902 3903 3904 |
# File 'lib/HDLRuby/hruby_high.rb', line 3902 def typedef(name) return self.to_type.typedef(name) end |