Skip to content

Commit cd249b2

Browse files
committedJun 23, 2015
pipistrello: run at 83+1/3 MHz, cleanup CRG
1 parent 9f3f925 commit cd249b2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

Diff for: ‎soc/targets/artiq_pipistrello.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from fractions import Fraction
2+
13
from migen.fhdl.std import *
24
from migen.bank.description import *
35
from migen.bank import wbgen
@@ -13,18 +15,18 @@
1315

1416

1517
class _RTIOCRG(Module, AutoCSR):
16-
def __init__(self, platform):
18+
def __init__(self, platform, clk_freq):
1719
self._clock_sel = CSRStorage()
1820
self.clock_domains.cd_rtio = ClockDomain(reset_less=True)
1921

20-
# 75MHz -> 125MHz
22+
f = Fraction(125*1000*1000, clk_freq)
2123
rtio_internal_clk = Signal()
2224
self.specials += Instance("DCM_CLKGEN",
2325
p_CLKFXDV_DIVIDE=2,
24-
p_CLKFX_DIVIDE=3,
26+
p_CLKFX_DIVIDE=f.denominator,
2527
p_CLKFX_MD_MAX=1.6,
26-
p_CLKFX_MULTIPLY=5,
27-
p_CLKIN_PERIOD=1e3/75,
28+
p_CLKFX_MULTIPLY=f.numerator,
29+
p_CLKIN_PERIOD=1e9/clk_freq,
2830
p_SPREAD_SPECTRUM="NONE",
2931
p_STARTUP_WAIT="FALSE",
3032
i_CLKIN=ClockSignal(),
@@ -123,7 +125,7 @@ def __init__(self, platform, cpu_type="or1k", **kwargs):
123125
ififo_depth=4))
124126

125127
# RTIO core
126-
self.submodules.rtio_crg = _RTIOCRG(platform)
128+
self.submodules.rtio_crg = _RTIOCRG(platform, self.clk_freq)
127129
self.submodules.rtio = rtio.RTIO(rtio_channels,
128130
clk_freq=125000000)
129131
self.add_constant("RTIO_FINE_TS_WIDTH", self.rtio.fine_ts_width)

0 commit comments

Comments
 (0)
Please sign in to comment.