From: Luke Kenneth Casson Leighton Date: Wed, 31 Jul 2019 19:44:48 +0000 (+0100) Subject: code reordering X-Git-Tag: ls180-24jan2020~607 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06f856756d76285c324e2d08e4de14a2c985bda7;p=ieee754fpu.git code reordering --- diff --git a/src/ieee754/fcvt/pipeline.py b/src/ieee754/fcvt/pipeline.py index 4f0e0e9c..e4df2227 100644 --- a/src/ieee754/fcvt/pipeline.py +++ b/src/ieee754/fcvt/pipeline.py @@ -110,9 +110,21 @@ class FPCVTMuxInOutBase(ReservationStations): return FPPackData(self.out_pspec) -def getkls(*args, **kwargs): - print ("getkls", args, kwargs) - return FPCVTMuxInOutBase(*args, **kwargs) +class FPCVTF2IntMuxInOut(FPCVTMuxInOutBase): + """ Reservation-Station version of FPCVT pipeline. + + * fan-in on inputs (an array of FPADDBaseData: a,b,mid) + * 2-stage multiplier pipeline + * fan-out on outputs (an array of FPPackData: z,mid) + + Fan-in and Fan-out are combinatorial. + """ + + def __init__(self, in_width, out_width, num_rows, op_wid=0): + FPCVTMuxInOutBase.__init__(self, FPCVTFloatToIntMod, False, + in_width, out_width, + num_rows, op_wid, + pkls=FPCVTFtoIntBasePipe) # factory which creates near-identical class structures that differ by @@ -125,24 +137,12 @@ muxfactoryinput = [("FPCVTDownMuxInOut", FPCVTDownConvertMod, True, ), ("FPCVTIntMuxInOut", FPCVTIntToFloatMod, True, ), ] +def getkls(*args, **kwargs): + print ("getkls", args, kwargs) + return FPCVTMuxInOutBase(*args, **kwargs) + for (name, kls, e_extra) in muxfactoryinput: fn = functools.partial(getkls, kls, e_extra) setattr(sys.modules[__name__], name, fn) -class FPCVTF2IntMuxInOut(FPCVTMuxInOutBase): - """ Reservation-Station version of FPCVT pipeline. - - * fan-in on inputs (an array of FPADDBaseData: a,b,mid) - * 2-stage multiplier pipeline - * fan-out on outputs (an array of FPPackData: z,mid) - - Fan-in and Fan-out are combinatorial. - """ - - def __init__(self, in_width, out_width, num_rows, op_wid=0): - FPCVTMuxInOutBase.__init__(self, FPCVTFloatToIntMod, False, - in_width, out_width, - num_rows, op_wid, - pkls=FPCVTFtoIntBasePipe) -