-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmethod_return.sv
229 lines (208 loc) · 4.93 KB
/
method_return.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.5.12
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: test ()
//
module test // "t_inst"
(
);
// Variables generated for SystemC signals
logic [2:0] s;
logic t;
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;
//------------------------------------------------------------------------------
// Method process: return_method1 (test_return.cpp:52:5)
always_comb
begin : return_method1 // test_return.cpp:52:5
integer x;
x = 0;
t0 = 0;
if (|s)
begin
end else begin
x = 1;
t0 = x;
end
end
//------------------------------------------------------------------------------
// Method process: return_func1 (test_return.cpp:77:5)
always_comb
begin : return_func1 // test_return.cpp:77:5
logic [3:0] TMP_0;
logic [3:0] res;
logic [3:0] a;
logic TMP_2;
logic [3:0] TMP_3;
logic b;
// Call f1() begin
res = s;
TMP_0 = res;
// Call f1() end
a = TMP_0;
// Call f2() begin
// Call f1() begin
res = s;
TMP_3 = res;
// Call f1() end
TMP_2 = s == 1 || |TMP_3;
// Call f2() end
b = TMP_2;
t1 = a + b;
end
//------------------------------------------------------------------------------
// Method process: return_func2 (test_return.cpp:106:5)
always_comb
begin : return_func2 // test_return.cpp:106:5
logic signed [7:0] val1;
logic signed [7:0] val2;
logic signed [7:0] TMP_0;
logic signed [7:0] par1;
integer c;
val1 = 0;
val2 = 0;
par1 = val1;
// Call f3() begin
if (s == 1)
begin
TMP_0 = par1;
end else begin
if (s == 2)
begin
if (s == 3)
begin
if (s == 4)
begin
TMP_0 = 1;
end else begin
TMP_0 = 2;
end
end else begin
TMP_0 = val2;
end
end else begin
TMP_0 = val1;
end
end
// Call f3() end
c = TMP_0;
t2 = c;
end
//------------------------------------------------------------------------------
// Method process: return_func3 (test_return.cpp:132:5)
always_comb
begin : return_func3 // test_return.cpp:132:5
logic [7:0] val3;
logic [7:0] val4;
logic [7:0] TMP_0;
logic [7:0] par1;
integer unsigned d;
val3 = 0;
val4 = 0;
par1 = val3;
// Call f4() begin
if (s == 1)
begin
TMP_0 = par1;
end else begin
if (s == 2)
begin
TMP_0 = val4 + 1;
end else begin
if (s == 3)
begin
TMP_0 = val3;
end else begin
TMP_0 = val4;
end
end
end
// Call f4() end
d = TMP_0;
t3 = d;
end
//------------------------------------------------------------------------------
// Method process: return_func4 (test_return.cpp:153:5)
always_comb
begin : return_func4 // test_return.cpp:153:5
logic TMP_0;
logic i;
// Call f5() begin
if (|s)
begin
TMP_0 = t;
end else begin
if (t)
begin
TMP_0 = t;
end else begin
TMP_0 = s != 0 ? 1 : t;
end
end
// Call f5() end
i = TMP_0;
t4 = i;
end
//------------------------------------------------------------------------------
// Method process: return_empty (test_return.cpp:177:5)
always_comb
begin : return_empty // test_return.cpp:177:5
logic par;
par = t;
end
//------------------------------------------------------------------------------
// Method process: return_switch1 (test_return.cpp:195:5)
always_comb
begin : return_switch1 // test_return.cpp:195:5
integer unsigned TMP_0;
// Call sw1() begin
case (s)
1 : begin
TMP_0 = 2;
end
2 : begin
TMP_0 = 3;
end
default : begin
TMP_0 = 0;
end
endcase
// Call sw1() end
end
//------------------------------------------------------------------------------
// Method process: return_switch2 (test_return.cpp:210:5)
always_comb
begin : return_switch2 // test_return.cpp:210:5
logic [7:0] val1;
logic [7:0] val2;
integer unsigned TMP_0;
logic [7:0] par1;
val1 = s;
val2 = 0;
par1 = val1 + 1;
// Call sw2() begin
case (par1)
1 : begin
TMP_0 = par1;
end
2 : begin
TMP_0 = val2;
end
3 : begin // Empty case without break
TMP_0 = par1 + val2;
end
default : begin
TMP_0 = par1 + val2;
end
endcase
// Call sw2() end
end
endmodule