-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmisc_sc_port_array2.sv
120 lines (106 loc) · 2.96 KB
/
misc_sc_port_array2.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.6.6
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: Dut ()
//
module Dut // "dut"
(
input logic clk
);
// Variables generated for SystemC signals
logic nrst;
logic [3:0] slave_s;
logic [3:0] tars_r[2];
logic signed [31:0] tars_t0[2];
logic signed [31:0] tars_t1[2];
logic slave_clk;
logic slave_nrst;
// Assignments generated for C++ channel arrays
assign slave_clk = clk;
assign slave_nrst = nrst;
//------------------------------------------------------------------------------
// Clocked THREAD: slave_thrdProc1 (test_sc_port_array2.cpp:72:5)
// Thread-local variables
logic signed [31:0] tars_t0_next[2];
logic [3:0] l[2];
logic [3:0] l_next[2];
logic [3:0] tars_a[2][2];
logic [3:0] tars_a_next[2][2];
logic signed [31:0] tars_t1_next[2];
logic [3:0] tars_v[2];
// Next-state combinational logic
always_comb begin : slave_thrdProc1_comb // test_sc_port_array2.cpp:72:5
slave_thrdProc1_func;
end
function void slave_thrdProc1_func;
logic [3:0] val;
logic [3:0] l_1;
logic [3:0] val_1;
integer i;
l_next = l;
tars_a_next = tars_a;
tars_t0_next = tars_t0;
tars_t1_next = tars_t1;
val_1 = slave_s;
// Call fa() begin
l_next[0] = 0; l_next[1] = 0;
l_next[0] = val_1;
l_next[1] = tars_r[1];
i = tars_r[1];
tars_a_next[1][i] = l_next[i];
tars_t1_next[1] = tars_a_next[1][i];
// Call fa() end
endfunction
// Synchronous register update
always_ff @(posedge slave_clk or negedge slave_nrst)
begin : slave_thrdProc1_ff
if ( ~slave_nrst ) begin
logic [3:0] val;
logic [3:0] l_1;
logic [3:0] tars_v;
val = 1;
// Call f() begin
l_1 = val;
tars_v[1] = l_1 + 1;
val = tars_r[1];
tars_t0[1] <= tars_v[1];
// Call f() end
end
else begin
tars_t0 <= tars_t0_next;
l <= l_next;
tars_a <= tars_a_next;
tars_t1 <= tars_t1_next;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: slave_thrdProc2 (test_sc_port_array2.cpp:82:5)
// Thread-local variables
logic [3:0] tars_r_next[2];
// Next-state combinational logic
always_comb begin : slave_thrdProc2_comb // test_sc_port_array2.cpp:82:5
slave_thrdProc2_func;
end
function void slave_thrdProc2_func;
logic [3:0] val;
tars_r_next = tars_r;
val = slave_s;
// Call g() begin
tars_r_next[1] = val;
// Call g() end
endfunction
// Synchronous register update
always_ff @(posedge slave_clk or negedge slave_nrst)
begin : slave_thrdProc2_ff
if ( ~slave_nrst ) begin
end
else begin
tars_r <= tars_r_next;
end
end
endmodule