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 13

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 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 12 redbear
unsigned int state_test=0;
51 13 redbear
unsigned int state_test_tx_timec=0;
52
unsigned int timecode=0;
53 5 redbear
 
54 12 redbear
unsigned int state_test_rx=0;
55 5 redbear
 
56 12 redbear
unsigned int counter_null=0;
57 5 redbear
 
58
#include "run_sim.h"
59
#include "global_init.h"
60
#include "global_reset.h"
61
 
62
#include "write_fsm_spw_ultra_light.h"
63
 
64
#include "write_tx_data_spw_ultra_light.h"
65
#include "write_tx_time_code_spw_ultra_light.h"
66
 
67
#include "receive_rx_data_spw_ultra_light.h"
68
#include "receive_rx_time_code_spw_ultra_light.h"
69
 
70
void interaction_register()
71
{
72
      s_vpi_systf_data tf_data;
73
 
74
      tf_data.type      = vpiSysTask;
75
      tf_data.sysfunctype = 0;
76
      tf_data.tfname    = "$run_sim";
77
      tf_data.calltf    = run_sim_calltf;
78
      tf_data.compiletf = 0;
79
      tf_data.sizetf    = 0;
80
      tf_data.user_data = 0;
81
      vpi_register_systf(&tf_data);
82
 
83
      //
84
      tf_data.type      = vpiSysTask;
85
      tf_data.sysfunctype = 0;
86
      tf_data.tfname    = "$write_tx_fsm_spw_ultra_light";
87
      tf_data.calltf    =   write_tx_fsm_spw_ultra_light_calltf;
88
      tf_data.compiletf = 0;
89
      tf_data.sizetf    = 0;
90
      tf_data.user_data = 0;
91
      vpi_register_systf(&tf_data);
92
 
93
      //
94
      tf_data.type      = vpiSysTask;
95
      tf_data.sysfunctype = 0;
96
      tf_data.tfname    = "$write_tx_data_spw_ultra_light";
97
      tf_data.calltf    =   write_tx_data_spw_ultra_light_calltf;
98
      tf_data.compiletf = 0;
99
      tf_data.sizetf    = 0;
100
      tf_data.user_data = 0;
101
      vpi_register_systf(&tf_data);
102
 
103
      tf_data.type      = vpiSysTask;
104
      tf_data.sysfunctype = 0;
105
      tf_data.tfname    = "$write_tx_time_code_spw_ultra_light";
106
      tf_data.calltf    =   write_tx_time_code_spw_ultra_light_calltf;
107
      tf_data.compiletf = 0;
108
      tf_data.sizetf    = 0;
109
      tf_data.user_data = 0;
110
      vpi_register_systf(&tf_data);
111
 
112
      //
113
      tf_data.type      = vpiSysTask;
114
      tf_data.sysfunctype = 0;
115
      tf_data.tfname    = "$receive_rx_data_spw_ultra_light";
116
      tf_data.calltf    =   receive_rx_data_spw_ultra_light_calltf;
117
      tf_data.compiletf = 0;
118
      tf_data.sizetf    = 0;
119
      tf_data.user_data = 0;
120
      vpi_register_systf(&tf_data);
121
 
122
      tf_data.type      = vpiSysTask;
123
      tf_data.sysfunctype = 0;
124
      tf_data.tfname    = "$receive_rx_time_code_spw_ultra_light";
125
      tf_data.calltf    =   receive_rx_time_code_spw_ultra_light_calltf;
126
      tf_data.compiletf = 0;
127
      tf_data.sizetf    = 0;
128
      tf_data.user_data = 0;
129
      vpi_register_systf(&tf_data);
130
 
131
      //
132
      tf_data.type      = vpiSysTask;
133
      tf_data.sysfunctype = 0;
134
      tf_data.tfname    = "$global_reset";
135
      tf_data.calltf    = global_reset_calltf;
136
      tf_data.compiletf = 0;
137
      tf_data.sizetf    = 0;
138
      tf_data.user_data = 0;
139
      vpi_register_systf(&tf_data);
140
 
141
      tf_data.type      = vpiSysTask;
142
      tf_data.sysfunctype = 0;
143
      tf_data.tfname    = "$global_init";
144
      tf_data.calltf    = global_init_calltf;
145
      tf_data.compiletf = 0;
146
      tf_data.sizetf    = 0;
147
      tf_data.user_data = 0;
148
      vpi_register_systf(&tf_data);
149
}
150
 
151
void (*vlog_startup_routines[])() = {
152
    interaction_register,
153
 
154
};
155
 

powered by: WebSVN 2.1.0

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