Class: TestUnitModule

Inherits:
SdlModule show all
Defined in:
lib/tdl/sdlmodule/test_unit_module.rb

Instance Attribute Summary collapse

Attributes inherited from SdlModule

#create_tcl, #dont_gen_sv, #ex_down_code, #ex_param, #ex_port, #ex_up_code, #head_import_packages, #instance_and_children_module, #instanced_and_parent_module, #module_name, #origin_sv, #out_sv_path, #path, #real_sv_path, #target_class, #techbench

Instance Method Summary collapse

Methods inherited from SdlModule

#<<, #>>, #Always, #AlwaysComb, #Always_comb, #Always_ff, #Assign, #CASE, #CASEX, #Clock, #CommonCFGReg, #DEFAULT, #Def, #ELSE, #ELSIF, #FOR, #FOREACH, #IF, #Initial, #Inout, #Input, #Instance, #Itgt_Instance, Main, #NameSpaceAdd, #Output, #Parameter, #Parameters, #Reset, #StateMachine, #TrackInf, #TryDef, #WHEN, #add_children_modules, #add_parent_modules, #add_to_new_module, allmodule_name, #always_ff, #always_sim, #assert, #assert_error, #assert_format_error, #assert_old, #bits, #build_module, #call_instance, call_module, #children_inst_tree, #clog2, #debugLogic, #def_struct, #define_ele, #enum, exist_module?, #function, #gen_sv_module, gen_sv_module, #gen_sv_module_text, #generate, #genvar, #has_inward_inst?, #has_signal?, #implicit_inst_module_method_missing, #initial, #initial_exec, #inout, #input, #instance_draw, #instanced, #inward_inst, #localparam, #logic, #logic_bind_, #macro_add_vcs, #macro_def, #method_missing, #negedge, #output, #parameter, #parents_inst_tree, #port, #posedge, #require_package, #rubyOP, #same_clock_domain, #show_ports, #signal, #top_module_ref?, #top_tb_ref?, #try_call_ele, #urandom_range, #var_common, #vars_define_inst, #vars_exec_inst, #vcs_string, #verify

Constructor Details

#initialize(name: "tdlmodule", out_sv_path: nil) ⇒ TestUnitModule

Returns a new instance of TestUnitModule.



4
5
6
7
# File 'lib/tdl/sdlmodule/test_unit_module.rb', line 4

def initialize(name: "tdlmodule",out_sv_path: nil)
    super(name: name,out_sv_path: out_sv_path)
    @dve_wave_signals = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SdlModule

Instance Attribute Details

#dve_wave_signalsObject

Returns the value of attribute dve_wave_signals.



2
3
4
# File 'lib/tdl/sdlmodule/test_unit_module.rb', line 2

def dve_wave_signals
  @dve_wave_signals
end

Instance Method Details

#add_to_dve_wave(tp, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tdl/sdlmodule/test_unit_module.rb', line 19

def add_to_dve_wave(tp,&block)
    # @dve_wave_signals ||= []
    # tps.each do |e|
    #     # dve_wave_signals << e.root_ref.sub("$root.","Sim:")
    #     @dve_wave_signals << e
    # end
    # 
    @dve_wave_signals << tp
    tp.tp_instance.filter_block = block if block_given?
    @dve_wave_signals
end

#test_unit_init(&block) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/tdl/sdlmodule/test_unit_module.rb', line 9

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}\"")
        block.call 
        to_down_pass    <= 1.b1
    end
end