forked from M-Labs/artiq
sayma: allocate all user LEDs to RTIO, make one TTL SMA input
This commit is contained in:
parent
a23251276d
commit
4fbc8772a5
|
@ -49,65 +49,77 @@ device_db = {
|
||||||
"class": "TTLOut",
|
"class": "TTLOut",
|
||||||
"arguments": {"channel": 1}
|
"arguments": {"channel": 1}
|
||||||
},
|
},
|
||||||
"ttl_sma0": {
|
"led1": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.ttl",
|
"module": "artiq.coredevice.ttl",
|
||||||
"class": "TTLOut",
|
"class": "TTLOut",
|
||||||
"arguments": {"channel": 2}
|
"arguments": {"channel": 2}
|
||||||
},
|
},
|
||||||
"ttl_sma1": {
|
"led1": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.ttl",
|
"module": "artiq.coredevice.ttl",
|
||||||
"class": "TTLOut",
|
"class": "TTLOut",
|
||||||
"arguments": {"channel": 3}
|
"arguments": {"channel": 3}
|
||||||
},
|
},
|
||||||
|
"ttl_sma_out": {
|
||||||
|
"type": "local",
|
||||||
|
"module": "artiq.coredevice.ttl",
|
||||||
|
"class": "TTLOut",
|
||||||
|
"arguments": {"channel": 4}
|
||||||
|
},
|
||||||
|
"ttl_sma_in": {
|
||||||
|
"type": "local",
|
||||||
|
"module": "artiq.coredevice.ttl",
|
||||||
|
"class": "TTLOut",
|
||||||
|
"arguments": {"channel": 5}
|
||||||
|
},
|
||||||
|
|
||||||
"sawg0": {
|
"sawg0": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 4, "parallelism": 4}
|
"arguments": {"channel_base": 6, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg1": {
|
"sawg1": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 14, "parallelism": 4}
|
"arguments": {"channel_base": 16, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg2": {
|
"sawg2": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 24, "parallelism": 4}
|
"arguments": {"channel_base": 26, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg3": {
|
"sawg3": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 34, "parallelism": 4}
|
"arguments": {"channel_base": 36, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg4": {
|
"sawg4": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 44, "parallelism": 4}
|
"arguments": {"channel_base": 46, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg5": {
|
"sawg5": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 54, "parallelism": 4}
|
"arguments": {"channel_base": 56, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg6": {
|
"sawg6": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 64, "parallelism": 4}
|
"arguments": {"channel_base": 66, "parallelism": 4}
|
||||||
},
|
},
|
||||||
"sawg7": {
|
"sawg7": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"module": "artiq.coredevice.sawg",
|
"module": "artiq.coredevice.sawg",
|
||||||
"class": "SAWG",
|
"class": "SAWG",
|
||||||
"arguments": {"channel_base": 74, "parallelism": 4}
|
"arguments": {"channel_base": 76, "parallelism": 4}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ from artiq.experiment import *
|
||||||
class SAWGTest(EnvExperiment):
|
class SAWGTest(EnvExperiment):
|
||||||
def build(self):
|
def build(self):
|
||||||
self.setattr_device("core")
|
self.setattr_device("core")
|
||||||
self.setattr_device("ttl_sma0")
|
self.setattr_device("ttl_sma_out")
|
||||||
|
|
||||||
self.setattr_device("sawg0")
|
self.setattr_device("sawg0")
|
||||||
self.setattr_device("sawg1")
|
self.setattr_device("sawg1")
|
||||||
|
@ -28,21 +28,21 @@ class SAWGTest(EnvExperiment):
|
||||||
self.sawg1.amplitude1.set(.4)
|
self.sawg1.amplitude1.set(.4)
|
||||||
self.sawg1.frequency0.set(10*MHz)
|
self.sawg1.frequency0.set(10*MHz)
|
||||||
self.sawg1.phase0.set(0.)
|
self.sawg1.phase0.set(0.)
|
||||||
self.ttl_sma0.pulse(200*ns)
|
self.ttl_sma_out.pulse(200*ns)
|
||||||
self.sawg1.amplitude1.set(.1)
|
self.sawg1.amplitude1.set(.1)
|
||||||
delay(200*ns)
|
delay(200*ns)
|
||||||
self.sawg1.amplitude1.set(-.4)
|
self.sawg1.amplitude1.set(-.4)
|
||||||
self.ttl_sma0.pulse(200*ns)
|
self.ttl_sma_out.pulse(200*ns)
|
||||||
self.sawg1.amplitude1.set(.4)
|
self.sawg1.amplitude1.set(.4)
|
||||||
delay(200*ns)
|
delay(200*ns)
|
||||||
self.sawg1.phase0.set(.25)
|
self.sawg1.phase0.set(.25)
|
||||||
self.ttl_sma0.pulse(200*ns)
|
self.ttl_sma_out.pulse(200*ns)
|
||||||
self.sawg1.phase0.set(.5)
|
self.sawg1.phase0.set(.5)
|
||||||
delay(200*ns)
|
delay(200*ns)
|
||||||
self.sawg0.phase0.set(.5)
|
self.sawg0.phase0.set(.5)
|
||||||
self.ttl_sma0.pulse(200*ns)
|
self.ttl_sma_out.pulse(200*ns)
|
||||||
self.sawg1.frequency0.set(30*MHz)
|
self.sawg1.frequency0.set(30*MHz)
|
||||||
delay(200*ns)
|
delay(200*ns)
|
||||||
self.sawg1.frequency0.set(10*MHz)
|
self.sawg1.frequency0.set(10*MHz)
|
||||||
self.sawg1.phase0.set(0.)
|
self.sawg1.phase0.set(0.)
|
||||||
self.ttl_sma0.pulse(200*ns)
|
self.ttl_sma_out.pulse(200*ns)
|
||||||
|
|
|
@ -5,7 +5,7 @@ class SAWGTestTwoTone(EnvExperiment):
|
||||||
def build(self):
|
def build(self):
|
||||||
self.setattr_device("core")
|
self.setattr_device("core")
|
||||||
self.setattr_device("led0")
|
self.setattr_device("led0")
|
||||||
self.setattr_device("ttl_sma0")
|
self.setattr_device("ttl_sma_out")
|
||||||
|
|
||||||
self.setattr_device("sawg0")
|
self.setattr_device("sawg0")
|
||||||
self.setattr_device("sawg1")
|
self.setattr_device("sawg1")
|
||||||
|
@ -37,7 +37,7 @@ class SAWGTestTwoTone(EnvExperiment):
|
||||||
|
|
||||||
delay(20*ms)
|
delay(20*ms)
|
||||||
self.led0.on()
|
self.led0.on()
|
||||||
self.ttl_sma0.on()
|
self.ttl_sma_out.on()
|
||||||
self.sawg0.frequency0.set(10*MHz)
|
self.sawg0.frequency0.set(10*MHz)
|
||||||
self.sawg0.phase0.set(0.)
|
self.sawg0.phase0.set(0.)
|
||||||
self.sawg0.frequency1.set(1*MHz)
|
self.sawg0.frequency1.set(1*MHz)
|
||||||
|
@ -58,5 +58,5 @@ class SAWGTestTwoTone(EnvExperiment):
|
||||||
|
|
||||||
self.sawg1.amplitude1.set(.0)
|
self.sawg1.amplitude1.set(.0)
|
||||||
self.sawg1.amplitude2.set(.0)
|
self.sawg1.amplitude2.set(.0)
|
||||||
self.ttl_sma0.off()
|
self.ttl_sma_out.off()
|
||||||
self.led0.off()
|
self.led0.off()
|
||||||
|
|
|
@ -7,7 +7,6 @@ from collections import namedtuple
|
||||||
from migen import *
|
from migen import *
|
||||||
from migen.genlib.resetsync import AsyncResetSynchronizer
|
from migen.genlib.resetsync import AsyncResetSynchronizer
|
||||||
|
|
||||||
from misoc.cores import gpio
|
|
||||||
from misoc.integration.soc_sdram import soc_sdram_args, soc_sdram_argdict
|
from misoc.integration.soc_sdram import soc_sdram_args, soc_sdram_argdict
|
||||||
from misoc.integration.builder import builder_args, builder_argdict
|
from misoc.integration.builder import builder_args, builder_argdict
|
||||||
from misoc.interconnect import stream
|
from misoc.interconnect import stream
|
||||||
|
@ -126,12 +125,6 @@ class SaymaAMCStandalone(MiniSoC, AMPSoC):
|
||||||
"set_property CONFIG_VOLTAGE 3.3 [current_design]",
|
"set_property CONFIG_VOLTAGE 3.3 [current_design]",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
self.submodules.leds = gpio.GPIOOut(Cat(
|
|
||||||
platform.request("user_led", 0),
|
|
||||||
platform.request("user_led", 1)))
|
|
||||||
self.csr_devices.append("leds")
|
|
||||||
|
|
||||||
# forward RTM UART to second FTDI UART channel
|
# forward RTM UART to second FTDI UART channel
|
||||||
serial_1 = platform.request("serial", 1)
|
serial_1 = platform.request("serial", 1)
|
||||||
serial_rtm = platform.request("serial_rtm")
|
serial_rtm = platform.request("serial_rtm")
|
||||||
|
@ -167,17 +160,20 @@ class SaymaAMCStandalone(MiniSoC, AMPSoC):
|
||||||
|
|
||||||
# RTIO
|
# RTIO
|
||||||
rtio_channels = []
|
rtio_channels = []
|
||||||
for i in (2, 3):
|
for i in range(4):
|
||||||
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))
|
||||||
|
sma_io = platform.request("sma_io", 0)
|
||||||
for i in (0, 1):
|
self.comb += sma_io.direction.eq(1)
|
||||||
sma_io = platform.request("sma_io", i)
|
phy = ttl_simple.Output(sma_io.level)
|
||||||
self.comb += sma_io.direction.eq(1)
|
self.submodules += phy
|
||||||
phy = ttl_simple.Output(sma_io.level)
|
rtio_channels.append(rtio.Channel.from_phy(phy))
|
||||||
self.submodules += phy
|
sma_io = platform.request("sma_io", 1)
|
||||||
rtio_channels.append(rtio.Channel.from_phy(phy))
|
self.comb += sma_io.direction.eq(0)
|
||||||
|
phy = ttl_simple.InOut(sma_io.level)
|
||||||
|
self.submodules += phy
|
||||||
|
rtio_channels.append(rtio.Channel.from_phy(phy))
|
||||||
|
|
||||||
if with_sawg:
|
if with_sawg:
|
||||||
self.submodules.ad9154_crg = AD9154CRG(platform)
|
self.submodules.ad9154_crg = AD9154CRG(platform)
|
||||||
|
|
Loading…
Reference in New Issue