From: Luke Kenneth Casson Leighton Date: Thu, 9 May 2019 10:37:59 +0000 (+0100) Subject: reduce ANDing chain (using NOR) in group picker X-Git-Tag: div_pipeline~2093 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b01ab17fcb948edb4dda903195a6b3a2f688371e;p=soc.git reduce ANDing chain (using NOR) in group picker --- diff --git a/src/scoreboard/group_picker.py b/src/scoreboard/group_picker.py index 333d5b1b..022543f0 100644 --- a/src/scoreboard/group_picker.py +++ b/src/scoreboard/group_picker.py @@ -16,14 +16,15 @@ class PriorityPicker(Elaboratable): m = Module() res = [] + ni = Signal(self.wid, reset_less = True) + m.d.comb += ni.eq(~self.i) for i in range(0, self.wid): t = Signal(reset_less = True) res.append(t) if i == 0: - m.d.comb += t.eq(self.i[0]) + m.d.comb += t.eq(self.i[i]) else: - m.d.comb += t.eq((~res[-2]) & self.i[i]) - res.append(t) + m.d.comb += t.eq(~Cat(ni[i], *self.i[:i]).bool()) # we like Cat(*xxx). turn lists into concatenated bits m.d.comb += self.o.eq(Cat(*res))