Skip to content

Commit

Permalink
Remove superfluous top_combs
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Dec 1, 2023
1 parent 8ed1c79 commit 9ee5842
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions transactron/utils/fifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def elaborate(self, platform):
m = TModule()

next_read_idx = Signal.like(self.read_idx)
m.d.top_comb += next_read_idx.eq(mod_incr(self.read_idx, self.depth))
m.d.comb += next_read_idx.eq(mod_incr(self.read_idx, self.depth))

m.submodules.buff_rdport = self.buff_rdport = self.buff.read_port(domain="sync", transparent=True)
m.submodules.buff_wrport = self.buff_wrport = self.buff.write_port()

m.d.top_comb += self.read_ready.eq(self.level != 0)
m.d.top_comb += self.write_ready.eq(self.level != self.depth)
m.d.comb += self.read_ready.eq(self.level != 0)
m.d.comb += self.write_ready.eq(self.level != self.depth)

with m.If(self.read.run & ~self.write.run):
m.d.sync += self.level.eq(self.level - 1)
Expand All @@ -75,8 +75,8 @@ def elaborate(self, platform):
with m.If(self.clear.run):
m.d.sync += self.level.eq(0)

m.d.top_comb += self.buff_rdport.addr.eq(Mux(self.read.run, next_read_idx, self.read_idx))
m.d.top_comb += self.head.eq(self.buff_rdport.data)
m.d.comb += self.buff_rdport.addr.eq(Mux(self.read.run, next_read_idx, self.read_idx))
m.d.comb += self.head.eq(self.buff_rdport.data)

@def_method(m, self.write, ready=self.write_ready)
def _(arg: Record) -> None:
Expand Down

0 comments on commit 9ee5842

Please sign in to comment.