From: Luke Kenneth Casson Leighton Date: Thu, 21 Feb 2019 10:10:41 +0000 (+0000) Subject: move corrections to separate class X-Git-Tag: ls180-24jan2020~1845 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0932162242f7e77f8f8622eb0b03ceff1d332e73;p=ieee754fpu.git move corrections to separate class --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 0fa305ed..dab957c4 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -238,6 +238,11 @@ class FPRound(FPState): def action(self, m): self.roundz(m, self.z, self.of, "corrections") +class FPCorrections(FPState): + + def action(self, m): + self.corrections(m, self.z, "pack") + class FPADD(FPBase): @@ -311,10 +316,14 @@ class FPADD(FPBase): n2.set_inputs({"z": z, "of": of}) # XXX Z as output n2.set_outputs({"z": z}) # XXX Z as output - rn = FPRound("corrections") + rn = FPRound("round") rn.set_inputs({"z": z, "of": of}) # XXX Z as output rn.set_outputs({"z": z}) # XXX Z as output + cor = FPCorrections("corrections") + cor.set_inputs({"z": z}) # XXX Z as output + cor.set_outputs({"z": z}) # XXX Z as output + with m.FSM() as fsm: # ****** @@ -387,7 +396,7 @@ class FPADD(FPBase): # correction stage with m.State("corrections"): - self.corrections(m, z, "pack") + cor.action(m) # ****** # pack stage