-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathmisc_fcall_loop.sv
293 lines (266 loc) · 7.21 KB
/
misc_fcall_loop.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.6.17
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: Top ()
//
module Top // "top"
(
input logic clk,
input logic rst
);
// Variables generated for SystemC signals
logic [47:0] st_slt_dims[2];
logic signed [31:0] t0;
// Local parameters generated for C++ constants
localparam logic [31:0] TileDimWidth = 12;
localparam logic [31:0] TileDimsNum = 4;
localparam logic [31:0] EdmaStoreSlots = 2;
//------------------------------------------------------------------------------
// Method process: methProc1 (test_fcall_loop.cpp:51:5)
always_comb
begin : methProc1 // test_fcall_loop.cpp:51:5
integer i_1;
integer l;
for (integer i = 0; i < 2; ++i)
begin
i_1 = i;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
i_1 = 0;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
//------------------------------------------------------------------------------
// Method process: methProc2 (test_fcall_loop.cpp:59:5)
always_comb
begin : methProc2 // test_fcall_loop.cpp:59:5
integer i;
integer l;
i = 0;
// Call f() begin
l = i;
t0 = l;
// Call f() end
for (integer i_1 = 0; i_1 < 2; ++i_1)
begin
i = i_1;
// Call f() begin
l = i;
t0 = l;
// Call f() end
end
end
//------------------------------------------------------------------------------
// Method process: methProc3 (test_fcall_loop.cpp:67:5)
always_comb
begin : methProc3 // test_fcall_loop.cpp:67:5
integer i_1;
integer l;
for (integer i = 0; i < 2; ++i)
begin
i_1 = i;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
for (integer i_2 = 0; i_2 < 2; ++i_2)
begin
i_1 = i_2 + 1;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
end
//------------------------------------------------------------------------------
// Method process: methProc4 (test_fcall_loop.cpp:77:5)
always_comb
begin : methProc4 // test_fcall_loop.cpp:77:5
integer i;
integer l;
i = 0;
// Call f() begin
l = i;
t0 = l;
// Call f() end
for (integer i_1 = 0; i_1 < 2; ++i_1)
begin
i = i_1;
// Call f() begin
l = i;
t0 = l;
// Call f() end
end
for (integer i_2 = 0; i_2 < 2; ++i_2)
begin
i = i_2 + 1;
// Call f() begin
l = i;
t0 = l;
// Call f() end
end
end
//------------------------------------------------------------------------------
// Method process: methProc5 (test_fcall_loop.cpp:88:5)
always_comb
begin : methProc5 // test_fcall_loop.cpp:88:5
integer i_1;
integer l;
for (integer i = 0; i < 2; ++i)
begin
i_1 = i;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
i_1 = 0;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
for (integer i_2 = 0; i_2 < 2; ++i_2)
begin
i_1 = i_2 + 1;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
end
//------------------------------------------------------------------------------
// Method process: methProc6 (test_fcall_loop.cpp:99:5)
always_comb
begin : methProc6 // test_fcall_loop.cpp:99:5
integer i_1;
integer l;
for (integer i = 0; i < 2; ++i)
begin
i_1 = i;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
for (integer i_2 = 0; i_2 < 3; ++i_2)
begin
i_1 = i_2 + 1;
// Call f() begin
l = i_1;
t0 = l;
// Call f() end
end
end
end
//------------------------------------------------------------------------------
// Method process: methProc7 (test_fcall_loop.cpp:109:5)
always_comb
begin : methProc7 // test_fcall_loop.cpp:109:5
integer i_2;
integer l;
for (integer i = 0; i < 2; ++i)
begin
for (integer i_1 = 0; i_1 < 3; ++i_1)
begin
i_2 = i_1 + 1;
// Call f() begin
l = i_2;
t0 = l;
// Call f() end
end
i_2 = i;
// Call f() begin
l = i_2;
t0 = l;
// Call f() end
end
end
//------------------------------------------------------------------------------
// Method process: methProc8 (test_fcall_loop.cpp:120:5)
always_comb
begin : methProc8 // test_fcall_loop.cpp:120:5
end
//------------------------------------------------------------------------------
// Clocked THREAD: threadProc (test_fcall_loop.cpp:146:5)
// Thread-local variables
logic [31:0] slot;
logic [31:0] slot_next;
logic xtc;
logic xtc_next;
logic [47:0] xes;
logic [47:0] xes_next;
logic [1:0] threadProc_PROC_STATE;
logic [1:0] threadProc_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : threadProc_comb // test_fcall_loop.cpp:146:5
threadProc_func;
end
function void threadProc_func;
logic TMP_0;
logic [47:0] dims;
logic [11:0] xes_nxt[4];
slot_next = slot;
xes_next = xes;
xtc_next = xtc;
threadProc_PROC_STATE_next = threadProc_PROC_STATE;
case (threadProc_PROC_STATE)
0: begin
xes_next = 0;
xtc_next = 0;
dims = st_slt_dims[slot_next];
// Call incElIdx() begin
xes_nxt[0] = 0; xes_nxt[1] = 0; xes_nxt[2] = 0; xes_nxt[3] = 0;
for (integer unsigned i = 0; i < TileDimsNum; ++i)
begin
xes_nxt[i] = 0;
end
TMP_0 = |xes_nxt[0];
// Call incElIdx() end
xtc_next = TMP_0;
threadProc_PROC_STATE_next = 1; return; // test_fcall_loop.cpp:160:17;
end
1: begin
if (1)
begin
dims = st_slt_dims[slot_next];
// Call incElIdx() begin
xes_nxt[0] = 0; xes_nxt[1] = 0; xes_nxt[2] = 0; xes_nxt[3] = 0;
for (integer unsigned i = 0; i < TileDimsNum; ++i)
begin
xes_nxt[i] = 0;
end
TMP_0 = |xes_nxt[0];
// Call incElIdx() end
xtc_next = TMP_0;
threadProc_PROC_STATE_next = 1; return; // test_fcall_loop.cpp:160:17;
end
slot_next = (slot_next == EdmaStoreSlots - 1) ? 0 : slot_next + 1;
threadProc_PROC_STATE_next = 0; return; // test_fcall_loop.cpp:164:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rst)
begin : threadProc_ff
if ( ~rst ) begin
slot <= 0;
threadProc_PROC_STATE <= 0; // test_fcall_loop.cpp:149:9;
end
else begin
slot <= slot_next;
xtc <= xtc_next;
xes <= xes_next;
threadProc_PROC_STATE <= threadProc_PROC_STATE_next;
end
end
endmodule