Skip to content

Commit

Permalink
soc: add timer to kernel CPU system
Browse files Browse the repository at this point in the history
sbourdeauducq committed Mar 3, 2016
1 parent b83b113 commit 9af1223
Showing 3 changed files with 19 additions and 5 deletions.
11 changes: 11 additions & 0 deletions artiq/gateware/soc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from misoc.integration.soc_core import mem_decoder
from misoc.cores import timer
from misoc.interconnect import wishbone

from artiq.gateware import amp

@@ -29,3 +30,13 @@ def __init__(self):
self.mailbox.i2)
self.add_memory_region("mailbox",
self.mem_map["mailbox"] | 0x80000000, 4)

self.submodules.timer_kernel = timer.Timer()
timer_csrs = self.timer_kernel.get_csrs()
timerwb = wishbone.CSRBank(timer_csrs)
self.submodules += timerwb
self.kernel_cpu.add_wb_slave(mem_decoder(self.mem_map["timer_kernel"]),
timerwb.bus)
self.add_csr_region("timer_kernel",
self.mem_map["timer_kernel"] | 0x80000000, 32,
timer_csrs)
7 changes: 4 additions & 3 deletions artiq/gateware/targets/kc705.py
Original file line number Diff line number Diff line change
@@ -83,7 +83,6 @@ def __init__(self, platform, rtio_internal_clk):

_ams101_dac = [
("ams101_dac", 0,

Subsignal("ldac", Pins("XADC:GPIO0")),
Subsignal("clk", Pins("XADC:GPIO1")),
Subsignal("mosi", Pins("XADC:GPIO2")),
@@ -95,6 +94,7 @@ def __init__(self, platform, rtio_internal_clk):

class _NIST_Ions(MiniSoC, AMPSoC):
csr_map = {
"timer_kernel": None, # mapped on Wishbone instead
"rtio": None, # mapped on Wishbone instead
"rtio_crg": 13,
"kernel_cpu": 14,
@@ -103,8 +103,9 @@ class _NIST_Ions(MiniSoC, AMPSoC):
}
csr_map.update(MiniSoC.csr_map)
mem_map = {
"rtio": 0x20000000, # (shadow @0xa0000000)
"mailbox": 0x70000000 # (shadow @0xf0000000)
"timer_kernel": 0x10000000, # (shadow @0x90000000)
"rtio": 0x20000000, # (shadow @0xa0000000)
"mailbox": 0x70000000 # (shadow @0xf0000000)
}
mem_map.update(MiniSoC.mem_map)

6 changes: 4 additions & 2 deletions artiq/gateware/targets/pipistrello.py
Original file line number Diff line number Diff line change
@@ -103,6 +103,7 @@ def __init__(self, platform, clk_freq):

class NIST_QC1(BaseSoC, AMPSoC):
csr_map = {
"timer_kernel": None, # mapped on Wishbone instead
"rtio": None, # mapped on Wishbone instead
"rtio_crg": 10,
"kernel_cpu": 11,
@@ -111,8 +112,9 @@ class NIST_QC1(BaseSoC, AMPSoC):
}
csr_map.update(BaseSoC.csr_map)
mem_map = {
"rtio": 0x20000000, # (shadow @0xa0000000)
"mailbox": 0x70000000 # (shadow @0xf0000000)
"timer_kernel": 0x10000000, # (shadow @0x90000000)
"rtio": 0x20000000, # (shadow @0xa0000000)
"mailbox": 0x70000000 # (shadow @0xf0000000)
}
mem_map.update(BaseSoC.mem_map)

0 comments on commit 9af1223

Please sign in to comment.