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 12

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

powered by: WebSVN 2.1.0

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