-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmisc_sc_port.sv
124 lines (108 loc) · 2.81 KB
/
misc_sc_port.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
//==============================================================================
//
// 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] s;
logic [3:0] tar_s2;
logic slave_clk;
logic slave_nrst;
// Assignments generated for C++ channel arrays
assign slave_clk = clk;
assign slave_nrst = nrst;
//------------------------------------------------------------------------------
// Clocked THREAD: slave_threadProc (test_sc_port.cpp:30:5)
// Thread-local variables
logic [3:0] tar_s2_next;
logic [3:0] s_next;
logic [3:0] a;
logic [3:0] a_next;
// Next-state combinational logic
always_comb begin : slave_threadProc_comb // test_sc_port.cpp:30:5
slave_threadProc_func;
end
function void slave_threadProc_func;
logic [3:0] TMP_0;
logic [3:0] val;
logic [3:0] TMP_1;
a_next = a;
s_next = s;
tar_s2_next = tar_s2;
val = a_next;
// Call f() begin
tar_s2_next = val;
s_next = val;
TMP_1 = val + 1;
// Call f() end
a_next = TMP_1;
endfunction
// Synchronous register update
always_ff @(posedge slave_clk or negedge slave_nrst)
begin : slave_threadProc_ff
if ( ~slave_nrst ) begin
logic [3:0] TMP_0;
logic [3:0] val;
a <= 0;
val = 0;
// Call f() begin
tar_s2 <= val;
s <= val;
TMP_0 = val + 1;
// Call f() end
end
else begin
tar_s2 <= tar_s2_next;
s <= s_next;
a <= a_next;
end
end
//------------------------------------------------------------------------------
// Method process: methProc (test_sc_port.cpp:99:5)
always_comb
begin : methProc // test_sc_port.cpp:99:5
logic [3:0] TMP_0;
// Call getSig() begin
TMP_0 = tar_s2;
// Call getSig() end
end
//------------------------------------------------------------------------------
// Clocked THREAD: threadProc (test_sc_port.cpp:103:5)
// Thread-local variables
logic [3:0] a0;
logic [3:0] a_next0;
// Next-state combinational logic
always_comb begin : threadProc_comb // test_sc_port.cpp:103:5
threadProc_func;
end
function void threadProc_func;
logic [3:0] TMP_0;
logic [3:0] val;
a_next0 = a0;
val = a_next0;
// Call g() begin
TMP_0 = val + tar_s2;
// Call g() end
a_next0 = TMP_0;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge nrst)
begin : threadProc_ff
if ( ~nrst ) begin
a0 <= 0;
end
else begin
a0 <= a_next0;
end
end
endmodule