@@ -23,37 +23,28 @@ module fpnew_aux_fsm #(
23
23
parameter int unsigned NumPipeRegs = 0 ,
24
24
parameter fpnew_pkg :: pipe_config_t PipeConfig = fpnew_pkg :: BEFORE ,
25
25
parameter type TagType = logic ,
26
- parameter type AuxType = logic ,
27
- parameter int unsigned NumLanes = 1
26
+ parameter type AuxType = logic
28
27
) (
29
28
input logic clk_i,
30
29
input logic rst_ni,
31
30
// Input signals
32
31
input TagType tag_i,
33
32
input AuxType aux_i,
34
- input logic is_vector_i,
35
- input logic [NumLanes- 1 : 0 ] lane_active_i,
36
33
// Input Handshake
37
34
input logic in_valid_i,
38
35
output logic in_ready_o,
39
36
input logic flush_i,
40
37
// Output signals
41
38
output TagType tag_o,
42
39
output AuxType aux_o,
43
- output logic is_vector_o,
44
- output logic [NumLanes- 1 : 0 ] lane_active_o,
45
40
// Output handshake
46
41
output logic out_valid_o,
47
42
input logic out_ready_i,
48
43
// Register Enable for Lanes
49
44
output logic [NumPipeRegs- 1 : 0 ] reg_enable_o,
50
- output logic [NumPipeRegs- 1 : 0 ] vector_reg_enable_o,
51
- output logic [NumLanes- 1 : 0 ][NumPipeRegs- 1 : 0 ] lane_reg_enable_o,
52
45
// Signals for the Lane FSMs
53
- // Signal to start the FSM, will be asserted for one cycle
54
- output logic [NumLanes- 1 : 0 ] lane_fsm_start_o,
55
- // Signal that the FSM finished it's operation, should be asserted continuously
56
- input logic [NumLanes- 1 : 0 ] lane_fsm_ready_i,
46
+ output logic fsm_start_o,
47
+ input logic fsm_ready_i,
57
48
// Indication of valid data in flight
58
49
output logic busy_o
59
50
);
@@ -79,8 +70,6 @@ module fpnew_aux_fsm #(
79
70
// Input pipeline signals, index i holds signal after i register stages
80
71
TagType [0 : NUM_INP_REGS ] in_tag;
81
72
AuxType [0 : NUM_INP_REGS ] in_aux;
82
- logic [0 : NUM_INP_REGS ] in_is_vector;
83
- logic [0 : NUM_INP_REGS ][NumLanes- 1 : 0 ] in_lane_active;
84
73
logic [0 : NUM_INP_REGS ] in_valid;
85
74
86
75
// Ready signal is combinatorial for all stages
@@ -89,16 +78,14 @@ module fpnew_aux_fsm #(
89
78
// First element of pipeline is taken from inputs
90
79
assign in_tag [0 ] = tag_i;
91
80
assign in_aux [0 ] = aux_i;
92
- assign in_is_vector [0 ] = is_vector_i;
93
81
assign in_valid [0 ] = in_valid_i;
94
- assign in_lane_active[0 ] = lane_active_i;
95
82
96
83
// Propagate pipeline ready signal to upstream circuitry
97
84
assign in_ready_o = in_ready[0 ];
98
85
99
86
// Generate the register stages
100
87
for (genvar i = 0 ; i < NUM_INP_REGS ; i++ ) begin : gen_input_pipeline
101
-
88
+
102
89
// Internal register enable for this stage
103
90
logic reg_ena;
104
91
// Determine the ready signal of the current stage - advance the pipeline:
@@ -110,22 +97,11 @@ module fpnew_aux_fsm #(
110
97
`FFLARNC (in_valid[i+ 1 ], in_valid[i], in_ready[i], flush_i, 1'b0 , clk_i, rst_ni)
111
98
112
99
// Enable register if pipleine ready and a valid data item is present
113
- assign reg_ena = in_ready[i] & in_valid[i];
114
-
115
- // Drive external registers with reg enable
116
- assign reg_enable_o[i] = reg_ena;
117
-
118
- // Drive external vector registers with reg enable if operation is a vector
119
- assign vector_reg_enable_o[i] = reg_ena & in_is_vector[i];
120
- for (genvar l = 0 ; l < NumLanes; l++ ) begin
121
- assign lane_reg_enable_o[l][i] = reg_ena & in_lane_active[i][l];
122
- end
100
+ assign reg_enable_o[i] = in_ready[i] & in_valid[i];
123
101
124
102
// Generate the pipeline registers within the stages, use enable-registers
125
- `FFL ( in_tag[i+ 1 ], in_tag[i], reg_ena, TagType ' ('0 ))
126
- `FFL ( in_aux[i+ 1 ], in_aux[i], reg_ena, AuxType ' ('0 ))
127
- `FFL ( in_is_vector[i+ 1 ], in_is_vector[i], reg_ena, '0 )
128
- `FFL (in_lane_active[i+ 1 ], in_lane_active[i], reg_ena, '0 )
103
+ `FFL ( in_tag[i+ 1 ], in_tag[i], reg_enable_o[i], TagType ' ('0 ))
104
+ `FFL ( in_aux[i+ 1 ], in_aux[i], reg_enable_o[i], AuxType ' ('0 ))
129
105
end
130
106
131
107
// ----------
@@ -140,28 +116,22 @@ module fpnew_aux_fsm #(
140
116
logic fsm_in_valid, fsm_in_ready;
141
117
logic fsm_out_valid, fsm_out_ready;
142
118
143
- // Synchronisazion signals
144
- logic fsm_start, fsm_ready, fsm_busy;
119
+ logic fsm_busy;
145
120
146
121
// Data holding signals
147
122
TagType held_tag;
148
123
AuxType held_aux;
149
- logic held_is_vector;
150
- logic [NumLanes- 1 : 0 ] held_lane_active;
151
124
152
125
// Upstream Handshake Connection
153
126
assign fsm_in_valid = in_valid[NUM_INP_REGS ];
154
127
assign in_ready[NUM_INP_REGS ] = fsm_in_ready;
155
128
156
- // Done when all active lanes are done
157
- assign fsm_ready = & lane_fsm_ready_i;
158
-
159
129
// FSM to safely apply and receive data from DIVSQRT unit
160
130
always_comb begin : flag_fsm
161
131
// Default assignments
162
132
fsm_out_valid = 1'b0 ;
163
133
fsm_in_ready = 1'b0 ;
164
- fsm_start = 1'b0 ;
134
+ fsm_start_o = 1'b0 ;
165
135
fsm_busy = 1'b0 ;
166
136
state_d = state_q;
167
137
@@ -170,19 +140,19 @@ module fpnew_aux_fsm #(
170
140
fsm_in_ready = '1 ;
171
141
if (fsm_in_valid) begin
172
142
state_d = BUSY ;
173
- fsm_start = 1'b1 ;
143
+ fsm_start_o = 1'b1 ;
174
144
end
175
145
end
176
146
BUSY : begin
177
147
fsm_busy = 1'b1 ;
178
148
// If all active lanes are done send data down chain
179
- if (fsm_ready ) begin
149
+ if (fsm_ready_i ) begin
180
150
fsm_out_valid = 1'b1 ;
181
151
if (fsm_out_ready) begin
182
152
fsm_in_ready = 1'b1 ;
183
153
if (fsm_in_valid) begin
184
154
state_d = BUSY ;
185
- fsm_start = 1'b1 ;
155
+ fsm_start_o = 1'b1 ;
186
156
end else begin
187
157
state_d = IDLE ;
188
158
end
@@ -198,7 +168,7 @@ module fpnew_aux_fsm #(
198
168
fsm_in_ready = 1'b1 ;
199
169
if (fsm_in_valid) begin
200
170
state_d = BUSY ;
201
- fsm_start = 1'b1 ;
171
+ fsm_start_o = 1'b1 ;
202
172
end else begin
203
173
state_d = IDLE ;
204
174
end
@@ -220,19 +190,12 @@ module fpnew_aux_fsm #(
220
190
221
191
`FF (state_q, state_d, IDLE );
222
192
223
- // Start Lanes when FSM starts and lane is active
224
- for (genvar l = 0 ; l < NumLanes; l++ ) begin
225
- assign lane_fsm_start_o[l] = fsm_start && in_lane_active[NUM_INP_REGS ][l];
226
- end
227
-
228
193
// ----------------
229
194
// Data Holding FFs
230
195
// ----------------
231
196
232
- `FFL ( held_tag, in_tag[NUM_INP_REGS ], fsm_start, TagType ' ('0 ));
233
- `FFL ( held_aux, in_aux[NUM_INP_REGS ], fsm_start, AuxType ' ('0 ));
234
- `FFL ( held_is_vector, in_is_vector[NUM_INP_REGS ], fsm_start, '0 );
235
- `FFL (held_lane_active, in_lane_active[NUM_INP_REGS ], fsm_start, '0 );
197
+ `FFL ( held_tag, in_tag[NUM_INP_REGS ], fsm_start_o, TagType ' ('0 ));
198
+ `FFL ( held_aux, in_aux[NUM_INP_REGS ], fsm_start_o, AuxType ' ('0 ));
236
199
237
200
// ---------------
238
201
// Output pipeline
@@ -241,8 +204,6 @@ module fpnew_aux_fsm #(
241
204
// Output pipeline signals, index i holds signal after i register stages
242
205
TagType [0 : NUM_OUT_REGS ] out_tag;
243
206
AuxType [0 : NUM_OUT_REGS ] out_aux;
244
- logic [0 : NUM_OUT_REGS ] out_is_vector;
245
- logic [0 : NUM_OUT_REGS ][NumLanes- 1 : 0 ] out_lane_active;
246
207
logic [0 : NUM_OUT_REGS ] out_valid;
247
208
248
209
// Ready signal is combinatorial for all stages
@@ -255,8 +216,6 @@ module fpnew_aux_fsm #(
255
216
// Connect to Hold Register
256
217
assign out_tag [0 ] = held_tag;
257
218
assign out_aux [0 ] = held_aux;
258
- assign out_is_vector [0 ] = held_is_vector;
259
- assign out_lane_active[0 ] = held_lane_active;
260
219
261
220
// Generate the register stages
262
221
for (genvar i = 0 ; i < NUM_OUT_REGS ; i++ ) begin : gen_output_pipeline
@@ -277,17 +236,9 @@ module fpnew_aux_fsm #(
277
236
// Drive external registers with reg enable
278
237
assign reg_enable_o[NUM_INP_REGS + i] = reg_ena;
279
238
280
- // Drive external vector registers with reg enable if operation is a vector
281
- assign vector_reg_enable_o[NUM_INP_REGS + i] = reg_ena & out_is_vector[i];
282
- for (genvar l = 0 ; l < NumLanes; l++ ) begin
283
- assign lane_reg_enable_o[l][NUM_INP_REGS + i] = reg_ena & out_lane_active[i][l];
284
- end
285
-
286
239
// Generate the pipeline registers within the stages, use enable-registers
287
240
`FFL ( out_tag[i+ 1 ], out_tag[i], reg_ena, TagType ' ('0 ))
288
241
`FFL ( out_aux[i+ 1 ], out_aux[i], reg_ena, AuxType ' ('0 ))
289
- `FFL ( out_is_vector[i+ 1 ], out_is_vector[i], reg_ena, '0 )
290
- `FFL (out_lane_active[i+ 1 ], out_lane_active[i], reg_ena, '0 )
291
242
end
292
243
293
244
// Ready travels backwards from output side, driven by downstream circuitry
@@ -296,9 +247,7 @@ module fpnew_aux_fsm #(
296
247
// Assign module outputs
297
248
assign tag_o = out_tag [NUM_OUT_REGS ];
298
249
assign aux_o = out_aux [NUM_OUT_REGS ];
299
- assign is_vector_o = out_is_vector [NUM_OUT_REGS ];
300
250
assign out_valid_o = out_valid [NUM_OUT_REGS ];
301
- assign lane_active_o = out_lane_active[NUM_OUT_REGS ];
302
251
303
252
// Assign output Flags: Busy if any element inside the pipe is valid
304
253
assign busy_o = | in_valid | | out_valid | fsm_busy;
0 commit comments