Skip to content

Commit

Permalink
fx2_crossbar: fix module naming for ports with specified clock domains
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Binkowski committed Nov 29, 2019
1 parent 6d23863 commit 5d910c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions gateware/fx2_crossbar/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def do_finalize(self):
)
)

def _make_fifo(self, crossbar_side, logic_side, cd_logic, reset, depth, wrapper):
def _make_fifo(self, crossbar_side, logic_side, cd_logic, reset, depth, wrapper, name):
if cd_logic is None:
fifo = wrapper(SyncFIFOBuffered(8, depth))

Expand Down Expand Up @@ -508,7 +508,8 @@ def _make_fifo(self, crossbar_side, logic_side, cd_logic, reset, depth, wrapper)
fifo.comb += fifo.cd_crossbar.rst.eq(reset)
fifo.specials += AsyncResetSynchronizer(fifo.cd_logic, reset)

self.submodules += fifo
setattr(self.submodules, name, fifo)

return fifo

def get_out_fifo(self, n, depth=512, clock_domain=None, reset=None):
Expand All @@ -522,8 +523,8 @@ def get_out_fifo(self, n, depth=512, clock_domain=None, reset=None):
cd_logic=clock_domain,
reset=reset,
depth=depth,
wrapper=lambda fifo: _OUTFIFO(fifo,
skid_depth=3))
wrapper=lambda fifo: _OUTFIFO(fifo, skid_depth=3),
name="fifo_out{}".format(n))
self.out_fifos[n] = fifo

self.comb += [
Expand All @@ -547,7 +548,8 @@ def get_in_fifo(self, n, depth=512, auto_flush=True, clock_domain=None, reset=No
depth=depth,
wrapper=lambda fifo: _INFIFO(fifo,
asynchronous=clock_domain is not None,
auto_flush=auto_flush))
auto_flush=auto_flush),
name="fifo_in{}".format(n))
self.in_fifos[n] = fifo

self.comb += [
Expand Down

0 comments on commit 5d910c1

Please sign in to comment.