Пример #1
0
def hello_world(dut):
    #  `include "packet.sv"
    #  `include "producer.sv"
    #  `include "consumer.sv"
    #  `include "top.sv"
    #
    #  top mytop;
    #
    #  initial begin
    #    $timeformat(-9,0," ns",5);
    #    uvm_default_table_printer.knobs.name_width=20;
    #    uvm_default_table_printer.knobs.type_width=50;
    #    uvm_default_table_printer.knobs.size_width=10;
    #    uvm_default_table_printer.knobs.value_width=14;
    #    uvm_config_int::set(null, "top.producer1","num_packets",2);
    #    uvm_config_int::set(null, "top.producer2","num_packets",4);
    #    uvm_config_int::set(null, "*","recording_detail",UVM_LOW);
    #    //uvm_default_printer = uvm_default_tree_printer;
    #    uvm_default_printer.knobs.reference=0;
    mytop = top("top", parent=None)
    #    uvm_default_table_printer.knobs.type_width=20;
    yield run_test()

    if mytop.error:
        raise Exception("mytop had errors")
Пример #2
0
def uvm_phase_test(dut):
    uvm_root = UVMRoot.get()
    test_comp = CompPhaseTest('comp_phase_test', uvm_root)
    clp = UVMCmdlineProcessor.get_inst()
    print("tool=" + clp.get_tool_name() + " version=" + clp.get_tool_version())
    yield run_test()
    yield test_comp.m_done_event.wait()
    if not test_comp.all_done:
        raise Exception('Error in comp_phase_test')
Пример #3
0
def test_module_top(dut):

    mu = myunit("mu", None)
    bar = mydata()

    uvm_top.finish_on_completion = 0
    UVMConfigDb.set(None, "mu.*", "data", 101)
    UVMConfigDb.set(None, "mu.*", "str", "hi")
    UVMConfigDb.set(None, "mu.l1", "data", 55)
    UVMConfigDb.set(None, "mu.*", "obj", bar)
    mu.print()
    yield run_test()
    mu.print()
Пример #4
0
def test_module_top(dut):
    UVMPhase.m_phase_trace = True
    e = env("env_name", parent=None)
    uvm_info("top", "In top initial block", UVM_MEDIUM)
    yield run_test()
    sim_time = sim_time = get_sim_time('ns')

    if sim_time == 0:
        raise Exception('Sim time has not progressed')
    else:
        if sim_time < 50.0:
            msg = "Exp: > 50, got: " + str(sim_time)
            raise Exception('Wrong sim time at the end: ' + msg)
    if e.error is True:
        raise Exception('Env had errors')
Пример #5
0
def component_test(dut):
    cc = MyComponent("Top", None)
    print(cc.get_full_name())
    yield run_test()
    sim_time = get_sim_time()
    yield Timer(1001, 'ns')

    if sim_time == 0:
        raise Exception('Sim time has not progressed')
    else:
        sim_time = get_sim_time('ns')
        print("Sim time at the end is " + str(get_sim_time('ns')))
        if str(sim_time) != "2004.0":
            msg = "Exp: 2004.0, got: " + str(sim_time)
            raise Exception('Wrong sim time at the end: ' + msg)
Пример #6
0
def uvm_basic_top_test(dut):
    """ Test for checking that UVM is up and running """
    test = UVMTest('my test', None)
    test.dut = dut
    yield run_test('MyTest')
Пример #7
0
def module_top(dut):
    # Main body of module top:
    e = env("prod_cons_env")
    yield run_test()
Пример #8
0
def initial1():
    yield run_test()