OpenCores
URL https://opencores.org/ocsvn/spacewiresystemc/spacewiresystemc/trunk

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_stress/] [run_sim.h] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 redbear
static int run_sim_calltf(char*user_data)
2
{
3
        vpiHandle DOUT         = vpi_handle_by_name("module_tb.TOP_DOUT", NULL);
4
        vpiHandle SOUT         = vpi_handle_by_name("module_tb.TOP_SOUT", NULL);
5
        vpiHandle DIN          = vpi_handle_by_name("module_tb.TOP_DIN", NULL);
6
        vpiHandle SIN          = vpi_handle_by_name("module_tb.TOP_SIN", NULL);
7
 
8
        //vpiHandle DTA        = vpi_handle_by_name("module_tb.SPW_SC_FSM", NULL);
9
        //vpiHandle TX_CLOCK_OUT        = vpi_handle_by_name("module_tb.TX_CLOCK_OUT", NULL);
10
 
11
        vpiHandle i          = vpi_handle_by_name("module_tb.i", NULL);
12
 
13
        dout_value.format    = vpiIntVal;
14
        sout_value.format    = vpiIntVal;
15
 
16
        din_value.format     = vpiIntVal;
17
        sin_value.format     = vpiIntVal;
18
 
19
        fsm_value.format     = vpiIntVal;
20
 
21
        v_generate.format=vpiIntVal;
22
        //fsm_value.format     = vpiIntVal;
23
        //message_value.format = vpiIntVal;
24
 
25
        if(SC_TOP->finish_simulation() == 1)
26
        {
27
                v_generate.value.integer = 1;
28
                vpi_put_value(i, &v_generate, NULL, vpiNoDelay);
29
                SC_TOP->stop_sim();
30
                destroy(SC_TOP);
31
        }
32
        else
33
        {
34
                SC_TOP->run_sim();
35
 
36
                sin_value.value.integer = SC_TOP->get_value_sout();
37
                din_value.value.integer = SC_TOP->get_value_dout();
38
                vpi_put_value(DIN, &din_value, NULL, vpiNoDelay);
39
                vpi_put_value(SIN, &sin_value, NULL, vpiNoDelay);
40
 
41
                vpi_get_value(SOUT, &sout_value);
42
                vpi_get_value(DOUT, &dout_value);
43
                SC_TOP->set_rx_sin(sout_value.value.integer);
44
                SC_TOP->set_rx_din(dout_value.value.integer);
45
 
46
                //fsm_value.value.integer = SC_TOP->get_spw_fsm();
47
                //vpi_put_value(DTA, &fsm_value, NULL, vpiNoDelay);
48
 
49
                //fsm_value.value.integer = SC_TOP->clock_tx();
50
                //vpi_put_value(TX_CLOCK_OUT, &fsm_value, NULL, vpiNoDelay);
51
 
52
        }
53
 
54
 
55
        return 0;
56
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.