Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71bd2d9

Browse files
committedSep 4, 2016
phaser: non-rtio spi
1 parent 1feb7cf commit 71bd2d9

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed
 

‎artiq/examples/phaser/device_db.pyon

+4-10
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,28 @@
3030
"class": "TTLOut",
3131
"arguments": {"channel": 1}
3232
},
33-
"dac0_spi": {
34-
"type": "local",
35-
"module": "artiq.coredevice.spi",
36-
"class": "SPIMaster",
37-
"arguments": {"channel": 2}
38-
},
3933
"sawg0": {
4034
"type": "local",
4135
"module": "artiq.coredevice.sawg",
4236
"class": "SAWG",
43-
"arguments": {"channel_base": 3, "parallelism": 4}
37+
"arguments": {"channel_base": 2, "parallelism": 4}
4438
},
4539
"sawg1": {
4640
"type": "local",
4741
"module": "artiq.coredevice.sawg",
4842
"class": "SAWG",
49-
"arguments": {"channel_base": 6, "parallelism": 4}
43+
"arguments": {"channel_base": 5, "parallelism": 4}
5044
},
5145
"sawg2": {
5246
"type": "local",
5347
"module": "artiq.coredevice.sawg",
5448
"class": "SAWG",
55-
"arguments": {"channel_base": 9, "parallelism": 4}
49+
"arguments": {"channel_base": 8, "parallelism": 4}
5650
},
5751
"sawg3": {
5852
"type": "local",
5953
"module": "artiq.coredevice.sawg",
6054
"class": "SAWG",
61-
"arguments": {"channel_base": 12, "parallelism": 4}
55+
"arguments": {"channel_base": 11, "parallelism": 4}
6256
}
6357
}

‎artiq/examples/phaser/repository/sawg.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ def build(self):
66
self.setattr_device("core")
77
self.setattr_device("led")
88

9-
self.setattr_device("dac0_spi")
109
self.setattr_device("sawg0")
1110
self.setattr_device("sawg1")
1211
self.setattr_device("sawg2")

‎artiq/gateware/targets/kc705.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from misoc.interconnect.csr import *
1414
from misoc.interconnect import wishbone
1515
from misoc.cores import gpio
16+
from misoc.cores import spi as spi_csr
1617
from misoc.integration.soc_core import mem_decoder
1718
from misoc.targets.kc705 import MiniSoC, soc_kc705_args, soc_kc705_argdict
1819
from misoc.integration.builder import builder_args, builder_argdict
@@ -390,6 +391,13 @@ def __init__(self, cpu_type="or1k", **kwargs):
390391

391392

392393
class Phaser(_NIST_Ions):
394+
csr_map = {}
395+
csr_map.update(_NIST_Ions.csr_map)
396+
csr_map["spi_fmc_hpc"] = None
397+
mem_map = {}
398+
mem_map.update(_NIST_Ions.mem_map)
399+
mem_map["spi_fmc_hpc"] = 0x40000000 # (shadow @0xc0000000)
400+
393401
def __init__(self, cpu_type="or1k", **kwargs):
394402
_NIST_Ions.__init__(self, cpu_type, **kwargs)
395403

@@ -410,12 +418,10 @@ def __init__(self, cpu_type="or1k", **kwargs):
410418

411419
self.config["RTIO_REGULAR_TTL_COUNT"] = len(rtio_channels)
412420

413-
self.config["RTIO_FIRST_SPI_CHANNEL"] = len(rtio_channels)
414-
# TODO: dummy, hookup ad9154 spi here
415-
phy = spi.SPIMaster(self.platform.request("spi", 0))
416-
self.submodules += phy
417-
rtio_channels.append(rtio.Channel.from_phy(
418-
phy, ofifo_depth=128, ififo_depth=128))
421+
# TODO: dummy, hookup actual fmc hpc spi here
422+
self.submodules.spi_fmc_hpc = spi_csr.SPIMaster(
423+
self.platform.request("spi", 0))
424+
self.register_kernel_cpu_csrdevice("spi_fmc_hpc")
419425

420426
self.config["RTIO_FIRST_SAWG_CHANNEL"] = len(rtio_channels)
421427
sawgs = [sawg.Channel(width=16, parallelism=4) for i in range(4)]

0 commit comments

Comments
 (0)
Please sign in to comment.