From 0932162242f7e77f8f8622eb0b03ceff1d332e73 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 21 Feb 2019 10:10:41 +0000 Subject: [PATCH] move corrections to separate class --- src/add/nmigen_add_experiment.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 -- 2.30.2