-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmethod_var_ref.sv
318 lines (274 loc) · 7.44 KB
/
method_var_ref.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.5.15
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: B_top ()
//
module B_top // "b_mod"
(
input logic clk
);
//------------------------------------------------------------------------------
// Child module instances
A a_mod
(
.clk(clk)
);
endmodule
//==============================================================================
//
// Module: A (test_var_ref.cpp:327:5)
//
module A // "b_mod.a_mod"
(
input logic clk
);
// Variables generated for SystemC signals
logic nrst;
logic [3:0] s;
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 [3:0] sig;
logic [7:0] sig2;
logic [3:0] sig3;
logic signed [31:0] t6;
logic [3:0] sig_arr[3];
logic [7:0] sig_arr2[3];
logic signed [31:0] t7;
logic signed [31:0] t8;
logic signed [31:0] t9;
logic [31:0] indx;
// Local parameters generated for C++ constants
localparam logic signed [31:0] kk = 2;
//------------------------------------------------------------------------------
// Method process: reference0 (test_var_ref.cpp:65:5)
always_comb
begin : reference0 // test_var_ref.cpp:65:5
logic signed [11:0] y;
integer z;
integer cz;
integer w;
integer cw;
y = 0;
y = -7'sd42;
t0 = 32'(y);
z = 42;
cz = z + 1;
t0 = cz;
w = 43;
cw = w + 1;
t0 = cw;
end
//------------------------------------------------------------------------------
// Method process: reference1 (test_var_ref.cpp:104:5)
// Process-local variables
logic signed [31:0] n;
always_comb
begin : reference1 // test_var_ref.cpp:104:5
integer a;
integer unsigned m_1[3];
logic bb[5];
integer i_1;
integer j;
a = 1;
m_1[1] = 1;
for (integer i = 0; i < 5; i++)
begin
bb[i] = |i;
t1 = bb[i];
end
n = 1;
i_1 = kk;
i_1 = n + kk;
j = a;
j = a + m_1[1] * a + i_1;
t1 = j;
end
//------------------------------------------------------------------------------
// Method process: reference2 (test_var_ref.cpp:134:5)
// Process-local variables
logic [6:0] f;
always_comb
begin : reference2 // test_var_ref.cpp:134:5
logic [3:0] a;
logic [2:0] m1[4];
logic signed [64:0] m2[3];
logic signed [65:0] e;
a = 0;
a = 1;
m1[0] = 0; m1[1] = 0; m1[2] = 0; m1[3] = 0;
m1[0] = 1;
m2[0] = 0; m2[1] = 0; m2[2] = 0;
m2[2] = m1[0];
f = 1;
e = signed'({1'b0, m1[0]}) + signed'({1'b0, a}) * m2[2] - signed'({1'b0, f});
t2 = 32'(e);
end
//------------------------------------------------------------------------------
// Method process: reference3 (test_var_ref.cpp:155:5)
// Process-local variables
logic [3:0] gm[3][4];
always_comb
begin : reference3 // test_var_ref.cpp:155:5
integer unsigned lm[5];
integer i;
lm[s] = 1;
i = lm[s];
i = lm[i];
lm[i] = lm[i];
lm[i + 1] = i;
gm[s][1] = 0;
gm[gm[i][2]][0] = gm[i][2];
i = gm[s][1];
gm[i][i] = lm[i + 1];
end
//------------------------------------------------------------------------------
// Method process: const_reference (test_var_ref.cpp:180:5)
// Process-local variables
logic signed [31:0] k;
logic signed [31:0] m;
always_comb
begin : const_reference // test_var_ref.cpp:180:5
integer a;
integer unsigned d;
integer unsigned e;
integer unsigned arr[3];
a = 1;
a = a + 1;
k = a;
m = k + a * a;
d = 3;
m = d + k;
e = 3 + d;
m = e - d;
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;
m = arr[1] - 2 * d - e * e;
t3 = m;
end
//------------------------------------------------------------------------------
// Method process: const_reference2 (test_var_ref.cpp:209:5)
always_comb
begin : const_reference2 // test_var_ref.cpp:209:5
logic [3:0] a;
integer m_1;
logic [2:0] arr[5];
logic [2:0] f_1;
logic signed [9:0] g;
a = 0;
a = 1;
m_1 = a[3 : 1];
arr[0] = 0; arr[1] = 0; arr[2] = 0; arr[3] = 0; arr[4] = 0;
f_1 = 4;
g = arr[2] + arr[3] * arr[3] - f_1;
t4 = g + m_1;
end
//------------------------------------------------------------------------------
// Method process: const_reference3 (test_var_ref.cpp:228:5)
always_comb
begin : const_reference3 // test_var_ref.cpp:228:5
logic [2:0] arr[3];
integer m_1;
integer sum;
arr[0] = 0; arr[1] = 0; arr[2] = 0;
m_1 = s;
sum = arr[s] + arr[s + 1] + arr[m_1] + arr[m_1 - 1];
t5 = sum;
end
//------------------------------------------------------------------------------
// Method process: const_reference_sig (test_var_ref.cpp:245:5)
always_comb
begin : const_reference_sig // test_var_ref.cpp:245:5
logic [3:0] c;
logic [3:0] d;
logic [3:0] e;
integer sum;
c = sig + 1;
d = sig2;
e = sig3;
sum = sig + sig + c + d + e;
t6 = sum;
end
//------------------------------------------------------------------------------
// Method process: const_reference_sig_arr (test_var_ref.cpp:262:5)
always_comb
begin : const_reference_sig_arr // test_var_ref.cpp:262:5
logic [3:0] e;
integer sum;
e = sig_arr2[s];
sum = sig_arr[1] + sig_arr[1] + sig_arr[s] + sig_arr[s + 1] + e;
t7 = sum;
end
//------------------------------------------------------------------------------
// Method process: init_list (test_var_ref.cpp:281:5)
always_comb
begin : init_list // test_var_ref.cpp:281:5
integer m_1;
integer il4[2];
m_1 = 1;
il4[0] = 0; il4[1] = m_1;
t8 = il4[s];
end
//------------------------------------------------------------------------------
// Clocked THREAD: array_ref_wait (test_var_ref.cpp:310:5)
// Thread-local variables
logic [3:0] arr0[3];
logic [3:0] arr_next[3];
logic [3:0] sig_next;
logic [1:0] array_ref_wait_PROC_STATE;
logic [1:0] array_ref_wait_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : array_ref_wait_comb // test_var_ref.cpp:310:5
array_ref_wait_func;
end
function void array_ref_wait_func;
arr_next = arr0;
sig_next = sig;
array_ref_wait_PROC_STATE_next = array_ref_wait_PROC_STATE;
case (array_ref_wait_PROC_STATE)
0: begin
array_ref_wait_PROC_STATE_next = 1; return; // test_var_ref.cpp:316:13;
end
1: begin
sig_next = arr_next[indx];
array_ref_wait_PROC_STATE_next = 0; return; // test_var_ref.cpp:318:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge nrst)
begin : array_ref_wait_ff
if ( ~nrst ) begin
arr0[0] <= 0; arr0[1] <= 0; arr0[2] <= 0;
array_ref_wait_PROC_STATE <= 0; // test_var_ref.cpp:312:9;
end
else begin
arr0 <= arr_next;
sig <= sig_next;
array_ref_wait_PROC_STATE <= array_ref_wait_PROC_STATE_next;
end
end
//------------------------------------------------------------------------------
// Method process: reference_init_func (test_var_ref.cpp:294:5)
always_comb
begin : reference_init_func // test_var_ref.cpp:294:5
integer m_1;
integer r;
integer rr;
integer a;
m_1 = 1;
r = m_1++;
rr = --m_1;
a = r + rr + 2;
t9 = a;
end
endmodule