-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmif_array_with_ptr2.sv
171 lines (147 loc) · 4.42 KB
/
mif_array_with_ptr2.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.6.2
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: Top ()
//
module Top // "top"
(
input logic clk
);
// Variables generated for SystemC signals
logic rst;
logic signed [31:0] t;
logic signed [31:0] z;
logic signed [31:0] minst_p[2];
logic signed [31:0] minst_q[2];
logic minst_clk[2];
logic minst_rst[2];
logic signed [31:0] minst_in[2];
logic signed [31:0] minst_out[2];
// Assignments generated for C++ channel arrays
assign minst_clk[0] = clk;
assign minst_clk[1] = clk;
assign minst_rst[0] = rst;
assign minst_rst[1] = rst;
assign minst_in[0] = t;
assign minst_in[1] = z;
//------------------------------------------------------------------------------
// Method process: minst_ptrProc (test_mif_array_with_ptr2.cpp:41:5)
// Process-local variables
logic [3:0] minst_vp[2];
always_comb
begin : minst_ptrProc // test_mif_array_with_ptr2.cpp:41:5
minst_out[0] = minst_in[0];
minst_out[0] = minst_p[0];
minst_vp[0] = 3;
end
//------------------------------------------------------------------------------
// Clocked THREAD: minst_thrProc (test_mif_array_with_ptr2.cpp:47:5)
// Thread-local variables
logic signed [31:0] minst_p_next[2];
// Next-state combinational logic
always_comb begin : minst_thrProc_comb // test_mif_array_with_ptr2.cpp:47:5
minst_thrProc_func;
end
function void minst_thrProc_func;
minst_p_next[0] = minst_p[0];
minst_p_next[0] = minst_in[0];
endfunction
// Synchronous register update
always_ff @(posedge minst_clk[0] or posedge minst_rst[0])
begin : minst_thrProc_ff
if ( minst_rst[0] ) begin
minst_p[0] <= 2;
end
else begin
minst_p[0] <= minst_p_next[0];
end
end
//------------------------------------------------------------------------------
// Method process: minst_ptrProc0 (test_mif_array_with_ptr2.cpp:41:5)
always_comb
begin : minst_ptrProc0 // test_mif_array_with_ptr2.cpp:41:5
minst_out[1] = minst_in[1];
minst_out[1] = minst_p[1];
minst_vp[1] = 3;
end
//------------------------------------------------------------------------------
// Clocked THREAD: minst_thrProc0 (test_mif_array_with_ptr2.cpp:47:5)
// Next-state combinational logic
always_comb begin : minst_thrProc0_comb // test_mif_array_with_ptr2.cpp:47:5
minst_thrProc0_func;
end
function void minst_thrProc0_func;
minst_p_next[1] = minst_p[1];
minst_p_next[1] = minst_in[1];
endfunction
// Synchronous register update
always_ff @(posedge minst_clk[1] or posedge minst_rst[1])
begin : minst_thrProc0_ff
if ( minst_rst[1] ) begin
minst_p[1] <= 2;
end
else begin
minst_p[1] <= minst_p_next[1];
end
end
//------------------------------------------------------------------------------
// Method process: top_method (test_mif_array_with_ptr2.cpp:94:5)
always_comb
begin : top_method // test_mif_array_with_ptr2.cpp:94:5
integer j;
integer TMP_0;
j = 0;
for (integer i = 0; i < 2; i++)
begin
// Call getP() begin
TMP_0 = minst_p[i];
// Call getP() end
j = j + TMP_0;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: top_thread (test_mif_array_with_ptr2.cpp:102:5)
// Thread-local variables
logic signed [31:0] minst_q_next[2];
// Next-state combinational logic
always_comb begin : top_thread_comb // test_mif_array_with_ptr2.cpp:102:5
top_thread_func;
end
function void top_thread_func;
integer j;
integer TMP_0;
integer val;
minst_q_next = minst_q;
for (integer i_1 = 0; i_1 < 2; i_1++)
begin
val = i_1;
// Call setQ() begin
minst_q_next[i_1] = val;
// Call setQ() end
end
endfunction
// Synchronous register update
always_ff @(posedge clk or posedge rst)
begin : top_thread_ff
if ( rst ) begin
integer j;
integer TMP_0;
j = 0;
for (integer i = 0; i < 2; i++)
begin
// Call getP() begin
TMP_0 = minst_p[i];
// Call getP() end
j = j + TMP_0;
end
end
else begin
minst_q <= minst_q_next;
end
end
endmodule