-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathmisc_signal_reset.sv
117 lines (94 loc) · 2.46 KB
/
misc_signal_reset.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.6.14
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================
//==============================================================================
//
// Module: A ()
//
module A // "a_mod"
(
input logic clk
);
// Variables generated for SystemC signals
logic rstn;
//------------------------------------------------------------------------------
// Clocked THREAD: resetProc (test_signal_reset.cpp:57:5)
// Thread-local variables
logic [15:0] cntr;
logic [15:0] cntr_next;
logic rstn_next;
// Next-state combinational logic
always_comb begin : resetProc_comb // test_signal_reset.cpp:57:5
resetProc_func;
end
function void resetProc_func;
cntr_next = cntr;
rstn_next = rstn;
cntr_next++;
rstn_next = cntr_next != 10;
endfunction
// Synchronous register update
always_ff @(posedge clk)
begin : resetProc_ff
begin
cntr <= cntr_next;
rstn <= rstn_next;
end
end
//------------------------------------------------------------------------------
// Child module instances
B b_mod
(
.clk(clk),
.rstn(rstn)
);
endmodule
//==============================================================================
//
// Module: B (test_signal_reset.cpp:47:5)
//
module B // "a_mod.b_mod"
(
input logic clk,
input logic rstn
);
// Variables generated for SystemC signals
logic signed [31:0] s;
logic signed [31:0] t;
//------------------------------------------------------------------------------
// Method process: methodProc (test_signal_reset.cpp:24:5)
always_comb
begin : methodProc // test_signal_reset.cpp:24:5
if (rstn)
begin
s = 0;
end else begin
s = 1;
end
end
//------------------------------------------------------------------------------
// Clocked THREAD: threadProc (test_signal_reset.cpp:33:5)
// Thread-local variables
logic signed [31:0] t_next;
// Next-state combinational logic
always_comb begin : threadProc_comb // test_signal_reset.cpp:33:5
threadProc_func;
end
function void threadProc_func;
t_next = t;
t_next = 1;
endfunction
// Synchronous register update
always_ff @(posedge clk or negedge rstn)
begin : threadProc_ff
if ( ~rstn ) begin
t <= 0;
end
else begin
t <= t_next;
end
end
endmodule