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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_suit/] [receive_rx_spw.h] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 redbear
static int receive_rx_spw_calltf(char*user_data)
2
{
3
        vpiHandle DATA_O   = vpi_handle_by_name("module_tb.DATA_O",NULL);
4
        vpiHandle RD_DATA  = vpi_handle_by_name("module_tb.RD_DATA",NULL);
5
        vpiHandle RX_EMPTY = vpi_handle_by_name("module_tb.RX_EMPTY",NULL);
6
 
7
        value_to_rx.format = vpiIntVal;
8
 
9
        if(SC_TOP->reset_set())
10
        {
11
                switch(state_test_rx)
12
                {
13
                        case WAIT_DATA:
14
                                vpi_get_value(RX_EMPTY, &value_to_rx);
15
                                if(value_to_rx.value.integer == 1)
16
                                {
17
                                        value_to_rx.value.integer = 0;
18
                                        vpi_put_value(RD_DATA, &value_to_rx, NULL, vpiNoDelay);
19
                                }else
20
                                {
21
                                        value_to_rx.value.integer = 1;
22
                                        vpi_put_value(RD_DATA, &value_to_rx, NULL, vpiNoDelay);
23
                                        state_test_rx =59;
24
                                }
25
                        break;
26
                        case 59:
27
                                        state_test_rx =70;
28
                        break;
29
                        case 70:
30
                                        state_test_rx =71;
31
                        break;
32
                        case 71:
33
                                        state_test_rx =72;
34
                        break;
35
                        case 72:
36
                                        state_test_rx =73;
37
                        break;
38
                        case 73:
39
                                        state_test_rx =74;
40
                        break;
41
                        case 74:
42
                                        state_test_rx =60;
43
                        break;
44
                        case 60:
45
                                vpi_get_value(DATA_O, &value_to_rx);
46
                                SC_TOP->data_o(value_to_rx.value.integer,data_iteration_vlog);
47
                                data_iteration_vlog++;
48
                                state_test_rx =61;
49
                        break;
50
                        case 61:
51
                                state_test_rx =WAIT_DATA;
52
                                value_to_rx.value.integer = 0;
53
                                vpi_put_value(RD_DATA, &value_to_rx, NULL, vpiNoDelay);
54
 
55 40 redbear
                                if(data_iteration_vlog > SC_TOP->size_data_test_sc())
56 5 redbear
                                        data_iteration_vlog = 0;
57
                        break;
58
                }
59
        }
60
 
61
        return 0;
62
}

powered by: WebSVN 2.1.0

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