mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-29 05:03:34 +08:00
gateware/ad9858: use WaitTimer from Migen
This commit is contained in:
parent
fb8ccbd2a3
commit
cbb5027343
@ -1,25 +1,11 @@
|
||||
from migen.fhdl.std import *
|
||||
from migen.genlib.fsm import *
|
||||
from migen.genlib.misc import WaitTimer
|
||||
from migen.bus import wishbone
|
||||
from migen.bus.transactions import *
|
||||
from migen.sim.generic import run_simulation
|
||||
|
||||
|
||||
class WaitTimer(Module):
|
||||
def __init__(self, t):
|
||||
self.wait = Signal()
|
||||
self.done = Signal()
|
||||
|
||||
# # #
|
||||
|
||||
count = Signal(bits_for(t), reset=t)
|
||||
self.comb += self.done.eq(count == 0)
|
||||
self.sync += \
|
||||
If(self.wait,
|
||||
If(~self.done, count.eq(count - 1))
|
||||
).Else(count.eq(count.reset))
|
||||
|
||||
|
||||
class AD9858(Module):
|
||||
"""Wishbone interface to the AD9858 DDS chip.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user