From: Luke Kenneth Casson Leighton Date: Thu, 21 Feb 2019 10:13:14 +0000 (+0000) Subject: move putz to separate class X-Git-Tag: ls180-24jan2020~1843 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=424780b0cb60d5ab487fef877b1fc469afa6841c;p=ieee754fpu.git move putz to separate class --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 1ff99af1..48eeba2a 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -251,6 +251,12 @@ class FPPack(FPState): self.pack(m, self.z, "put_z") +class FPPutZ(FPState): + + def action(self, m): + self.put_z(m, self.z, self.out_z, "get_a") + + class FPADD(FPBase): def __init__(self, width, single_cycle=False): @@ -335,6 +341,10 @@ class FPADD(FPBase): pa.set_inputs({"z": z}) # XXX Z as output pa.set_outputs({"z": z}) # XXX Z as output + pz = FPPutZ("put_z") + pz.set_inputs({"z": z}) + pz.set_outputs({"out_z": self.out_z}) + with m.FSM() as fsm: # ****** @@ -419,7 +429,7 @@ class FPADD(FPBase): # put_z stage with m.State("put_z"): - self.put_z(m, z, self.out_z, "get_a") + pz.action(m) return m