forked from M-Labs/artiq
1
0
Fork 0

sayma_amc: add option to force outputs on the MCXs

This commit is contained in:
Harry Ho 2021-04-09 11:25:05 +08:00 committed by Sébastien Bourdeauducq
parent 759f00416b
commit 86fcd97416
1 changed files with 14 additions and 11 deletions

View File

@ -294,7 +294,7 @@ class Satellite(SatelliteBase):
""" """
DRTIO satellite with local DAC/SAWG channels, as well as TTL channels via FMC and VHDCI carrier. DRTIO satellite with local DAC/SAWG channels, as well as TTL channels via FMC and VHDCI carrier.
""" """
def __init__(self, jdcg_type, **kwargs): def __init__(self, jdcg_type, ttlout=False, **kwargs):
SatelliteBase.__init__(self, identifier_suffix="." + jdcg_type, **kwargs) SatelliteBase.__init__(self, identifier_suffix="." + jdcg_type, **kwargs)
platform = self.platform platform = self.platform
@ -318,12 +318,12 @@ class Satellite(SatelliteBase):
phy = ttl_simple.Output(platform.request("user_led", i)) phy = ttl_simple.Output(platform.request("user_led", i))
self.submodules += phy self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(phy)) rtio_channels.append(rtio.Channel.from_phy(phy))
mcx_io = platform.request("mcx_io", 0) for i in range(2):
phy = ttl_serdes_ultrascale.InOut(4, mcx_io.level) mcx_io = platform.request("mcx_io", i)
self.comb += mcx_io.direction.eq(phy.oe) if ttlout:
self.submodules += phy phy = ttl_serdes_ultrascale.Output(4, mcx_io.level)
rtio_channels.append(rtio.Channel.from_phy(phy)) self.comb += mcx_io.direction.eq(1)
mcx_io = platform.request("mcx_io", 1) else:
phy = ttl_serdes_ultrascale.InOut(4, mcx_io.level) phy = ttl_serdes_ultrascale.InOut(4, mcx_io.level)
self.comb += mcx_io.direction.eq(phy.oe) self.comb += mcx_io.direction.eq(phy.oe)
self.submodules += phy self.submodules += phy
@ -431,6 +431,8 @@ def main():
default="sawg", default="sawg",
help="Change type of signal generator. This is used exclusively for " help="Change type of signal generator. This is used exclusively for "
"development and debugging.") "development and debugging.")
parser.add_argument("--ttlout", default=False, action="store_true",
help="force only outputs on the MCX TTL IOs")
parser.add_argument("--gateware-identifier-str", default=None, parser.add_argument("--gateware-identifier-str", default=None,
help="Override ROM identifier") help="Override ROM identifier")
args = parser.parse_args() args = parser.parse_args()
@ -440,6 +442,7 @@ def main():
soc = Satellite( soc = Satellite(
with_sfp=args.sfp, with_sfp=args.sfp,
jdcg_type=args.jdcg_type, jdcg_type=args.jdcg_type,
ttlout=args.ttlout,
gateware_identifier_str=args.gateware_identifier_str, gateware_identifier_str=args.gateware_identifier_str,
**soc_sayma_amc_argdict(args)) **soc_sayma_amc_argdict(args))
elif variant == "simplesatellite": elif variant == "simplesatellite":