Class: HDLClass::ImplicitInstParam
- Inherits:
-
Object
- Object
- HDLClass::ImplicitInstParam
- Defined in:
- lib/tdl/class_hdl/hdl_parameter.rb
Instance Attribute Summary collapse
-
#local ⇒ Object
Returns the value of attribute local.
-
#vcs_string ⇒ Object
Returns the value of attribute vcs_string.
Instance Method Summary collapse
- #[](num) ⇒ Object
-
#initialize(sdlm) ⇒ ImplicitInstParam
constructor
A new instance of ImplicitInstParam.
- #int ⇒ Object
-
#method_missing(name, *args, &block) ⇒ Object
def -(name) @sdlm.Parameter(name,value=0,type:nil,show:true) end.
- #real ⇒ Object
Constructor Details
#initialize(sdlm) ⇒ ImplicitInstParam
Returns a new instance of ImplicitInstParam.
5 6 7 8 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 5 def initialize(sdlm) @sdlm = sdlm @type = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 29 def method_missing(name,*args,&block) if name !~ /\w+/ raise TdlError.new("cont define parameter name #{name}") end if args.any? unless local relp = @sdlm.Parameter(name,args[0],type:@type,show:true) else relp = @sdlm.Def.parameter(name: name,value: args[0],local:true,type:@type) end if vcs_string relp.vcs_string = vcs_string end relp else @sdlm.public_send(name) end end |
Instance Attribute Details
#local ⇒ Object
Returns the value of attribute local.
4 5 6 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 4 def local @local end |
#vcs_string ⇒ Object
Returns the value of attribute vcs_string.
4 5 6 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 4 def vcs_string @vcs_string end |
Instance Method Details
#[](num) ⇒ Object
10 11 12 13 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 10 def [](num) @type = "[#{num}-1:0]" self end |
#int ⇒ Object
20 21 22 23 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 20 def int @type = 'int' return self end |
#real ⇒ Object
15 16 17 18 |
# File 'lib/tdl/class_hdl/hdl_parameter.rb', line 15 def real @type = 'real' return self end |