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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_stress/] [receive_rx_data_spw_ultra_light.h] - Blame information for rev 21

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

Line No. Rev Author Line
1 5 redbear
static int receive_rx_data_spw_ultra_light_calltf(char*user_data)
2
{
3
        vpiHandle CREDIT_ERROR_RX  = vpi_handle_by_name("module_tb.CREDIT_ERROR_RX",NULL);
4
        vpiHandle SEND_FCT_NOW     = vpi_handle_by_name("module_tb.TOP_SEND_FCT_NOW",NULL);
5
 
6
        vpiHandle DATARX_FLAG      = vpi_handle_by_name("module_tb.DATARX_FLAG",NULL);
7
        vpiHandle BUFFER_WRITE     = vpi_handle_by_name("module_tb.BUFFER_WRITE",NULL);
8
 
9 21 redbear
        value_to_rx.format = vpiIntVal;
10
 
11
        if(SC_TOP->reset_set())
12
        {
13
 
14
                value_to_rx.value.integer = 0;
15
                vpi_put_value(SEND_FCT_NOW, &value_to_rx, NULL, vpiNoDelay);
16 5 redbear
 
17 21 redbear
                vpi_get_value(DATARX_FLAG, &value_to_rx);
18
                SC_TOP->data_o(value_to_rx.value.integer,data_rx_received_cnt);
19
 
20
                data_rx_received_cnt++;
21 5 redbear
 
22 21 redbear
                if(data_rx_received_cnt == 100)
23
                        data_rx_received_cnt = 0;
24
 
25
                fct_send_cnt++;
26
 
27
                if(fct_send_cnt == 7)
28
                {
29
                        value_to_rx.value.integer = 1;
30
                        vpi_put_value(SEND_FCT_NOW, &value_to_rx, NULL, vpiNoDelay);
31
                        fct_send_cnt = 0;
32
                }
33
 
34
        }
35
 
36 5 redbear
        return 0;
37
}

powered by: WebSVN 2.1.0

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