From 59b7c3c82824099d5e6908a7f6ae2de0ab57b201 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 21 Mar 2019 13:49:07 +0000 Subject: [PATCH] add mid to Stage0Data --- src/add/nmigen_add_experiment.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 27539799..d1338dbf 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -717,7 +717,7 @@ class FPAddAlignSingleAdd(FPState, FPID): self.a0mod = FPAddStage0Mod(width, id_wid) self.a0o = self.a0mod.ospec() - self.a1mod = FPAddStage1Mod(width) + self.a1mod = FPAddStage1Mod(width, id_wid) self.a1o = self.a1mod.ospec() def setup(self, m, in_a, in_b, in_mid): @@ -742,12 +742,13 @@ class FPAddAlignSingleAdd(FPState, FPID): class FPAddStage0Data: - def __init__(self, width): + def __init__(self, width, id_wid): self.z = FPNumBase(width, False) self.tot = Signal(self.z.m_width + 4, reset_less=True) + self.mid = Signal(id_wid, reset_less=True) def eq(self, i): - return [self.z.eq(i.z), self.tot.eq(i.tot)] + return [self.z.eq(i.z), self.tot.eq(i.tot), self.mid.eq(i.mid)] class FPAddStage0Mod: @@ -762,7 +763,7 @@ class FPAddStage0Mod: return FPNumBase2Ops(self.width, self.id_wid) def ospec(self): - return FPAddStage0Data(self.width) + return FPAddStage0Data(self.width, self.id_wid) def setup(self, m, in_a, in_b): """ links module to inputs and outputs @@ -852,13 +853,14 @@ class FPAddStage1Mod(FPState): detects when tot sum is too big (tot[27] is kinda a carry bit) """ - def __init__(self, width): + def __init__(self, width, id_wid): self.width = width + self.id_wid = id_wid self.i = self.ispec() self.o = self.ospec() def ispec(self): - return FPAddStage0Data(self.width) + return FPAddStage0Data(self.width, self.id_wid) def ospec(self): return FPAddStage1Data(self.width) -- 2.30.2