-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmethod_var_multiple_use3.sv
116 lines (94 loc) · 2.59 KB
/
method_var_multiple_use3.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
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.5.12
// 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_use3.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;
// Local parameters generated for C++ constants
localparam logic signed [31:0] c = 42;
//------------------------------------------------------------------------------
// Method process: methA (test_var_multiple_use3.cpp:36:5)
// Process-local variables
logic [2:0] v;
always_comb
begin : methA // test_var_multiple_use3.cpp:36:5
v = in;
s = 2 - v;
if (|in)
begin
s = v + 1;
end
s = in;
end
//------------------------------------------------------------------------------
// Clocked THREAD: thrA (test_var_multiple_use3.cpp:45:5)
// Thread-local variables
logic signed [31:0] out_next;
logic thrA_PROC_STATE;
logic thrA_PROC_STATE_next;
// Next-state combinational logic
always_comb begin : thrA_comb // test_var_multiple_use3.cpp:45:5
thrA_func;
end
function void thrA_func;
out_next = out;
thrA_PROC_STATE_next = thrA_PROC_STATE;
case (thrA_PROC_STATE)
0: begin
out_next = in;
thrA_PROC_STATE_next = 1; return; // test_var_multiple_use3.cpp:51:13;
end
1: begin
out_next = c;
out_next = in;
thrA_PROC_STATE_next = 1; return; // test_var_multiple_use3.cpp:51: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_use3.cpp:47:9;
end
else begin
out <= out_next;
thrA_PROC_STATE <= thrA_PROC_STATE_next;
end
end
endmodule