Skip to content

Commit

Permalink
fhdl/structure/Memory: fix we width
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Nov 23, 2012
1 parent 784a399 commit f42683b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions migen/fhdl/structure.py
Expand Up @@ -338,7 +338,10 @@ def get_port(self, write_capable=False, async_read=False,
adr = Signal(BV(bits_for(self.depth-1)))
dat_r = Signal(BV(self.width))
if write_capable:
we = Signal()
if we_granularity:
we = Signal(BV(self.width//we_granularity))
else:
we = Signal()
dat_w = Signal(BV(self.width))
else:
we = None
Expand All @@ -348,8 +351,8 @@ def get_port(self, write_capable=False, async_read=False,
else:
re = None
mp = MemoryPort(adr, dat_r, we, dat_w,
async_read, re, we_granularity, mode,
clock_domain)
async_read, re, we_granularity, mode,
clock_domain)
self.ports.append(mp)
return mp

Expand Down

0 comments on commit f42683b

Please sign in to comment.