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

Subversion Repositories spacewiresystemc

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

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 12 redbear
int counter=0;
6 5 redbear
int data_iteration_vlog=0;
7 12 redbear
int position=0;
8 5 redbear
 
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 13 redbear
s_vpi_value value_to_tx_timec;
34 5 redbear
s_vpi_value value_to_rx;
35
 
36
s_vpi_value value_to_fsm;
37
 
38
s_vpi_value message_value;
39
 
40
s_vpi_value link_enable_value;
41
s_vpi_value auto_start_value;
42
s_vpi_value link_disable_value;
43
 
44
#define SEND_DATA               0
45
#define WAIT_DATA               1
46
 
47
#define SEND_TIME_CODE  0
48
#define WAIT_500_CYCLES 1
49
 
50 40 redbear
unsigned int LOOPBACK_VLOG_EN = 0;
51
 
52 12 redbear
unsigned int state_test=0;
53 13 redbear
unsigned int state_test_tx_timec=0;
54
unsigned int timecode=0;
55 5 redbear
 
56 40 redbear
unsigned int data_rx_received_cnt=0;
57
unsigned int fct_send_cnt=0;
58
 
59 12 redbear
unsigned int state_test_rx=0;
60 5 redbear
 
61 12 redbear
unsigned int counter_null=0;
62 5 redbear
 
63
#include "run_sim.h"
64
#include "global_init.h"
65
#include "global_reset.h"
66
 
67
#include "write_fsm_spw_ultra_light.h"
68
 
69
#include "write_tx_data_spw_ultra_light.h"
70
#include "write_tx_time_code_spw_ultra_light.h"
71
 
72
#include "receive_rx_data_spw_ultra_light.h"
73
#include "receive_rx_time_code_spw_ultra_light.h"
74
 
75
void interaction_register()
76
{
77
      s_vpi_systf_data tf_data;
78
 
79
      tf_data.type      = vpiSysTask;
80
      tf_data.sysfunctype = 0;
81
      tf_data.tfname    = "$run_sim";
82
      tf_data.calltf    = run_sim_calltf;
83
      tf_data.compiletf = 0;
84
      tf_data.sizetf    = 0;
85
      tf_data.user_data = 0;
86
      vpi_register_systf(&tf_data);
87
 
88
      //
89
      tf_data.type      = vpiSysTask;
90
      tf_data.sysfunctype = 0;
91
      tf_data.tfname    = "$write_tx_fsm_spw_ultra_light";
92
      tf_data.calltf    =   write_tx_fsm_spw_ultra_light_calltf;
93
      tf_data.compiletf = 0;
94
      tf_data.sizetf    = 0;
95
      tf_data.user_data = 0;
96
      vpi_register_systf(&tf_data);
97
 
98
      //
99
      tf_data.type      = vpiSysTask;
100
      tf_data.sysfunctype = 0;
101
      tf_data.tfname    = "$write_tx_data_spw_ultra_light";
102
      tf_data.calltf    =   write_tx_data_spw_ultra_light_calltf;
103
      tf_data.compiletf = 0;
104
      tf_data.sizetf    = 0;
105
      tf_data.user_data = 0;
106
      vpi_register_systf(&tf_data);
107
 
108
      tf_data.type      = vpiSysTask;
109
      tf_data.sysfunctype = 0;
110
      tf_data.tfname    = "$write_tx_time_code_spw_ultra_light";
111
      tf_data.calltf    =   write_tx_time_code_spw_ultra_light_calltf;
112
      tf_data.compiletf = 0;
113
      tf_data.sizetf    = 0;
114
      tf_data.user_data = 0;
115
      vpi_register_systf(&tf_data);
116
 
117
      //
118
      tf_data.type      = vpiSysTask;
119
      tf_data.sysfunctype = 0;
120
      tf_data.tfname    = "$receive_rx_data_spw_ultra_light";
121
      tf_data.calltf    =   receive_rx_data_spw_ultra_light_calltf;
122
      tf_data.compiletf = 0;
123
      tf_data.sizetf    = 0;
124
      tf_data.user_data = 0;
125
      vpi_register_systf(&tf_data);
126
 
127
      tf_data.type      = vpiSysTask;
128
      tf_data.sysfunctype = 0;
129
      tf_data.tfname    = "$receive_rx_time_code_spw_ultra_light";
130
      tf_data.calltf    =   receive_rx_time_code_spw_ultra_light_calltf;
131
      tf_data.compiletf = 0;
132
      tf_data.sizetf    = 0;
133
      tf_data.user_data = 0;
134
      vpi_register_systf(&tf_data);
135
 
136
      //
137
      tf_data.type      = vpiSysTask;
138
      tf_data.sysfunctype = 0;
139
      tf_data.tfname    = "$global_reset";
140
      tf_data.calltf    = global_reset_calltf;
141
      tf_data.compiletf = 0;
142
      tf_data.sizetf    = 0;
143
      tf_data.user_data = 0;
144
      vpi_register_systf(&tf_data);
145
 
146
      tf_data.type      = vpiSysTask;
147
      tf_data.sysfunctype = 0;
148
      tf_data.tfname    = "$global_init";
149
      tf_data.calltf    = global_init_calltf;
150
      tf_data.compiletf = 0;
151
      tf_data.sizetf    = 0;
152
      tf_data.user_data = 0;
153
      vpi_register_systf(&tf_data);
154
}
155
 
156
void (*vlog_startup_routines[])() = {
157
    interaction_register,
158
 
159
};
160
 

powered by: WebSVN 2.1.0

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