-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmethod_cond_side_effect.sv
171 lines (142 loc) · 3.71 KB
/
method_cond_side_effect.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.5.12
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: B_top ()
//
module B_top // "b_mod"
(
);
// Variables generated for SystemC signals
logic a;
logic b;
logic c;
//------------------------------------------------------------------------------
// Child module instances
A a_mod
(
.a(a),
.b(b),
.c(c)
);
endmodule
//==============================================================================
//
// Module: A (test_cond_side_effect.cpp:168:5)
//
module A // "b_mod.a_mod"
(
input logic a,
output logic b,
output logic c
);
// Variables generated for SystemC signals
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;
// Local parameters generated for C++ constants
localparam logic signed [31:0] k = 6;
//------------------------------------------------------------------------------
// Method process: if_side_effect1 (test_cond_side_effect.cpp:49:5)
always_comb
begin : if_side_effect1 // test_cond_side_effect.cpp:49:5
integer i;
i = 0;
if (a && 1)
begin
i = 1;
end
i = 2;
t0 = i;
end
//------------------------------------------------------------------------------
// Method process: if_side_effect2 (test_cond_side_effect.cpp:60:5)
// Process-local variables
logic signed [31:0] m;
always_comb
begin : if_side_effect2 // test_cond_side_effect.cpp:60:5
integer i;
i = 0;
if (a && |(m++))
begin
i = m;
end
i = 2;
t1 = i;
end
//------------------------------------------------------------------------------
// Method process: binary_side_effect (test_cond_side_effect.cpp:70:5)
always_comb
begin : binary_side_effect // test_cond_side_effect.cpp:70:5
integer i;
logic b_1;
i = 0;
b_1 = a || |(i++);
b_1 = a && |(i++);
b_1 = 1;
b_1 = 0 || |(i++);
b_1 = 1 && |(i++);
b_1 = 0;
t2 = b_1;
end
//------------------------------------------------------------------------------
// Method process: binary_side_effect2 (test_cond_side_effect.cpp:93:5)
always_comb
begin : binary_side_effect2 // test_cond_side_effect.cpp:93:5
integer i;
logic b_1;
i = 0;
b_1 = |(i++) || a;
b_1 = |(i++) && a;
b_1 = 1;
b_1 = 0;
b_1 = a || |(i++) && 0;
t3 = b_1;
end
//------------------------------------------------------------------------------
// Method process: cond_side_effect (test_cond_side_effect.cpp:114:5)
always_comb
begin : cond_side_effect // test_cond_side_effect.cpp:114:5
integer i;
logic res;
integer j;
i = 3;
res = b;
j = 1;
res = c;
t4 = res;
end
//------------------------------------------------------------------------------
// Method process: cond_fcall (test_cond_side_effect.cpp:135:5)
always_comb
begin : cond_fcall // test_cond_side_effect.cpp:135:5
integer res;
res = 2;
res = a ? 0 : 1;
res = 1;
res = 1 + 1;
res = 4; // Call of h()
t5 = res;
end
//------------------------------------------------------------------------------
// Method process: binary_unary_fcall (test_cond_side_effect.cpp:148:5)
always_comb
begin : binary_unary_fcall // test_cond_side_effect.cpp:148:5
integer res;
res = 2 + 3;
res = -2'sd1;
res = 2;
res = 32'd2;
res = a ? 2 : 3;
res = 4'd3;
t6 = res;
end
endmodule