-
Notifications
You must be signed in to change notification settings - Fork 18
/
fifo_write.v
184 lines (150 loc) · 4.22 KB
/
fifo_write.v
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
module fifo_write_inner(input [0:0] clk, input [0:0] rst, output [31:0] arg_1_in_data, output [0:0] arg_1_read_valid, output [0:0] arg_1_rst, output [0:0] arg_1_write_valid, input [31:0] arg_1_out_data, input [0:0] arg_1_read_ready, input [0:0] arg_1_write_ready, output [0:0] valid, input [31:0] arg_0_out_data);
reg [31:0] arg_1_in_data_reg;
reg [0:0] arg_1_read_valid_reg;
reg [0:0] arg_1_rst_reg;
reg [0:0] arg_1_write_valid_reg;
reg [0:0] valid_reg;
assign arg_1_in_data = arg_1_in_data_reg;
assign arg_1_read_valid = arg_1_read_valid_reg;
assign arg_1_rst = arg_1_rst_reg;
assign arg_1_write_valid = arg_1_write_valid_reg;
assign valid = valid_reg;
// Start debug wires and ports
initial begin
end
// End debug wires and ports
// Start Functional Units
add call_1();
// End Functional Units
// Start instruction result storage
// End instruction result storage
// Start pipeline variables
// End pipeline variables
reg [31:0] global_state;
reg [31:0] last_BB_reg;
// Start pipeline reset block
always @(posedge clk) begin
if (rst) begin
end
end
// End pipeline reset block
// Start pipeline valid chain block
always @(posedge clk) begin
if (!rst) begin
end
end
// End pipeline valid chain block
always @(posedge clk) begin
end
// Start pipeline initiation block
always @(posedge clk) begin
end
// End pipeline initiation block
always @(posedge clk) begin
if (rst) begin
last_BB_reg <= 0;
end else begin
if ((global_state == 0)) begin
end
if ((global_state == 1)) begin
end
if ((global_state == 2)) begin
last_BB_reg <= 0;
end
end
end
always @(posedge clk) begin
if (rst) begin
global_state <= 0;
end else begin
// Control code
if ((global_state == 0)) begin
// Next state transition logic
// Condition = True
if (1) begin
if (arg_1_write_ready) begin
global_state <= 1;
end
end
end
if ((global_state == 1)) begin
// Next state transition logic
// Condition = True
if (1) begin
global_state <= 2;
end
end
if ((global_state == 2)) begin
// Next state transition logic
// Condition = True
if (1) begin
global_state <= 2;
end
end
// Temporary storage code
if ((global_state == 0)) begin
// Temporary storage
if (arg_1_write_ready) begin
// Store data computed at the stage
end
end
if ((global_state == 1)) begin
// Temporary storage
// Store data computed at the stage
end
if ((global_state == 2)) begin
// Temporary storage
// Store data computed at the stage
end
end
end
// Start pipeline instruction code
// Start pipeline stages
// End pipeline instruction code
// controller for arg_1.arg_1_in_data_reg
// controller for arg_1.arg_1_write_valid_reg
always @(*) begin
if ((global_state == 1)) begin
if (1) begin
arg_1_write_valid_reg = -(1'd1);
end else begin
arg_1_write_valid_reg = 0;
end
end else if ((global_state == 2)) begin
if (1) begin
arg_1_write_valid_reg = (1'd0);
end else begin
arg_1_write_valid_reg = 0;
end
end else begin
arg_1_write_valid_reg = 0;
end
end
// Insensitive connections
always @(*) begin
arg_1_in_data_reg = valid ? arg_0_out_data : arg_0_out_data;
end
// Insensitive connections
always @(*) begin
end
// controller for ret_5.valid_reg
always @(*) begin
if ((global_state == 2)) begin
if (1) begin
valid_reg = 1;
end else begin
valid_reg = 0;
end
end else begin
valid_reg = 0;
end
end
// Insensitive connections
always @(*) begin
end
endmodule
module fifo_write(input [0:0] clk, input [0:0] rst, output [31:0] arg_1_in_data, output [0:0] arg_1_read_valid, output [0:0] arg_1_rst, output [0:0] arg_1_write_valid, input [31:0] arg_1_out_data, input [0:0] arg_1_read_ready, input [0:0] arg_1_write_ready, output [0:0] valid, input [31:0] arg_0_out_data);
initial begin
end
fifo_write_inner inner(.arg_0_out_data(arg_0_out_data), .arg_1_in_data(arg_1_in_data), .arg_1_out_data(arg_1_out_data), .arg_1_read_ready(arg_1_read_ready), .arg_1_read_valid(arg_1_read_valid), .arg_1_rst(arg_1_rst), .arg_1_write_ready(arg_1_write_ready), .arg_1_write_valid(arg_1_write_valid), .clk(clk), .rst(rst), .valid(valid));
endmodule