gen/genlib/misc/WaitTimer: Cast t to int and minor cosmetic cleanup.
This commit is contained in:
parent
b8dc1b7757
commit
bf79c9032a
|
@ -80,12 +80,20 @@ class WaitTimer(Module):
|
|||
|
||||
# # #
|
||||
|
||||
# Cast t to int.
|
||||
t = int(t)
|
||||
count = Signal(bits_for(t), reset=t)
|
||||
|
||||
self.comb += self.done.eq(count == 0)
|
||||
self.sync += \
|
||||
self.sync += [
|
||||
If(self.wait,
|
||||
If(~self.done, count.eq(count - 1))
|
||||
).Else(count.eq(count.reset))
|
||||
If(~self.done,
|
||||
count.eq(count - 1)
|
||||
)
|
||||
).Else(
|
||||
count.eq(count.reset)
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
class BitSlip(Module):
|
||||
|
|
Loading…
Reference in New Issue