From 5b3fef624ed9a409a7c12a799153ab706b91dcc8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 21 Feb 2019 10:11:53 +0000 Subject: [PATCH] move pack to separate class --- src/add/nmigen_add_experiment.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index dab957c4..1ff99af1 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -238,12 +238,19 @@ 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 FPPack(FPState): + + def action(self, m): + self.pack(m, self.z, "put_z") + + class FPADD(FPBase): def __init__(self, width, single_cycle=False): @@ -324,6 +331,10 @@ class FPADD(FPBase): cor.set_inputs({"z": z}) # XXX Z as output cor.set_outputs({"z": z}) # XXX Z as output + pa = FPPack("pack") + pa.set_inputs({"z": z}) # XXX Z as output + pa.set_outputs({"z": z}) # XXX Z as output + with m.FSM() as fsm: # ****** @@ -402,7 +413,7 @@ class FPADD(FPBase): # pack stage with m.State("pack"): - self.pack(m, z, "put_z") + pa.action(m) # ****** # put_z stage -- 2.30.2