Skip to content

Commit 30ac208

Browse files
author
Stefan Mach
committed
👾 Fix various issues for synth
1 parent c78a7be commit 30ac208

File tree

3 files changed

+73
-68
lines changed

3 files changed

+73
-68
lines changed

hdl/control_mvp.sv

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -184,44 +184,44 @@ module control_mvp
184184
begin
185185
if(Full_precision_SO)
186186
begin
187-
State_ctl_S<=6'h1b; //24+4 more iterations for rounding bits
187+
State_ctl_S = 6'h1b; //24+4 more iterations for rounding bits
188188
end
189189
else
190190
begin
191-
State_ctl_S<=Precision_ctl_S;
191+
State_ctl_S = Precision_ctl_S;
192192
end
193193
end
194194
2'b01: //FP64
195195
begin
196196
if(Full_precision_SO)
197197
begin
198-
State_ctl_S<=6'h38; //53+4 more iterations for rounding bits
198+
State_ctl_S = 6'h38; //53+4 more iterations for rounding bits
199199
end
200200
else
201201
begin
202-
State_ctl_S<=Precision_ctl_S;
202+
State_ctl_S = Precision_ctl_S;
203203
end
204204
end
205205
2'b10: //FP16
206206
begin
207207
if(Full_precision_SO)
208208
begin
209-
State_ctl_S<=6'h0e; //11+4 more iterations for rounding bits
209+
State_ctl_S = 6'h0e; //11+4 more iterations for rounding bits
210210
end
211211
else
212212
begin
213-
State_ctl_S<=Precision_ctl_S;
213+
State_ctl_S = Precision_ctl_S;
214214
end
215215
end
216216
2'b11: //FP16ALT
217217
begin
218218
if(Full_precision_SO)
219219
begin
220-
State_ctl_S<=6'h0b; //8+4 more iterations for rounding bits
220+
State_ctl_S = 6'h0b; //8+4 more iterations for rounding bits
221221
end
222222
else
223223
begin
224-
State_ctl_S<=Precision_ctl_S;
224+
State_ctl_S = Precision_ctl_S;
225225
end
226226
end
227227
endcase
@@ -236,44 +236,44 @@ module control_mvp
236236
begin
237237
if(Full_precision_SO)
238238
begin
239-
State_ctl_S<=6'h0d; //24+4 more iterations for rounding bits
239+
State_ctl_S = 6'h0d; //24+4 more iterations for rounding bits
240240
end
241241
else
242242
begin
243-
State_ctl_S<=State_Two_iteration_unit_S;
243+
State_ctl_S = State_Two_iteration_unit_S;
244244
end
245245
end
246246
2'b01: //FP64
247247
begin
248248
if(Full_precision_SO)
249249
begin
250-
State_ctl_S<=6'h1b; //53+3 more iterations for rounding bits
250+
State_ctl_S = 6'h1b; //53+3 more iterations for rounding bits
251251
end
252252
else
253253
begin
254-
State_ctl_S<=State_Two_iteration_unit_S;
254+
State_ctl_S = State_Two_iteration_unit_S;
255255
end
256256
end
257257
2'b10: //FP16
258258
begin
259259
if(Full_precision_SO)
260260
begin
261-
State_ctl_S<=6'h06; //11+3 more iterations for rounding bits
261+
State_ctl_S = 6'h06; //11+3 more iterations for rounding bits
262262
end
263263
else
264264
begin
265-
State_ctl_S<=State_Two_iteration_unit_S;
265+
State_ctl_S = State_Two_iteration_unit_S;
266266
end
267267
end
268268
2'b11: //FP16ALT
269269
begin
270270
if(Full_precision_SO)
271271
begin
272-
State_ctl_S<=6'h05; //8+4 more iterations for rounding bits
272+
State_ctl_S = 6'h05; //8+4 more iterations for rounding bits
273273
end
274274
else
275275
begin
276-
State_ctl_S<=State_Two_iteration_unit_S;
276+
State_ctl_S = State_Two_iteration_unit_S;
277277
end
278278
end
279279
endcase
@@ -289,35 +289,35 @@ module control_mvp
289289
case(Precision_ctl_S)
290290
6'h00:
291291
begin
292-
State_ctl_S<=6'h08; //24+3 more iterations for rounding bits
292+
State_ctl_S = 6'h08; //24+3 more iterations for rounding bits
293293
end
294294
6'h06,6'h07,6'h08:
295295
begin
296-
State_ctl_S<=6'h02;
296+
State_ctl_S = 6'h02;
297297
end
298298
6'h09,6'h0a,6'h0b:
299299
begin
300-
State_ctl_S<=6'h03;
300+
State_ctl_S = 6'h03;
301301
end
302302
6'h0c,6'h0d,6'h0e:
303303
begin
304-
State_ctl_S<=6'h04;
304+
State_ctl_S = 6'h04;
305305
end
306306
6'h0f,6'h10,6'h11:
307307
begin
308-
State_ctl_S<=6'h05;
308+
State_ctl_S = 6'h05;
309309
end
310310
6'h12,6'h13,6'h14:
311311
begin
312-
State_ctl_S<=6'h06;
312+
State_ctl_S = 6'h06;
313313
end
314314
6'h15,6'h16,6'h17:
315315
begin
316-
State_ctl_S<=6'h07;
316+
State_ctl_S = 6'h07;
317317
end
318318
default:
319319
begin
320-
State_ctl_S<=6'h08; //24+3 more iterations for rounding bits
320+
State_ctl_S = 6'h08; //24+3 more iterations for rounding bits
321321
end
322322
endcase
323323
end
@@ -326,75 +326,75 @@ module control_mvp
326326
case(Precision_ctl_S)
327327
6'h00:
328328
begin
329-
State_ctl_S<=6'h12; //53+4 more iterations for rounding bits
329+
State_ctl_S = 6'h12; //53+4 more iterations for rounding bits
330330
end
331331
6'h06,6'h07,6'h08:
332332
begin
333-
State_ctl_S<=6'h02;
333+
State_ctl_S = 6'h02;
334334
end
335335
6'h09,6'h0a,6'h0b:
336336
begin
337-
State_ctl_S<=6'h03;
337+
State_ctl_S = 6'h03;
338338
end
339339
6'h0c,6'h0d,6'h0e:
340340
begin
341-
State_ctl_S<=6'h04;
341+
State_ctl_S = 6'h04;
342342
end
343343
6'h0f,6'h10,6'h11:
344344
begin
345-
State_ctl_S<=6'h05;
345+
State_ctl_S = 6'h05;
346346
end
347347
6'h12,6'h13,6'h14:
348348
begin
349-
State_ctl_S<=6'h06;
349+
State_ctl_S = 6'h06;
350350
end
351351
6'h15,6'h16,6'h17:
352352
begin
353-
State_ctl_S<=6'h07;
353+
State_ctl_S = 6'h07;
354354
end
355355
6'h18,6'h19,6'h1a:
356356
begin
357-
State_ctl_S<=6'h08;
357+
State_ctl_S = 6'h08;
358358
end
359359
6'h1b,6'h1c,6'h1d:
360360
begin
361-
State_ctl_S<=6'h09;
361+
State_ctl_S = 6'h09;
362362
end
363363
6'h1e,6'h1f,6'h20:
364364
begin
365-
State_ctl_S<=6'h0a;
365+
State_ctl_S = 6'h0a;
366366
end
367367
6'h21,6'h22,6'h23:
368368
begin
369-
State_ctl_S<=6'h0b;
369+
State_ctl_S = 6'h0b;
370370
end
371371
6'h24,6'h25,6'h26:
372372
begin
373-
State_ctl_S<=6'h0c;
373+
State_ctl_S = 6'h0c;
374374
end
375375
6'h27,6'h28,6'h29:
376376
begin
377-
State_ctl_S<=6'h0d;
377+
State_ctl_S = 6'h0d;
378378
end
379379
6'h2a,6'h2b,6'h2c:
380380
begin
381-
State_ctl_S<=6'h0e;
381+
State_ctl_S = 6'h0e;
382382
end
383383
6'h2d,6'h2e,6'h2f:
384384
begin
385-
State_ctl_S<=6'h0f;
385+
State_ctl_S = 6'h0f;
386386
end
387387
6'h30,6'h31,6'h32:
388388
begin
389-
State_ctl_S<=6'h10;
389+
State_ctl_S = 6'h10;
390390
end
391391
6'h33,6'h34,6'h35:
392392
begin
393-
State_ctl_S<=6'h11;
393+
State_ctl_S = 6'h11;
394394
end
395395
default:
396396
begin
397-
State_ctl_S<=6'h12; //53+4 more iterations for rounding bits
397+
State_ctl_S = 6'h12; //53+4 more iterations for rounding bits
398398
end
399399
endcase
400400
end
@@ -403,19 +403,19 @@ module control_mvp
403403
case(Precision_ctl_S)
404404
6'h00:
405405
begin
406-
State_ctl_S<=6'h04; //12+3 more iterations for rounding bits
406+
State_ctl_S = 6'h04; //12+3 more iterations for rounding bits
407407
end
408408
6'h06,6'h07,6'h08:
409409
begin
410-
State_ctl_S<=6'h02;
410+
State_ctl_S = 6'h02;
411411
end
412412
6'h09,6'h0a,6'h0b:
413413
begin
414-
State_ctl_S<=6'h03;
414+
State_ctl_S = 6'h03;
415415
end
416416
default:
417417
begin
418-
State_ctl_S<=6'h04; //12+3 more iterations for rounding bits
418+
State_ctl_S = 6'h04; //12+3 more iterations for rounding bits
419419
end
420420
endcase
421421
end
@@ -424,15 +424,15 @@ module control_mvp
424424
case(Precision_ctl_S)
425425
6'h00:
426426
begin
427-
State_ctl_S<=6'h03; //8+4 more iterations for rounding bits
427+
State_ctl_S = 6'h03; //8+4 more iterations for rounding bits
428428
end
429429
6'h06,6'h07,6'h08:
430430
begin
431-
State_ctl_S<=6'h02;
431+
State_ctl_S = 6'h02;
432432
end
433433
default:
434434
begin
435-
State_ctl_S<=6'h03; //8+4 more iterations for rounding bits
435+
State_ctl_S = 6'h03; //8+4 more iterations for rounding bits
436436
end
437437
endcase
438438
end
@@ -448,44 +448,44 @@ module control_mvp
448448
begin
449449
if(Full_precision_SO)
450450
begin
451-
State_ctl_S<=6'h06; //24+4 more iterations for rounding bits
451+
State_ctl_S = 6'h06; //24+4 more iterations for rounding bits
452452
end
453453
else
454454
begin
455-
State_ctl_S<=State_Four_iteration_unit_S;
455+
State_ctl_S = State_Four_iteration_unit_S;
456456
end
457457
end
458458
2'b01: //FP64
459459
begin
460460
if(Full_precision_SO)
461461
begin
462-
State_ctl_S<=6'h0d; //53+3 more iterations for rounding bits
462+
State_ctl_S = 6'h0d; //53+3 more iterations for rounding bits
463463
end
464464
else
465465
begin
466-
State_ctl_S<=State_Four_iteration_unit_S;
466+
State_ctl_S = State_Four_iteration_unit_S;
467467
end
468468
end
469469
2'b10: //FP16
470470
begin
471471
if(Full_precision_SO)
472472
begin
473-
State_ctl_S<=6'h03; //11+4 more iterations for rounding bits
473+
State_ctl_S = 6'h03; //11+4 more iterations for rounding bits
474474
end
475475
else
476476
begin
477-
State_ctl_S<=State_Four_iteration_unit_S;
477+
State_ctl_S = State_Four_iteration_unit_S;
478478
end
479479
end
480480
2'b11: //FP16ALT
481481
begin
482482
if(Full_precision_SO)
483483
begin
484-
State_ctl_S<=6'h02; //8+4 more iterations for rounding bits
484+
State_ctl_S = 6'h02; //8+4 more iterations for rounding bits
485485
end
486486
else
487487
begin
488-
State_ctl_S<=State_Four_iteration_unit_S;
488+
State_ctl_S = State_Four_iteration_unit_S;
489489
end
490490
end
491491
endcase

hdl/div_sqrt_top_mvp.sv

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ module div_sqrt_top_mvp
7070
logic [C_EXP_FP64:0] Exp_b_D;
7171
logic [C_MANT_FP64:0] Mant_a_D;
7272
logic [C_MANT_FP64:0] Mant_b_D;
73-
logic Full_precision_S, FP32_S, FP64_S, FP16_S, FP16ALT_S;
74-
73+
7574
logic [C_EXP_FP64+1:0] Exp_z_D;
76-
logic [C_MANT_FP64+4:0] Mant_z_D;
75+
logic [C_MANT_FP64+4:0] Mant_z_D;
7776
logic Sign_z_D;
7877
logic Start_S;
7978
logic [C_RM-1:0] RM_dly_S;
@@ -88,6 +87,12 @@ module div_sqrt_top_mvp
8887
logic SNaN_S;
8988
logic Special_case_SB,Special_case_dly_SB;
9089

90+
logic Full_precision_S;
91+
logic FP32_S;
92+
logic FP64_S;
93+
logic FP16_S;
94+
logic FP16ALT_S;
95+
9196

9297
preprocess_mvp preprocess_U0
9398
(

0 commit comments

Comments
 (0)