From 8062e48697bba406f3ab8edec1357e9175b7d739 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 12 Jul 2012 19:37:50 +0200 Subject: [PATCH] bus/asmibus: fix per-port tag generation --- migen/bus/asmibus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migen/bus/asmibus.py b/migen/bus/asmibus.py index d98693b6..39a60b35 100644 --- a/migen/bus/asmibus.py +++ b/migen/bus/asmibus.py @@ -101,9 +101,11 @@ class Port: s.allocate_adr.eq(self.adr) ] choose_slot = None - for s in reversed(self.slots): + needs_tags = len(self.slots) > 1 + for n, s in reversed(list(enumerate(self.slots))): choose_slot = If(s.state == SLOT_EMPTY, - s.allocate.eq(self.stb) + s.allocate.eq(self.stb), + self.tag_issue.eq(n) if needs_tags else None ).Else(choose_slot) comb.append(choose_slot) comb.append(self.ack.eq(optree("|", -- 2.30.2