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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_suit/] [run_sim.h] - Blame information for rev 14

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
 
4
        vpiHandle LINKSTART  = vpi_handle_by_name("module_tb.LINK_START",NULL);
5
        vpiHandle LINKDISABLE= vpi_handle_by_name("module_tb.LINK_DISABLE",NULL);
6
        vpiHandle AUTOSTART  = vpi_handle_by_name("module_tb.AUTOSTART",NULL);
7
 
8
        vpiHandle DOUT       = vpi_handle_by_name("module_tb.Dout", NULL);
9
        vpiHandle SOUT       = vpi_handle_by_name("module_tb.Sout", NULL);
10
        vpiHandle DIN        = vpi_handle_by_name("module_tb.Din", NULL);
11
        vpiHandle SIN        = vpi_handle_by_name("module_tb.Sin", NULL);
12
 
13
        vpiHandle DTA        = vpi_handle_by_name("module_tb.SPW_SC_FSM", NULL);
14
        vpiHandle TX_CLOCK_OUT        = vpi_handle_by_name("module_tb.TX_CLOCK_OUT", NULL);
15
 
16
        vpiHandle i          = vpi_handle_by_name("module_tb.i", NULL);
17
 
18
        dout_value.format    = vpiIntVal;
19
        sout_value.format    = vpiIntVal;
20
 
21
        din_value.format     = vpiIntVal;
22
        sin_value.format     = vpiIntVal;
23
 
24
        fsm_value.format     = vpiIntVal;
25
 
26
        link_enable_value.format    = vpiIntVal;
27
        auto_start_value.format     = vpiIntVal;
28
        link_disable_value.format   = vpiIntVal;
29
 
30
        v_generate.format=vpiIntVal;
31
        //fsm_value.format     = vpiIntVal;
32
        //message_value.format = vpiIntVal;
33
 
34
        if(SC_TOP->finish_simulation() == 1)
35
        {
36
                v_generate.value.integer = 1;
37
                vpi_put_value(i, &v_generate, NULL, vpiNoDelay);
38
                SC_TOP->stop_sim();
39
                destroy(SC_TOP);
40
        }
41
        else
42
        {
43
                SC_TOP->run_sim();
44
 
45
                link_enable_value.value.integer  = SC_TOP->verilog_linkenable();
46
                vpi_put_value(LINKSTART, &link_enable_value, NULL, vpiNoDelay);
47
 
48
                auto_start_value.value.integer   = SC_TOP->verilog_autostart();
49
                vpi_put_value(AUTOSTART, &auto_start_value, NULL, vpiNoDelay);
50
 
51
                link_disable_value.value.integer = SC_TOP->verilog_linkdisable();
52
                vpi_put_value(LINKDISABLE, &link_disable_value, NULL, vpiNoDelay);
53
 
54
                sin_value.value.integer = SC_TOP->get_value_sout();
55
                din_value.value.integer = SC_TOP->get_value_dout();
56
                vpi_put_value(DIN, &din_value, NULL, vpiNoDelay);
57
                vpi_put_value(SIN, &sin_value, NULL, vpiNoDelay);
58
 
59
                vpi_get_value(SOUT, &sout_value);
60
                vpi_get_value(DOUT, &dout_value);
61
                SC_TOP->set_rx_sin(sout_value.value.integer);
62
                SC_TOP->set_rx_din(dout_value.value.integer);
63
 
64
                //fsm_value.value.integer = SC_TOP->get_spw_fsm();
65
                //vpi_put_value(DTA, &fsm_value, NULL, vpiNoDelay);
66
 
67
                //fsm_value.value.integer = SC_TOP->clock_tx();
68
                //vpi_put_value(TX_CLOCK_OUT, &fsm_value, NULL, vpiNoDelay);
69
 
70
        }
71
 
72
 
73
        return 0;
74
}

powered by: WebSVN 2.1.0

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