From 28a369a5101917cc87cd79529875583d6a3950fb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 4 Mar 2019 23:38:19 +0000 Subject: [PATCH] add id_width to parameters --- src/add/nmigen_add_experiment.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 81e6d4ad..43be521d 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -905,10 +905,20 @@ class FPPutZ(FPState): class FPADD: - def __init__(self, width, single_cycle=False): + def __init__(self, width, id_wid=None, single_cycle=False): + """ IEEE754 FP Add + + * width: bit-width of IEEE754. supported: 16, 32, 64 + * id_wid: an identifier that is sync-connected to the input + * single_cycle: True indicates each stage to complete in 1 clock + """ + self.id_wid = id_wid self.width = width self.single_cycle = single_cycle + if self.id_wid: + self.in_mid = Signal(self.id_wid) + self.out_mid = Signal(self.id_wid) self.in_a = FPOp(width) self.in_b = FPOp(width) self.out_z = FPOp(width) -- 2.30.2