Module: TdlSpace::VarElemenCore

Included in:
TdlBaseInterface
Defined in:
lib/tdl/rebuild_ele/ele_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dimensionObject

Returns the value of attribute dimension.



355
356
357
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 355

def dimension
  @dimension
end

#inst_nameObject

Returns the value of attribute inst_name.



355
356
357
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 355

def inst_name
  @inst_name
end

#logic_typeObject

Returns the value of attribute logic_type.



355
356
357
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 355

def logic_type
  @logic_type
end

Instance Method Details

#[](*a) ⇒ Object



371
372
373
374
375
376
377
378
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 371

def [](*a)
    a.each do |e| 
        if e.is_a? ClassHDL::OpertorChain
            e.slaver = true
        end 
    end
    TdlSpace::ArrayChain.new(self,a)
end

#_inner_instObject



409
410
411
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 409

def _inner_inst 
    "#{get_class_var('hdl_name')}#{_inner_param_inst}#{inst_name}#{_back_dimension_}#{_inner_io_inst};"
end

#inst_portObject



388
389
390
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 388

def inst_port
    return [_port_inst_core_front,inst_name,_back_dimension_]
end

#instance(exp_len: nil) ⇒ Object



380
381
382
383
384
385
386
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 380

def instance(exp_len: nil)
    if modport_type 
        _port_inst(exp_len)
    else
        _inner_inst
    end
end

#modport_typeObject



392
393
394
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 392

def modport_type
    @modport_type 
end

#modport_type=(a) ⇒ Object



396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 396

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

#nameObject



362
363
364
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 362

def name 
    "#{inst_name}"
end

#name=(n) ⇒ Object



366
367
368
369
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 366

def name=(n)
    inst_name = n 
    "#{inst_name}"
end

#to_sObject




358
359
360
# File 'lib/tdl/rebuild_ele/ele_base.rb', line 358

def to_s 
    "#{inst_name}"
end