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