Skip to content

Commit 9af1223

Browse files
committedMar 3, 2016
soc: add timer to kernel CPU system
1 parent b83b113 commit 9af1223

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed
 

Diff for: ‎artiq/gateware/soc.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from misoc.integration.soc_core import mem_decoder
22
from misoc.cores import timer
3+
from misoc.interconnect import wishbone
34

45
from artiq.gateware import amp
56

@@ -29,3 +30,13 @@ def __init__(self):
2930
self.mailbox.i2)
3031
self.add_memory_region("mailbox",
3132
self.mem_map["mailbox"] | 0x80000000, 4)
33+
34+
self.submodules.timer_kernel = timer.Timer()
35+
timer_csrs = self.timer_kernel.get_csrs()
36+
timerwb = wishbone.CSRBank(timer_csrs)
37+
self.submodules += timerwb
38+
self.kernel_cpu.add_wb_slave(mem_decoder(self.mem_map["timer_kernel"]),
39+
timerwb.bus)
40+
self.add_csr_region("timer_kernel",
41+
self.mem_map["timer_kernel"] | 0x80000000, 32,
42+
timer_csrs)

Diff for: ‎artiq/gateware/targets/kc705.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def __init__(self, platform, rtio_internal_clk):
8383

8484
_ams101_dac = [
8585
("ams101_dac", 0,
86-
8786
Subsignal("ldac", Pins("XADC:GPIO0")),
8887
Subsignal("clk", Pins("XADC:GPIO1")),
8988
Subsignal("mosi", Pins("XADC:GPIO2")),
@@ -95,6 +94,7 @@ def __init__(self, platform, rtio_internal_clk):
9594

9695
class _NIST_Ions(MiniSoC, AMPSoC):
9796
csr_map = {
97+
"timer_kernel": None, # mapped on Wishbone instead
9898
"rtio": None, # mapped on Wishbone instead
9999
"rtio_crg": 13,
100100
"kernel_cpu": 14,
@@ -103,8 +103,9 @@ class _NIST_Ions(MiniSoC, AMPSoC):
103103
}
104104
csr_map.update(MiniSoC.csr_map)
105105
mem_map = {
106-
"rtio": 0x20000000, # (shadow @0xa0000000)
107-
"mailbox": 0x70000000 # (shadow @0xf0000000)
106+
"timer_kernel": 0x10000000, # (shadow @0x90000000)
107+
"rtio": 0x20000000, # (shadow @0xa0000000)
108+
"mailbox": 0x70000000 # (shadow @0xf0000000)
108109
}
109110
mem_map.update(MiniSoC.mem_map)
110111

Diff for: ‎artiq/gateware/targets/pipistrello.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __init__(self, platform, clk_freq):
103103

104104
class NIST_QC1(BaseSoC, AMPSoC):
105105
csr_map = {
106+
"timer_kernel": None, # mapped on Wishbone instead
106107
"rtio": None, # mapped on Wishbone instead
107108
"rtio_crg": 10,
108109
"kernel_cpu": 11,
@@ -111,8 +112,9 @@ class NIST_QC1(BaseSoC, AMPSoC):
111112
}
112113
csr_map.update(BaseSoC.csr_map)
113114
mem_map = {
114-
"rtio": 0x20000000, # (shadow @0xa0000000)
115-
"mailbox": 0x70000000 # (shadow @0xf0000000)
115+
"timer_kernel": 0x10000000, # (shadow @0x90000000)
116+
"rtio": 0x20000000, # (shadow @0xa0000000)
117+
"mailbox": 0x70000000 # (shadow @0xf0000000)
116118
}
117119
mem_map.update(BaseSoC.mem_map)
118120

0 commit comments

Comments
 (0)
Please sign in to comment.