From: Luke Kenneth Casson Leighton Date: Mon, 4 Mar 2019 23:38:19 +0000 (+0000) Subject: add id_width to parameters X-Git-Tag: ls180-24jan2020~1739 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28a369a5101917cc87cd79529875583d6a3950fb;p=ieee754fpu.git add id_width to parameters --- 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)