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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_stress/] [global_init.h] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 redbear
static int global_init_calltf(char*user_data)
2
{
3
 
4
        vpiHandle TX_DATA      = vpi_handle_by_name("module_tb.TOP_TX_DATA",NULL);
5
        vpiHandle TX_WRITE     = vpi_handle_by_name("module_tb.TOP_TX_WRITE",NULL);
6
        vpiHandle TX_TICK      = vpi_handle_by_name("module_tb.TOP_TX_TICK",NULL);
7
        vpiHandle TX_TIME      = vpi_handle_by_name("module_tb.TOP_TX_TIME",NULL);
8
 
9 40 redbear
        vpiHandle BUFFER_READ   = vpi_handle_by_name("module_tb.BUFFER_READ",NULL);
10
        //vpiHandle TOPSENDFCTNOW    = vpi_handle_by_name("module_tb.TOP_SEND_FCT_NOW",NULL);
11 5 redbear
 
12
        vpiHandle LINKSTART    = vpi_handle_by_name("module_tb.LINK_START",NULL);
13
        vpiHandle LINKDISABLE  = vpi_handle_by_name("module_tb.LINK_DISABLE",NULL);
14
        vpiHandle AUTOSTART    = vpi_handle_by_name("module_tb.AUTO_START",NULL);
15
        vpiHandle RESETn       = vpi_handle_by_name("module_tb.RESETN",NULL);
16
 
17
        vpiHandle DOUT         = vpi_handle_by_name("module_tb.TOP_DOUT", NULL);
18
        vpiHandle SOUT         = vpi_handle_by_name("module_tb.TOP_SOUT", NULL);
19
 
20
        dout_value.format = vpiIntVal;
21
        sout_value.format = vpiIntVal;
22
 
23
        counter = 0;
24
        position = 0;
25
        counter_null = 0;
26
        state_test_rx=0;
27 13 redbear
        state_test_tx_timec=0;
28 5 redbear
 
29
        lib_handle = dlopen("./final_spw.so", RTLD_LAZY);
30
 
31
        if(!lib_handle)
32
        {
33
                fprintf(stderr, "%s\n", dlerror());
34
        }
35
 
36
        create = (Control_SC* (*)())dlsym(lib_handle, "create_object");
37
        destroy = (void (*)(Control_SC*))dlsym(lib_handle, "destroy_object");
38
 
39
        SC_TOP = (Control_SC*)create();
40
        SC_TOP->init();
41
 
42
        //SC_TOP->reset_set_low();
43
 
44
        sout_value.value.integer = SC_TOP->get_value_sout();
45
        dout_value.value.integer = SC_TOP->get_value_dout();
46
 
47
        vpi_put_value(DOUT, &dout_value, NULL, vpiNoDelay);
48
        vpi_put_value(SOUT, &sout_value, NULL, vpiNoDelay);
49
 
50
        dout_value.value.integer = 0;
51
        vpi_put_value(LINKSTART, &dout_value, NULL  , vpiNoDelay);
52
        vpi_put_value(LINKDISABLE, &dout_value, NULL, vpiNoDelay);
53
        vpi_put_value(AUTOSTART, &dout_value, NULL  ,vpiNoDelay);
54
 
55 40 redbear
        //vpi_put_value(CREDITERRORRX, &dout_value, NULL , vpiNoDelay);
56
        vpi_put_value(BUFFER_READ, &dout_value, NULL, vpiNoDelay);
57 5 redbear
 
58
        vpi_put_value(TX_DATA, &dout_value, NULL , vpiNoDelay);
59
        vpi_put_value(TX_WRITE, &dout_value, NULL, vpiNoDelay);
60
 
61
        vpi_put_value(TX_TICK, &dout_value, NULL , vpiNoDelay);
62
        vpi_put_value(TX_TIME, &dout_value, NULL , vpiNoDelay);
63
 
64
        dout_value.value.integer = 1;
65
        vpi_put_value(RESETn, &dout_value, NULL  , vpiNoDelay);
66
 
67
        return 0;
68
}

powered by: WebSVN 2.1.0

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