mirror of https://github.com/m-labs/artiq.git
ad9910/2: add sw invariant only when passed
This commit is contained in:
parent
82831a85b6
commit
37ec97eb28
|
@ -49,7 +49,7 @@ class AD9910:
|
||||||
:param pll_cp: DDS PLL charge pump setting.
|
:param pll_cp: DDS PLL charge pump setting.
|
||||||
:param pll_vco: DDS PLL VCO range selection.
|
:param pll_vco: DDS PLL VCO range selection.
|
||||||
"""
|
"""
|
||||||
kernel_invariants = {"chip_select", "cpld", "core", "bus", "sw",
|
kernel_invariants = {"chip_select", "cpld", "core", "bus",
|
||||||
"ftw_per_hz", "pll_n", "pll_cp", "pll_vco"}
|
"ftw_per_hz", "pll_n", "pll_cp", "pll_vco"}
|
||||||
|
|
||||||
def __init__(self, dmgr, chip_select, cpld_device, sw_device=None,
|
def __init__(self, dmgr, chip_select, cpld_device, sw_device=None,
|
||||||
|
@ -61,6 +61,7 @@ class AD9910:
|
||||||
self.chip_select = chip_select
|
self.chip_select = chip_select
|
||||||
if sw_device:
|
if sw_device:
|
||||||
self.sw = dmgr.get(sw_device)
|
self.sw = dmgr.get(sw_device)
|
||||||
|
self.kernel_invariants.add("sw")
|
||||||
assert 12 <= pll_n <= 127
|
assert 12 <= pll_n <= 127
|
||||||
self.pll_n = pll_n
|
self.pll_n = pll_n
|
||||||
assert self.cpld.refclk/4 <= 60e6
|
assert self.cpld.refclk/4 <= 60e6
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AD9912:
|
||||||
f_ref*pll_n where f_ref is the reference frequency (set in the parent
|
f_ref*pll_n where f_ref is the reference frequency (set in the parent
|
||||||
Urukul CPLD instance).
|
Urukul CPLD instance).
|
||||||
"""
|
"""
|
||||||
kernel_invariants = {"chip_select", "cpld", "core", "bus", "sw",
|
kernel_invariants = {"chip_select", "cpld", "core", "bus",
|
||||||
"ftw_per_hz", "sysclk", "pll_n"}
|
"ftw_per_hz", "sysclk", "pll_n"}
|
||||||
|
|
||||||
def __init__(self, dmgr, chip_select, cpld_device, sw_device=None,
|
def __init__(self, dmgr, chip_select, cpld_device, sw_device=None,
|
||||||
|
@ -36,6 +36,7 @@ class AD9912:
|
||||||
self.chip_select = chip_select
|
self.chip_select = chip_select
|
||||||
if sw_device:
|
if sw_device:
|
||||||
self.sw = dmgr.get(sw_device)
|
self.sw = dmgr.get(sw_device)
|
||||||
|
self.kernel_invariants.add("sw")
|
||||||
self.pll_n = pll_n
|
self.pll_n = pll_n
|
||||||
self.sysclk = self.cpld.refclk*pll_n
|
self.sysclk = self.cpld.refclk*pll_n
|
||||||
assert self.sysclk <= 1e9
|
assert self.sysclk <= 1e9
|
||||||
|
|
Loading…
Reference in New Issue