with m.Else(): # ADD/SUB to take 2
m.d.sync += self.counter.eq(2)
with m.If(self.counter > 1):
m.d.sync += self.counter.eq(self.counter - 1)
with m.If(self.counter == 1):
# write req release out. waits until shadow is dropped.
with m.Else(): # ADD/SUB to take 2
m.d.sync += self.counter.eq(2)
with m.If(self.counter > 1):
m.d.sync += self.counter.eq(self.counter - 1)
with m.If(self.counter == 1):
# write req release out. waits until shadow is dropped.