-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmisc_single_source.sv
281 lines (253 loc) · 7.57 KB
/
misc_single_source.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.4.15
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: B ()
//
module B // "test_top.dut.a"
(
input logic clk,
input logic nrst,
input logic run_core_req,
input logic [15:0] run_core_data,
input logic resp_core_ready
);
// Variables generated for SystemC signals
logic run_core_ready;
logic run_get_req;
logic run_get_req_d;
logic run_reg_full;
logic run_reg_full_d;
logic run_core_req_d;
logic [15:0] run_core_data_d;
logic resp_core_req;
logic [15:0] resp_core_data;
logic resp_put_req;
logic resp_put_req_d;
logic resp_core_req_d;
logic resp_core_ready_d;
logic resp_sync_req;
logic [15:0] resp_sync_data;
logic run_clk;
logic run_nrst;
logic resp_clk;
logic resp_nrst;
// Local parameters generated for C++ constants
localparam logic run_SYNC = 0;
localparam logic run_CTHREAD = 0;
localparam logic run_ALWAYS_READY = 0;
localparam logic resp_SYNC = 1;
localparam logic resp_CTHREAD = 0;
localparam logic resp_ALWAYS_READY = 0;
localparam logic [63:0] resp_ALL_ENABLED0 = 64'hFFFFFFFFFFFFFFFF;
// Assignments generated for C++ channel arrays
assign run_clk = clk;
assign run_nrst = nrst;
assign resp_clk = clk;
assign resp_nrst = nrst;
//------------------------------------------------------------------------------
// Method process: run_ready_control (sct_target.h:224:5)
always_comb
begin : run_ready_control // sct_target.h:224:5
logic A;
A = run_get_req_d;
run_core_ready = A || !run_reg_full;
end
//------------------------------------------------------------------------------
// Method process: run_full_control (sct_target.h:229:5)
always_comb
begin : run_full_control // sct_target.h:229:5
logic A;
A = run_get_req_d;
if (A)
begin
run_reg_full = 0;
end else begin
if (run_core_req_d)
begin
run_reg_full = 1;
end else begin
run_reg_full = run_reg_full_d;
end
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: run_core_thread (sct_target.h:241:5)
// Thread-local variables
logic run_get_req_d_next;
logic run_core_req_d_next;
logic run_reg_full_d_next;
logic [15:0] run_core_data_d_next;
// Next-state combinational logic
always_comb begin : run_core_thread_comb // sct_target.h:241:5
run_core_thread_func;
end
function void run_core_thread_func;
run_core_data_d_next = run_core_data_d;
run_core_req_d_next = run_core_req_d;
run_get_req_d_next = run_get_req_d;
run_reg_full_d_next = run_reg_full_d;
run_get_req_d_next = run_get_req;
run_core_req_d_next = run_core_req;
run_reg_full_d_next = run_reg_full;
if (run_core_req && !run_reg_full)
begin
run_core_data_d_next = run_core_data;
end
endfunction
// Synchronous register update
always_ff @(posedge run_clk or negedge run_nrst)
begin : run_core_thread_ff
if ( ~run_nrst ) begin
run_get_req_d <= 0;
run_core_req_d <= 0;
run_reg_full_d <= 0;
run_core_data_d <= 0;
end
else begin
run_get_req_d <= run_get_req_d_next;
run_core_req_d <= run_core_req_d_next;
run_reg_full_d <= run_reg_full_d_next;
run_core_data_d <= run_core_data_d_next;
end
end
//------------------------------------------------------------------------------
// Method process: run_put_to_fifo (sct_target.h:210:5)
// Empty process, no code generated
//------------------------------------------------------------------------------
// Method process: resp_req_control (sct_initiator.h:202:5)
always_comb
begin : resp_req_control // sct_initiator.h:202:5
logic A;
A = resp_put_req != resp_put_req_d;
if (A)
begin
resp_core_req = 1;
end else begin
if (resp_core_ready_d)
begin
resp_core_req = 0;
end else begin
resp_core_req = resp_core_req_d;
end
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: resp_core_thread (sct_initiator.h:218:5)
// Thread-local variables
logic resp_put_req_d_next;
logic resp_core_req_d_next;
logic resp_core_ready_d_next;
// Next-state combinational logic
always_comb begin : resp_core_thread_comb // sct_initiator.h:218:5
resp_core_thread_func;
end
function void resp_core_thread_func;
resp_core_ready_d_next = resp_core_ready_d;
resp_core_req_d_next = resp_core_req_d;
resp_put_req_d_next = resp_put_req_d;
resp_put_req_d_next = resp_put_req;
resp_core_req_d_next = resp_core_req;
resp_core_ready_d_next = resp_core_ready;
endfunction
// Synchronous register update
always_ff @(posedge resp_clk or negedge resp_nrst)
begin : resp_core_thread_ff
if ( ~resp_nrst ) begin
resp_put_req_d <= 0;
resp_core_req_d <= 0;
resp_core_ready_d <= 0;
end
else begin
resp_put_req_d <= resp_put_req_d_next;
resp_core_req_d <= resp_core_req_d_next;
resp_core_ready_d <= resp_core_ready_d_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: resp_sync_thread (sct_initiator.h:181:5)
// Thread-local variables
logic resp_put_req_next;
logic [15:0] resp_core_data_next;
// Next-state combinational logic
always_comb begin : resp_sync_thread_comb // sct_initiator.h:181:5
resp_sync_thread_func;
end
function void resp_sync_thread_func;
logic A;
resp_core_data_next = resp_core_data;
resp_put_req_next = resp_put_req;
A = resp_sync_req;
if (A && resp_core_ready)
begin
resp_put_req_next = !resp_put_req;
resp_core_data_next = resp_sync_data;
end
endfunction
// Synchronous register update
always_ff @(posedge resp_clk or negedge resp_nrst)
begin : resp_sync_thread_ff
if ( ~resp_nrst ) begin
resp_put_req <= 0;
resp_core_data <= 0;
end
else begin
resp_put_req <= resp_put_req_next;
resp_core_data <= resp_core_data_next;
end
end
//------------------------------------------------------------------------------
// Method process: methProc (test_single_source.cpp:29:5)
always_comb
begin : methProc // test_single_source.cpp:29:5
logic TMP_0;
logic TMP_1;
logic [15:0] TMP_2;
logic A;
logic TMP_3;
logic mask;
// Call reset_get() begin
run_get_req = 0;
// Call reset_get() end
// Call reset_put() begin
resp_sync_req = 0;
resp_sync_data = 0;
// Call reset_put() end
// Call request() begin
TMP_0 = run_core_req || run_reg_full;
// Call request() end
// Call ready() begin
TMP_1 = resp_core_ready;
// Call ready() end
if (TMP_0 && TMP_1)
begin
// Call get() begin
A = (run_core_req || run_reg_full);
if (A)
begin
run_get_req = 1;
end else begin
run_get_req = 0;
end
TMP_2 = (run_SYNC || run_reg_full) ? run_core_data_d : run_core_data;
// Call get() end
mask = resp_ALL_ENABLED0;
// Call put() begin
if (resp_core_ready)
begin
resp_sync_req = mask;
resp_sync_data = TMP_2;
TMP_3 = mask;
end else begin
resp_sync_req = 0;
resp_sync_data = 0;
TMP_3 = 0;
end
// Call put() end
end
end
endmodule