Class: TestModule

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

#initialize(name = nil, &block) ⇒ TestModule

Returns a new instance of TestModule.



104
105
106
107
108
109
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 104

def initialize(name=nil,&block)
    @items_hash = []
    @name = String.new(GlobalParam.CurrTestTargetModule.module_name).concat("_#{name}")
    # tdlmodule.techbench.add(self) if tdlmodule
    @tdlmodule_block = block
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



102
103
104
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 102

def name
  @name
end

Instance Method Details

#add_clock_unit(hash) ⇒ Object



115
116
117
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 115

def add_clock_unit(hash)
    add_test_unit(type:ClockITest,hash:hash)
end

#add_conn_unit(type: nil, hash: {pin_key:nil}) ⇒ Object



132
133
134
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 132

def add_conn_unit(type:nil,hash:{pin_key:nil})
    add_test_unit(type:type,hash:hash)
end

#add_connects(*argvs) ⇒ Object



136
137
138
139
140
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 136

def add_connects(*argvs)
    argvs.each do |e|
        add_test_unit(type:SimpleLogicITest,hash:{pin_key:e})
    end
end

#add_diff_clock_unit(hash) ⇒ Object



111
112
113
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 111

def add_diff_clock_unit(hash)
    add_test_unit(type:DiffClockITest,hash:hash)
end

#add_io_unit(hash, &block) ⇒ Object



123
124
125
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 123

def add_io_unit(hash,&block)
    add_test_unit(type:IOITest,hash:hash,&block)
end

#add_reset_unit(hash) ⇒ Object



119
120
121
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 119

def add_reset_unit(hash)
    add_test_unit(type:ResetITest,hash:hash)
end

#add_test_unit(type: nil, hash: {pin_key:nil}, &block) ⇒ Object



128
129
130
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 128

def add_test_unit(type:nil,hash:{pin_key:nil},&block)
    @items_hash << [type,hash,block] if type.superclass.eql? IntegralTest
end

#add_wires(*argvs) ⇒ Object



142
143
144
145
146
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 142

def add_wires(*argvs)
    argvs.each do |e|
        add_test_unit(type:SimpleLogicITest,hash:{pin_key:e,type:"wire"})
    end
end

#gen_sub_tb_module_fileObject



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/tdl/exlib/integral_test/bak/integral_test.rb', line 148

def gen_sub_tb_module_file
    # return if @items_hash.empty?
    tb_m = TdlModule.new(name:@name,add_to:DataInf)
    tb_m.out_sv_path = GlobalParam.CurrTestTargetModule.techbench.tb_path
    top_connect_elements = []
    @items_hash.each do |e|
        if e[2]
            new_unit = e[0].new(e[1],&e[2])
        else
            new_unit = e[0].new(e[1])
        end
        tbc = new_unit.tb_top_connect_element
        tbc.module_name = @name
        top_connect_elements << tbc
    end

    # if block_given?
    #     puts "++++++++++++++top_connect_elements"
    #     yield(tb_m)
    # end

    if @tdlmodule_block
        @tdlmodule_block.call(tb_m)
    end

    tb_m.buidl_tdl_to_sv_to_autotdl(autopath:GlobalParam.CurrTestTargetModule.techbench.auto_path)
    top_connect_elements
end