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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [vpi/] [vpi_test_suit/] [env_global_spw.cpp] - Blame information for rev 40

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

Line No. Rev Author Line
1 5 redbear
#include <iverilog/vpi_user.h>
2
 
3
#include "../../systemC/link_sc.h"
4
 
5
int counter;
6
int data_iteration_vlog=0;
7
int position;
8
 
9
#include <stdio.h>
10
#include <iostream>
11
#include <dlfcn.h>
12
#include <random>
13
#include <string.h>
14
 
15
using namespace std;
16
 
17
void* lib_handle;
18
 
19
Control_SC* (*create)();
20
void (*destroy)(Control_SC*);
21
 
22
Control_SC* SC_TOP;
23
 
24
s_vpi_value v_generate;
25
 
26
s_vpi_value reset;
27
s_vpi_value dout_value;
28
s_vpi_value sout_value;
29
s_vpi_value din_value;
30
s_vpi_value sin_value;
31
s_vpi_value fsm_value;
32
s_vpi_value value_to_tx;
33
s_vpi_value value_to_rx;
34
 
35
s_vpi_value message_value;
36
 
37
s_vpi_value link_enable_value;
38
s_vpi_value auto_start_value;
39
s_vpi_value link_disable_value;
40
 
41
#define SEND_DATA               0
42
#define WAIT_DATA               1
43
 
44
#define SEND_TIME_CODE  0
45
#define WAIT_500_CYCLES 1
46
 
47
unsigned int state_test;
48
 
49
unsigned int state_test_rx;
50
 
51
unsigned int counter_null;
52
 
53
#include "run_sim.h"
54
#include "global_init.h"
55
#include "global_reset.h"
56
 
57
#include "write_tx_spw.h"
58
#include "receive_rx_spw.h"
59
 
60
void interaction_register()
61
{
62
      s_vpi_systf_data tf_data;
63
 
64
      tf_data.type      = vpiSysTask;
65
      tf_data.sysfunctype = 0;
66
      tf_data.tfname    = "$run_sim";
67
      tf_data.calltf    = run_sim_calltf;
68
      tf_data.compiletf = 0;
69
      tf_data.sizetf    = 0;
70
      tf_data.user_data = 0;
71
      vpi_register_systf(&tf_data);
72
 
73
      tf_data.type      = vpiSysTask;
74
      tf_data.sysfunctype = 0;
75
      tf_data.tfname    = "$write_tx_spw";
76
      tf_data.calltf    = write_tx_spw_calltf;
77
      tf_data.compiletf = 0;
78
      tf_data.sizetf    = 0;
79
      tf_data.user_data = 0;
80
      vpi_register_systf(&tf_data);
81
 
82
      tf_data.type      = vpiSysTask;
83
      tf_data.sysfunctype = 0;
84
      tf_data.tfname    = "$receive_rx_spw";
85
      tf_data.calltf    = receive_rx_spw_calltf;
86
      tf_data.compiletf = 0;
87
      tf_data.sizetf    = 0;
88
      tf_data.user_data = 0;
89
      vpi_register_systf(&tf_data);
90
 
91
      tf_data.type      = vpiSysTask;
92
      tf_data.sysfunctype = 0;
93
      tf_data.tfname    = "$global_reset";
94
      tf_data.calltf    = global_reset_calltf;
95
      tf_data.compiletf = 0;
96
      tf_data.sizetf    = 0;
97
      tf_data.user_data = 0;
98
      vpi_register_systf(&tf_data);
99
 
100
      tf_data.type      = vpiSysTask;
101
      tf_data.sysfunctype = 0;
102
      tf_data.tfname    = "$global_init";
103
      tf_data.calltf    = global_init_calltf;
104
      tf_data.compiletf = 0;
105
      tf_data.sizetf    = 0;
106
      tf_data.user_data = 0;
107
      vpi_register_systf(&tf_data);
108
}
109
 
110
void (*vlog_startup_routines[])() = {
111
    interaction_register,
112
 
113
};
114
 

powered by: WebSVN 2.1.0

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