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

Subversion Repositories uart8systemc

[/] [uart8systemc/] [trunk/] [vpi/] [counter_global.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 redbear
static int global_counter_calltf(char*user_data)
2
{
3
                vpiHandle i = vpi_handle_by_name("module_tb.i", NULL);
4
                vpiHandle READY     = vpi_handle_by_name("module_tb.READY", NULL);
5
                vpiHandle RESET     = vpi_handle_by_name("module_tb.RESET", NULL);
6
 
7
                v_generate.format=vpiIntVal;
8
                ready_rx.format  =vpiIntVal;
9
                reset.format    = vpiIntVal;
10
 
11
 
12
                if(counter > 100)
13
                {
14
                        v_generate.value.integer = 1;
15
                        vpi_put_value(i, &v_generate, NULL, vpiNoDelay);
16
                        SC_UART->stop_sim();
17
                        destroy(SC_UART);
18
                }
19
 
20
                vpi_get_value(READY, &ready_rx);
21
                vpi_get_value(RESET, &reset);
22
 
23
                if(ready_rx.value.integer == 1 && reset.value.integer == 0)
24
                {
25
                        counter = counter + 1;
26
                }
27
 
28
 
29
                return 0;
30
 
31
}

powered by: WebSVN 2.1.0

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