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

Subversion Repositories uart8systemc

[/] [uart8systemc/] [trunk/] [vpi/] [env_uart.cpp] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 redbear
#include "../iverilog/vpi_user.h"
2
 
3
#include "../systemC/link_sc.h"
4
 
5
int counter;
6
int counter_reset;
7
 
8
#include <stdio.h>
9
#include <iostream>
10
#include <dlfcn.h>
11
#include <random>
12
#include<string.h>
13
 
14
using namespace std;
15
 
16
void* lib_handle;
17
 
18
Control_SC* (*create)();
19
void (*destroy)(Control_SC*);
20
 
21
Control_SC* SC_UART;
22
 
23
s_vpi_value v_generate;
24
 
25
s_vpi_value reset;
26
s_vpi_value rx_value;
27
s_vpi_value tx_value;
28
 
29
s_vpi_value ready_rx;
30
s_vpi_value start_tx;
31
s_vpi_value ready_tx;
32
 
33
#include "execute_uart.h"
34
#include "reset_uart.h"
35
#include "global_init.h"
36
#include "counter_global.h"
37
 
38
void Leitura_register()
39
{
40
      s_vpi_systf_data tf_data;
41
 
42
      tf_data.type      = vpiSysTask;
43
      tf_data.sysfunctype = 0;
44
      tf_data.tfname    = "$execute_uart";
45
      tf_data.calltf    = execute_uart_calltf;
46
      tf_data.compiletf = 0;
47
      tf_data.sizetf    = 0;
48
      tf_data.user_data = 0;
49
      vpi_register_systf(&tf_data);
50
 
51
      tf_data.type      = vpiSysTask;
52
      tf_data.sysfunctype = 0;
53
      tf_data.tfname    = "$reset_uart";
54
      tf_data.calltf    = reset_uart_calltf;
55
      tf_data.compiletf = 0;
56
      tf_data.sizetf    = 0;
57
      tf_data.user_data = 0;
58
      vpi_register_systf(&tf_data);
59
 
60
      tf_data.type      = vpiSysTask;
61
      tf_data.sysfunctype = 0;
62
      tf_data.tfname    = "$global_counter";
63
      tf_data.calltf    = global_counter_calltf;
64
      tf_data.compiletf = 0;
65
      tf_data.sizetf    = 0;
66
      tf_data.user_data = 0;
67
      vpi_register_systf(&tf_data);
68
 
69
      tf_data.type      = vpiSysTask;
70
      tf_data.sysfunctype = 0;
71
      tf_data.tfname    = "$global_init";
72
      tf_data.calltf    = global_init_calltf;
73
      tf_data.compiletf = 0;
74
      tf_data.sizetf    = 0;
75
      tf_data.user_data = 0;
76
      vpi_register_systf(&tf_data);
77
}
78
 
79
void (*vlog_startup_routines[])() = {
80
    Leitura_register,
81
 
82
};
83
 

powered by: WebSVN 2.1.0

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