-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathmisc_array_in_top.sv
77 lines (65 loc) · 1.88 KB
/
misc_array_in_top.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.6.14
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: Top ()
//
module Top // "top"
(
input logic clk,
input logic rst,
input logic in[3][2],
input logic Top_inst,
output logic [1:0] out_1,
output logic [1:0] out_10,
output logic [3:0] out[3]
);
// Variables generated for SystemC signals
logic [3:0] sig[3];
logic [3:0] sig1[3];
// Local parameters generated for C++ constants
localparam logic [31:0] N = 3;
//------------------------------------------------------------------------------
// Clocked THREAD: threadProc (test_array_in_top.cpp:40:5)
// Thread-local variables
logic [3:0] sig_next[3];
logic [3:0] out_next[3];
// Next-state combinational logic
always_comb begin : threadProc_comb // test_array_in_top.cpp:40:5
threadProc_func;
end
function void threadProc_func;
out_next = out;
sig_next = sig;
for (integer i_1 = 1; i_1 < N; ++i_1)
begin
out_next[i_1] = in[i_1][0] ? sig[i_1] : 4'd0;
end
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rst)
begin : threadProc_ff
if ( ~rst ) begin
sig[0] <= 1;
sig[2] <= 2;
for (integer i = 1; i < N; ++i)
begin
out[i] <= 0;
end
end
else begin
sig <= sig_next;
out <= out_next;
end
end
//------------------------------------------------------------------------------
// Method process: methProc (test_array_in_top.cpp:36:5)
always_comb
begin : methProc // test_array_in_top.cpp:36:5
sig1[0] = sig[1] + sig[2];
end
endmodule