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

Subversion Repositories uart8systemc

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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