FPState.__init__(self, "special_cases")
self.smod = FPAddSpecialCasesMod(width, id_wid)
self.dmod = FPAddDeNormMod(width, id_wid)
- UnbufferedPipeline.__init__(self, self)
+ UnbufferedPipeline.__init__(self, self) # pipe is its own stage
self.o = self.ospec()
def ispec(self):
#m.d.sync += out_z.mid.eq(self.smod.o.mid) # (and mid)
# out_do_z=False
- m.d.sync += self.o.eq(self.dmod.o)
+ m.d.comb += self.o.eq(self.dmod.o)
def process(self, i):
return self.o
FPState.__init__(self, "align")
self.width = width
self.id_wid = id_wid
- UnbufferedPipeline.__init__(self, self)
+ UnbufferedPipeline.__init__(self, self) # pipeline is its own stage
self.a1o = self.ospec()
def ispec(self):
chain = StageChain([mod, a0mod, a1mod])
chain.setup(m, i)
- m.d.sync += self.a1o.eq(a1mod.o)
+ m.d.comb += self.a1o.eq(a1mod.o)
def process(self, i):
return self.a1o
FPState.__init__(self, "normalise_1")
self.id_wid = id_wid
self.width = width
- UnbufferedPipeline.__init__(self, self)
+ UnbufferedPipeline.__init__(self, self) # pipeline is its own stage
def ispec(self):
return FPAddStage1Data(self.width, self.id_wid) # Norm1ModSingle ispec
chain.setup(m, i)
self.out_z = pmod.ospec()
- m.d.sync += self.out_z.mid.eq(pmod.o.mid)
- m.d.sync += self.out_z.z.eq(pmod.o.z) # outputs packed result
+ m.d.comb += self.out_z.mid.eq(pmod.o.mid)
+ m.d.comb += self.out_z.z.eq(pmod.o.z) # outputs packed result
def process(self, i):
return self.out_z
self.dut = dut
self.di = {}
self.do = {}
- self.tlen = 4
+ self.tlen = 10
self.width = 32
for mid in range(dut.num_rows):
self.di[mid] = {}
for i in range(self.tlen):
op1 = randint(0, (1<<self.width)-1)
op2 = randint(0, (1<<self.width)-1)
+ #op1 = 0x40900000
+ #op2 = 0x40200000
res = Float32(op1) + Float32(op2)
self.di[mid][i] = (op1, op2)
self.do[mid].append(res.bits)