Skip to content

Commit

Permalink
pipistrello: run at 83+1/3 MHz, cleanup CRG
Browse files Browse the repository at this point in the history
jordens committed Jun 23, 2015
1 parent 9f3f925 commit cd249b2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions soc/targets/artiq_pipistrello.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from fractions import Fraction

from migen.fhdl.std import *
from migen.bank.description import *
from migen.bank import wbgen
@@ -13,18 +15,18 @@


class _RTIOCRG(Module, AutoCSR):
def __init__(self, platform):
def __init__(self, platform, clk_freq):
self._clock_sel = CSRStorage()
self.clock_domains.cd_rtio = ClockDomain(reset_less=True)

# 75MHz -> 125MHz
f = Fraction(125*1000*1000, clk_freq)
rtio_internal_clk = Signal()
self.specials += Instance("DCM_CLKGEN",
p_CLKFXDV_DIVIDE=2,
p_CLKFX_DIVIDE=3,
p_CLKFX_DIVIDE=f.denominator,
p_CLKFX_MD_MAX=1.6,
p_CLKFX_MULTIPLY=5,
p_CLKIN_PERIOD=1e3/75,
p_CLKFX_MULTIPLY=f.numerator,
p_CLKIN_PERIOD=1e9/clk_freq,
p_SPREAD_SPECTRUM="NONE",
p_STARTUP_WAIT="FALSE",
i_CLKIN=ClockSignal(),
@@ -123,7 +125,7 @@ def __init__(self, platform, cpu_type="or1k", **kwargs):
ififo_depth=4))

# RTIO core
self.submodules.rtio_crg = _RTIOCRG(platform)
self.submodules.rtio_crg = _RTIOCRG(platform, self.clk_freq)
self.submodules.rtio = rtio.RTIO(rtio_channels,
clk_freq=125000000)
self.add_constant("RTIO_FINE_TS_WIDTH", self.rtio.fine_ts_width)

0 comments on commit cd249b2

Please sign in to comment.