-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmethod_var_multiple_use2.sv
117 lines (95 loc) · 2.66 KB
/
method_var_multiple_use2.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.6
// 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;
//------------------------------------------------------------------------------
// Child module instances
Child child
(
.clk(clk),
.rst(rst),
.in(t),
.out(t)
);
endmodule
//==============================================================================
//
// Module: Child (test_var_multiple_use2.cpp:62:5)
//
module Child // "top.child"
(
input logic clk,
input logic rst,
input logic signed [31:0] in,
output logic signed [31:0] out
);
// Variables generated for SystemC signals
logic signed [31:0] s;
logic signed [31:0] out1;
logic signed [31:0] s1;
// Local parameters generated for C++ constants
localparam logic [2:0] vv = 0;
//------------------------------------------------------------------------------
// Method process: methA (test_var_multiple_use2.cpp:38:5)
// Process-local variables
logic [2:0] v;
always_comb
begin : methA // test_var_multiple_use2.cpp:38:5
v = in;
s1 = 2 - v;
out1 = 1 + in;
end
//------------------------------------------------------------------------------
// Clocked THREAD: thrA (test_var_multiple_use2.cpp:44:5)
// Thread-local variables
logic signed [31:0] i;
logic signed [31:0] i_next;
logic signed [31:0] s_next;
logic [1:0] thrA_PROC_STATE;
logic [1:0] thrA_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : thrA_comb // test_var_multiple_use2.cpp:44:5
thrA_func;
end
function void thrA_func;
i_next = i;
s_next = s;
thrA_PROC_STATE_next = thrA_PROC_STATE;
case (thrA_PROC_STATE)
0: begin
i_next = vv;
thrA_PROC_STATE_next = 1; return; // test_var_multiple_use2.cpp:50:13;
end
1: begin
s_next = i_next + in;
thrA_PROC_STATE_next = 0; return; // test_var_multiple_use2.cpp:52:13;
end
endcase
endfunction
// Synchronous register update
always_ff @(posedge clk or posedge rst)
begin : thrA_ff
if ( rst ) begin
out <= 0;
thrA_PROC_STATE <= 0; // test_var_multiple_use2.cpp:46:9;
end
else begin
i <= i_next;
s <= s_next;
thrA_PROC_STATE <= thrA_PROC_STATE_next;
end
end
endmodule