Module: TdlSpace::VarElemenCore
- Included in:
- TdlBaseInterface
- Defined in:
- lib/tdl/rebuild_ele/ele_base.rb
Instance Attribute Summary collapse
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#inst_name ⇒ Object
Returns the value of attribute inst_name.
-
#logic_type ⇒ Object
Returns the value of attribute logic_type.
Instance Method Summary collapse
- #[](*a) ⇒ Object
- #_inner_inst ⇒ Object
- #inst_port ⇒ Object
- #instance(exp_len: nil) ⇒ Object
- #modport_type ⇒ Object
- #modport_type=(a) ⇒ Object
- #name ⇒ Object
- #name=(n) ⇒ Object
-
#to_s ⇒ Object
————————————–.
Instance Attribute Details
#dimension ⇒ Object
Returns the value of attribute dimension.
367 368 369 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 367 def dimension @dimension end |
#inst_name ⇒ Object
Returns the value of attribute inst_name.
367 368 369 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 367 def inst_name @inst_name end |
#logic_type ⇒ Object
Returns the value of attribute logic_type.
367 368 369 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 367 def logic_type @logic_type end |
Instance Method Details
#[](*a) ⇒ Object
383 384 385 386 387 388 389 390 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 383 def [](*a) a.each do |e| if e.is_a? ClassHDL::OpertorChain e.slaver = true end end TdlSpace::ArrayChain.create(obj: self,lchain: a, belong_to_module: belong_to_module) end |
#_inner_inst ⇒ Object
421 422 423 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 421 def _inner_inst "#{get_class_var('hdl_name')}#{_inner_param_inst}#{inst_name}#{_back_dimension_}#{_inner_io_inst};" end |
#inst_port ⇒ Object
400 401 402 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 400 def inst_port return [_port_inst_core_front,inst_name,_back_dimension_] end |
#instance(exp_len: nil) ⇒ Object
392 393 394 395 396 397 398 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 392 def instance(exp_len: nil) if modport_type _port_inst(exp_len) else _inner_inst end end |
#modport_type ⇒ Object
404 405 406 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 404 def modport_type @modport_type end |
#modport_type=(a) ⇒ Object
408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 408 def modport_type=(a) ## 清除内部例化 define_singleton_method('_inner_inst') do nil end ports = @belong_to_module.instance_variable_get("@ports") ports ||= Hash.new ports[inst_name] = self @belong_to_module.instance_variable_set("@ports",ports) @modport_type = a end |
#name ⇒ Object
374 375 376 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 374 def name "#{inst_name}" end |
#name=(n) ⇒ Object
378 379 380 381 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 378 def name=(n) inst_name = n "#{inst_name}" end |
#to_s ⇒ Object
370 371 372 |
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 370 def to_s "#{inst_name}" end |