Class: TechBench

Inherits:
Object
  • Object
show all
Defined in:
lib/tdl/exlib/integral_test/bak/integral_test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTechBench

Returns a new instance of TechBench.



13
14
15
16
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 13

def initialize
    # @top_tb = TestModule.new()
    @modules = []
end

Instance Attribute Details

#auto_pathObject

Returns the value of attribute auto_path.



12
13
14
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 12

def auto_path
  @auto_path
end

#tb_pathObject

Returns the value of attribute tb_path.



12
13
14
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 12

def tb_path
  @tb_path
end

Instance Method Details

#add(tm) ⇒ Object



18
19
20
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 18

def add(tm)
    @modules << tm if tm.is_a? TestModule
end

#add_clock_unit(hash) ⇒ Object



56
57
58
59
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 56

def add_clock_unit(hash)
    init_clock_reset
    @clock_reset.add_test_unit(type:ClockITest,hash:hash)
end

#add_diff_clock_unit(hash) ⇒ Object



51
52
53
54
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 51

def add_diff_clock_unit(hash)
    init_clock_reset
    @clock_reset.add_test_unit(type:DiffClockITest,hash:hash)
end

#add_io_unit(hash, &block) ⇒ Object



66
67
68
69
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 66

def add_io_unit(hash,&block)
    init_clock_reset
    @clock_reset.add_test_unit(type:IOITest,hash:hash,&block)
end

#add_module(name, &block) ⇒ Object

def add_top_unit(type:nil,hash:{})

@modules[0].add_test_unit(type:type,hash:hash)

end



35
36
37
38
39
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 35

def add_module(name,&block)
    tm = TestModule.new(name,&block)
    @modules << tm
    tm
end

#add_reset_unit(hash) ⇒ Object



61
62
63
64
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 61

def add_reset_unit(hash)
    init_clock_reset
    @clock_reset.add_test_unit(type:ResetITest,hash:hash)
end

#bfm_module(module_name) ⇒ Object



86
87
88
89
90
91
92
93
94
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 86

def bfm_module(module_name)

    @bfm_modules ||= Hash.new
    if @bfm_modules[module_name]
        @bfm_modules[module_name]
    else
        @bfm_modules[module_name] = Tdl.send("inst_"+module_name.downcase)
    end
end

#gen_tb_file(test_module_name) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 22

def gen_tb_file(test_module_name)
    @top_connect_elements = []
    @modules.each do |e|
        sub_elements = e.gen_sub_tb_module_file
        @top_connect_elements += sub_elements
    end
    inst(test_module_name)
end

#inst(test_module_name) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 71

def inst(test_module_name)
    # require_path(auto_path)
    tb_m = TdlModule.new(name:"tb_"+test_module_name)
    tb_m.out_sv_path = tb_path
    #
    target_module = Tdl.send("inst_"+test_module_name.downcase)

    @top_connect_elements.each do |e|
        test_module = bfm_module(e.module_name)
        e.connect(target_module,test_module)
    end

    tb_m.exit_build_module
end