-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmisc_single_state_thread.sv
476 lines (421 loc) · 13.6 KB
/
misc_single_state_thread.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.6.6
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: test_mod ()
//
module test_mod // "t"
(
input logic clk
);
// Variables generated for SystemC signals
logic rstn;
logic signed [31:0] t0;
logic signed [31:0] t1;
logic signed [31:0] t2;
logic signed [31:0] t3;
logic signed [31:0] t4;
logic signed [31:0] t5;
logic signed [31:0] t6;
logic signed [31:0] t7;
logic signed [31:0] t7a;
logic signed [31:0] t8;
logic signed [31:0] t9;
//------------------------------------------------------------------------------
// Clocked THREAD: single_state_thread0 (test_single_state_thread.cpp:71:5)
// Thread-local variables
logic signed [31:0] x;
logic signed [31:0] x_next;
logic signed [31:0] t0_next;
// Next-state combinational logic
always_comb begin : single_state_thread0_comb // test_single_state_thread.cpp:71:5
single_state_thread0_func;
end
function void single_state_thread0_func;
t0_next = t0;
x_next = x;
x_next++;
t0_next = x_next;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : single_state_thread0_ff
if ( ~rstn ) begin
x <= 0;
end
else begin
x <= x_next;
t0 <= t0_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: single_state_thread1 (test_single_state_thread.cpp:82:5)
// Thread-local variables
logic signed [31:0] x0;
logic signed [31:0] x_next0;
logic signed [31:0] t1_next;
// Next-state combinational logic
always_comb begin : single_state_thread1_comb // test_single_state_thread.cpp:82:5
single_state_thread1_func;
end
function void single_state_thread1_func;
t1_next = t1;
x_next0 = x0;
t1_next = x_next0++;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : single_state_thread1_ff
if ( ~rstn ) begin
x0 <= 0;
end
else begin
x0 <= x_next0;
t1 <= t1_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: single_state_thread2 (test_single_state_thread.cpp:92:5)
// Thread-local variables
logic signed [31:0] x1;
logic signed [31:0] x_next1;
logic signed [31:0] t2_next;
// Next-state combinational logic
always_comb begin : single_state_thread2_comb // test_single_state_thread.cpp:92:5
single_state_thread2_func;
end
function void single_state_thread2_func;
t2_next = t2;
x_next1 = x1;
x_next1++;
t2_next = x_next1;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : single_state_thread2_ff
if ( ~rstn ) begin
x1 <= 0;
end
else begin
x1 <= x_next1;
t2 <= t2_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: single_state_thread3 (test_single_state_thread.cpp:103:5)
// Thread-local variables
logic signed [31:0] x2;
logic signed [31:0] x_next2;
logic signed [31:0] t3_next;
// Next-state combinational logic
always_comb begin : single_state_thread3_comb // test_single_state_thread.cpp:103:5
single_state_thread3_func;
end
function void single_state_thread3_func;
t3_next = t3;
x_next2 = x2;
t3_next = x_next2++;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : single_state_thread3_ff
if ( ~rstn ) begin
x2 <= 0;
end
else begin
x2 <= x_next2;
t3 <= t3_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: single_state_thread4 (test_single_state_thread.cpp:116:5)
// Thread-local variables
logic signed [31:0] x3;
logic signed [31:0] x_next3;
logic signed [31:0] t4_next;
// Next-state combinational logic
always_comb begin : single_state_thread4_comb // test_single_state_thread.cpp:116:5
single_state_thread4_func;
end
function void single_state_thread4_func;
t4_next = t4;
x_next3 = x3;
t4_next = x_next3++;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : single_state_thread4_ff
if ( ~rstn ) begin
x3 <= 0;
end
else begin
x3 <= x_next3;
t4 <= t4_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread0 (test_single_state_thread.cpp:126:5)
// Thread-local variables
logic signed [31:0] x4;
logic signed [31:0] x_next4;
logic signed [31:0] t5_next;
logic multistate_thread0_PROC_STATE;
logic multistate_thread0_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread0_comb // test_single_state_thread.cpp:126:5
multistate_thread0_func;
end
function void multistate_thread0_func;
t5_next = t5;
x_next4 = x4;
multistate_thread0_PROC_STATE_next = multistate_thread0_PROC_STATE;
case (multistate_thread0_PROC_STATE)
0: begin
x_next4++;
x_next4++;
t5_next = x_next4;
multistate_thread0_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:132:13;
end
1: begin
x_next4++;
t5_next = x_next4;
multistate_thread0_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:132:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread0_ff
if ( ~rstn ) begin
x4 <= 0;
multistate_thread0_PROC_STATE <= 0; // test_single_state_thread.cpp:128:9;
end
else begin
x4 <= x_next4;
t5 <= t5_next;
multistate_thread0_PROC_STATE <= multistate_thread0_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread1 (test_single_state_thread.cpp:137:5)
// Thread-local variables
logic signed [31:0] x5;
logic signed [31:0] x_next5;
logic signed [31:0] t6_next;
logic multistate_thread1_PROC_STATE;
logic multistate_thread1_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread1_comb // test_single_state_thread.cpp:137:5
multistate_thread1_func;
end
function void multistate_thread1_func;
t6_next = t6;
x_next5 = x5;
multistate_thread1_PROC_STATE_next = multistate_thread1_PROC_STATE;
case (multistate_thread1_PROC_STATE)
0: begin
multistate_thread1_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:141:13;
end
1: begin
x_next5++;
t6_next = x_next5;
multistate_thread1_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:141:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread1_ff
if ( ~rstn ) begin
x5 <= 0;
multistate_thread1_PROC_STATE <= 0; // test_single_state_thread.cpp:139:9;
end
else begin
x5 <= x_next5;
t6 <= t6_next;
multistate_thread1_PROC_STATE <= multistate_thread1_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread2 (test_single_state_thread.cpp:152:5)
// Thread-local variables
logic signed [31:0] x6;
logic signed [31:0] x_next6;
logic signed [31:0] t7_next;
logic multistate_thread2_PROC_STATE;
logic multistate_thread2_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread2_comb // test_single_state_thread.cpp:152:5
multistate_thread2_func;
end
function void multistate_thread2_func;
t7_next = t7;
x_next6 = x6;
multistate_thread2_PROC_STATE_next = multistate_thread2_PROC_STATE;
case (multistate_thread2_PROC_STATE)
0: begin
// Call wait_method() begin
multistate_thread2_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:148:9;
// Call wait_method() end
end
1: begin
x_next6++;
t7_next = x_next6;
multistate_thread2_PROC_STATE_next = 0; return; // test_single_state_thread.cpp:155:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread2_ff
if ( ~rstn ) begin
x6 <= 0;
multistate_thread2_PROC_STATE <= 0; // test_single_state_thread.cpp:155:13;
end
else begin
x6 <= x_next6;
t7 <= t7_next;
multistate_thread2_PROC_STATE <= multistate_thread2_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread3 (test_single_state_thread.cpp:163:5)
// Thread-local variables
logic signed [31:0] x7;
logic signed [31:0] x_next7;
logic signed [31:0] t7a_next;
logic multistate_thread3_PROC_STATE;
logic multistate_thread3_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread3_comb // test_single_state_thread.cpp:163:5
multistate_thread3_func;
end
function void multistate_thread3_func;
t7a_next = t7a;
x_next7 = x7;
multistate_thread3_PROC_STATE_next = multistate_thread3_PROC_STATE;
case (multistate_thread3_PROC_STATE)
0: begin
// Call wait_wrapper() begin
multistate_thread3_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:32:5;
// Call wait_wrapper() end
end
1: begin
t7a_next = x_next7++;
multistate_thread3_PROC_STATE_next = 0; return; // test_single_state_thread.cpp:166:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread3_ff
if ( ~rstn ) begin
x7 <= 0;
multistate_thread3_PROC_STATE <= 0; // test_single_state_thread.cpp:166:13;
end
else begin
x7 <= x_next7;
t7a <= t7a_next;
multistate_thread3_PROC_STATE <= multistate_thread3_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread4 (test_single_state_thread.cpp:173:5)
// Thread-local variables
logic signed [31:0] x8;
logic signed [31:0] x_next8;
logic signed [31:0] t8_next;
logic signed [31:0] wptr_y;
logic signed [31:0] wptr_y_next;
logic multistate_thread4_PROC_STATE;
logic multistate_thread4_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread4_comb // test_single_state_thread.cpp:173:5
multistate_thread4_func;
end
function void multistate_thread4_func;
t8_next = t8;
wptr_y_next = wptr_y;
x_next8 = x8;
multistate_thread4_PROC_STATE_next = multistate_thread4_PROC_STATE;
case (multistate_thread4_PROC_STATE)
0: begin
// Call vwait() begin
wptr_y_next = wptr_y_next + 2;
multistate_thread4_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:26:9;
// Call vwait() end
end
1: begin
x_next8++;
t8_next = x_next8;
multistate_thread4_PROC_STATE_next = 0; return; // test_single_state_thread.cpp:176:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread4_ff
if ( ~rstn ) begin
x8 <= 0;
multistate_thread4_PROC_STATE <= 0; // test_single_state_thread.cpp:176:13;
end
else begin
x8 <= x_next8;
t8 <= t8_next;
wptr_y <= wptr_y_next;
multistate_thread4_PROC_STATE <= multistate_thread4_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: multistate_thread5 (test_single_state_thread.cpp:189:5)
// Thread-local variables
logic signed [31:0] x9;
logic signed [31:0] x_next9;
logic signed [31:0] t9_next;
logic signed [31:0] wd_y;
logic signed [31:0] wd_y_next;
logic multistate_thread5_PROC_STATE;
logic multistate_thread5_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : multistate_thread5_comb // test_single_state_thread.cpp:189:5
multistate_thread5_func;
end
function void multistate_thread5_func;
t9_next = t9;
wd_y_next = wd_y;
x_next9 = x9;
multistate_thread5_PROC_STATE_next = multistate_thread5_PROC_STATE;
case (multistate_thread5_PROC_STATE)
0: begin
// Call wbase_invoker() begin
// Call vwait() begin
wd_y_next = wd_y_next + 2;
multistate_thread5_PROC_STATE_next = 1; return; // test_single_state_thread.cpp:26:9;
// Call vwait() end
// Call wbase_invoker() end
end
1: begin
t9_next = x_next9++;
multistate_thread5_PROC_STATE_next = 0; return; // test_single_state_thread.cpp:192:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : multistate_thread5_ff
if ( ~rstn ) begin
x9 <= 0;
multistate_thread5_PROC_STATE <= 0; // test_single_state_thread.cpp:192:13;
end
else begin
x9 <= x_next9;
t9 <= t9_next;
wd_y <= wd_y_next;
multistate_thread5_PROC_STATE <= multistate_thread5_PROC_STATE_next;
end
end
endmodule