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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_suit/] [write_tx_spw.h] - Blame information for rev 28

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

Line No. Rev Author Line
1 5 redbear
static int write_tx_spw_calltf(char*user_data)
2
{
3
        vpiHandle DATA_I   = vpi_handle_by_name("module_tb.DATA_I",NULL);
4
        vpiHandle WR_DATA  = vpi_handle_by_name("module_tb.WR_DATA",NULL);
5
        vpiHandle TX_FULL  = vpi_handle_by_name("module_tb.TX_FULL",NULL);
6
 
7
        value_to_tx.format = vpiIntVal;
8
 
9
        if(SC_TOP->reset_set())
10
        {
11
                if(SC_TOP->start_tx_test())
12
                {
13
                        switch(state_test)
14
                        {
15
                                case SEND_DATA:
16
                                        value_to_tx.value.integer = SC_TOP->take_data(position);
17
                                        vpi_put_value(DATA_I, &value_to_tx, NULL, vpiNoDelay);
18
                                        state_test = 59;
19
                                break;
20
                                case 59:
21
                                        value_to_tx.value.integer = 1;
22
                                        vpi_put_value(WR_DATA, &value_to_tx, NULL, vpiNoDelay);
23
                                        state_test = WAIT_DATA;
24
                                break;
25
                                case WAIT_DATA:
26
                                        value_to_tx.value.integer = 0;
27
                                        vpi_put_value(WR_DATA, &value_to_tx, NULL, vpiNoDelay);
28
 
29
                                        if(position <= SC_TOP->size_data_test())
30
                                        {
31
                                                vpi_get_value(TX_FULL, &value_to_tx);
32
                                                if(value_to_tx.value.integer == 1)
33
                                                {
34
                                                }
35
                                                else
36
                                                {
37
                                                        state_test = SEND_DATA;
38
                                                        //counter = counter + 1;
39
                                                        position = position + 1;
40
                                                }
41
                                        }
42
                                        if(position > SC_TOP->size_data_test())
43
                                        {
44
                                                state_test = 60;
45
                                        }
46
                                break;
47
                                case 60:
48
                                        SC_TOP->end_tx_test();
49
                                        counter = position = state_test = 0;
50
                                break;
51
                        }
52
                }
53
 
54
                if(SC_TOP->enable_time_code_tx_test())
55
                {
56
 
57
                }
58
        }
59
 
60
        return 0;
61
}

powered by: WebSVN 2.1.0

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