class TestUnitModule

Public Class Methods

be_instanced_by_sim() click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 239
def self.be_instanced_by_sim
    @@__be_instanced_by_sim__ || []
end
echo_be_instanced_by_sim() click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 243
def self.echo_be_instanced_by_sim
    @@__be_instanced_by_sim__ ||= []

    _module_name = []
    _ref_module_name = []
    _signal_name = []
    _ref_module_path = []

    _max_module_name = 'test_module'.size 
    _max_signal_name = 'SIGNAL'.size 
    _max_ref = 'REF_MODULE'.size
    @@__be_instanced_by_sim__.each do |tm|
        __root_ref_eles__ = tm.root_ref_eles

        __root_ref_eles__.each do |ele|
            _module_name << tm.module_name
            _ref_module_name << ele.belong_to_module.module_name
            _signal_name << ele.to_s 
            _ref_module_path << File.expand_path(ele.belong_to_module.real_sv_path)

            if tm.module_name.size > _max_module_name
                _max_module_name    = tm.module_name.size 
            end 

            if ele.belong_to_module.module_name.size > _max_ref
                _max_ref  = ele.belong_to_module.module_name.size 
            end 

            if ele.to_s.size > _max_signal_name
                _max_signal_name = ele.to_s.size 
            end
        end
    end

    collect = ["[%5s]    %-#{_max_module_name}s    %#{_max_ref}s  %-#{_max_signal_name}s    %s" % ['index', 'TEST-MODULE','REF-MODULE','SIGNAL', 'REF-MODULE-PATH'] ] 

    _module_name.each_index do |index|
        collect << "[%5d]    %-#{_max_module_name}s    %#{_max_ref}s  %-#{_max_signal_name}s    %s" % [index+1, _module_name[index], _ref_module_name[index], _signal_name[index], _ref_module_path[index]]
    end

    collect.join("\n")
end
gen_dve_tcl(filepath) click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 287
def self.gen_dve_tcl(filepath)


end
new(name: "tdlmodule",out_sv_path: nil) click to toggle source
Calls superclass method SdlModule::new
# File lib/tdl/sdlmodule/test_unit_module.rb, line 208
def initialize(name: "tdlmodule",out_sv_path: nil)
    super(name: name,out_sv_path: out_sv_path)
    # @dve_wave_signals = []
end

Public Instance Methods

add_root_ref_ele(*eles) click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 224
def add_root_ref_ele(*eles)
    @__root_ref_eles__ ||= []
    @__root_ref_eles__ += eles
    @__root_ref_eles__.uniq!
end
be_instanced_by_sim() click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 234
def be_instanced_by_sim
    @@__be_instanced_by_sim__ ||= []
    @@__be_instanced_by_sim__ << self
end
root_ref_eles() click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 230
def root_ref_eles 
    @__root_ref_eles__ || []
end
test_unit_init(&block) click to toggle source
# File lib/tdl/sdlmodule/test_unit_module.rb, line 213
def test_unit_init(&block)
    Initial do 
        to_down_pass    <= 1.b0
        initial_exec("wait(from_up_pass)")
        initial_exec("$root.#{TopModule.current.techbench.module_name}.test_unit_region = \"#{module_name}\"")
        initial_exec("$display(\"--------------- Current test_unit <%0s> --------------------\", \"#{module_name}\")")
        block.call ## collect __root_ref_eles__ at here
        to_down_pass    <= 1.b1
    end
end