forked from M-Labs/artiq-zynq
Compare commits
21 Commits
2530e0a8a1
...
e3eef04e47
Author | SHA1 | Date |
---|---|---|
mwojcik | e3eef04e47 | |
mwojcik | 273ae64457 | |
mwojcik | f952639897 | |
mwojcik | 6f2fdbdd72 | |
mwojcik | 09371b0aab | |
mwojcik | 0595278e63 | |
mwojcik | 5466e3d72a | |
mwojcik | d8117b5f63 | |
mwojcik | 2cc6103771 | |
mwojcik | c696fd826f | |
mwojcik | 4b3c9a3d08 | |
mwojcik | 779aea7c6a | |
mwojcik | 6785ca2c85 | |
Sebastien Bourdeauducq | cded04e2d6 | |
sven-oxionics | 656cbf4546 | |
mwojcik | ecd4ca333c | |
mwojcik | ae3099dd8e | |
mwojcik | 2b9542c80b | |
mwojcik | 49810da188 | |
mwojcik | e451598a06 | |
mwojcik | f4ceca464f |
26
flake.lock
26
flake.lock
|
@ -11,11 +11,11 @@
|
|||
"src-pythonparser": "src-pythonparser"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693998161,
|
||||
"narHash": "sha256-GbJbBQF8i0FrBOecaAGJFv+0i37wLPgy0uoeyuiq4IM=",
|
||||
"lastModified": 1696817638,
|
||||
"narHash": "sha256-rbIN4Ll1VX4RXxDBlLGgTiQC6L6jZE9q8HYBxPhwCpY=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "2f3329181c2579ed77334e5875e8698a804be91d",
|
||||
"revCount": 8495,
|
||||
"rev": "d070826911e86b5ec9de958c4bcd93ef0b7fddb2",
|
||||
"revCount": 8564,
|
||||
"type": "git",
|
||||
"url": "https://github.com/m-labs/artiq.git"
|
||||
},
|
||||
|
@ -71,11 +71,11 @@
|
|||
"mozilla-overlay": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690536331,
|
||||
"narHash": "sha256-aRIf2FB2GTdfF7gl13WyETmiV/J7EhBGkSWXfZvlxcA=",
|
||||
"lastModified": 1695805681,
|
||||
"narHash": "sha256-1ElPLD8eFfnuIk0G52HGGpRtQZ4QPCjChRlEOfkZ5ro=",
|
||||
"owner": "mozilla",
|
||||
"repo": "nixpkgs-mozilla",
|
||||
"rev": "db89c8707edcffefcd8e738459d511543a339ff5",
|
||||
"rev": "6eabade97bc28d707a8b9d82ad13ef143836736e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -87,11 +87,11 @@
|
|||
"mozilla-overlay_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690536331,
|
||||
"narHash": "sha256-aRIf2FB2GTdfF7gl13WyETmiV/J7EhBGkSWXfZvlxcA=",
|
||||
"lastModified": 1695805681,
|
||||
"narHash": "sha256-1ElPLD8eFfnuIk0G52HGGpRtQZ4QPCjChRlEOfkZ5ro=",
|
||||
"owner": "mozilla",
|
||||
"repo": "nixpkgs-mozilla",
|
||||
"rev": "db89c8707edcffefcd8e738459d511543a339ff5",
|
||||
"rev": "6eabade97bc28d707a8b9d82ad13ef143836736e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -118,11 +118,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1693771906,
|
||||
"narHash": "sha256-32EnPCaVjOiEERZ+o/2Ir7JH9pkfwJZJ27SKHNvt4yk=",
|
||||
"lastModified": 1696697597,
|
||||
"narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "da5adce0ffaff10f6d0fee72a02a5ed9d01b52fc",
|
||||
"rev": "5a237aecb57296f67276ac9ab296a41c23981f56",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -338,18 +338,22 @@
|
|||
} //
|
||||
(build { target = "zc706"; variant = "nist_clock"; }) //
|
||||
(build { target = "zc706"; variant = "nist_clock_master"; }) //
|
||||
(build { target = "zc706"; variant = "nist_clock_master_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "nist_clock_satellite"; }) //
|
||||
(build { target = "zc706"; variant = "nist_clock_satellite_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "nist_qc2"; }) //
|
||||
(build { target = "zc706"; variant = "nist_qc2_master"; }) //
|
||||
(build { target = "zc706"; variant = "nist_qc2_master_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "nist_qc2_satellite"; }) //
|
||||
(build { target = "zc706"; variant = "nist_qc2_satellite_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_clock"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_clock_master"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_clock_master_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_clock_satellite"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_clock_satellite_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_qc2"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_qc2_master"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_qc2_master_100mhz"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_qc2_satellite"; }) //
|
||||
(build { target = "zc706"; variant = "acpki_nist_qc2_satellite_100mhz"; }) //
|
||||
(build { target = "kasli_soc"; variant = "demo"; json = ./demo.json; }) //
|
||||
|
|
|
@ -61,13 +61,14 @@ class SMAClkinForward(Module):
|
|||
]
|
||||
|
||||
|
||||
class GTP125BootstrapClock(Module):
|
||||
def __init__(self, platform):
|
||||
class GTPBootstrapClock(Module):
|
||||
def __init__(self, platform, freq=125e6):
|
||||
self.clock_domains.cd_bootstrap = ClockDomain(reset_less=True)
|
||||
self.cd_bootstrap.clk.attr.add("keep")
|
||||
|
||||
bootstrap_125 = platform.request("clk125_gtp")
|
||||
bootstrap_se = Signal()
|
||||
clk_out = Signal()
|
||||
platform.add_period_constraint(bootstrap_125.p, 8.0)
|
||||
self.specials += [
|
||||
Instance("IBUFDS_GTE2",
|
||||
|
@ -77,8 +78,30 @@ class GTP125BootstrapClock(Module):
|
|||
p_CLKCM_CFG="TRUE",
|
||||
p_CLKRCV_TRST="TRUE",
|
||||
p_CLKSWING_CFG=3),
|
||||
Instance("BUFG", i_I=bootstrap_se, o_O=self.cd_bootstrap.clk)
|
||||
Instance("BUFG", i_I=bootstrap_se, o_O=clk_out)
|
||||
]
|
||||
if freq == 125e6:
|
||||
self.comb += self.cd_bootstrap.clk.eq(clk_out)
|
||||
elif freq == 100e6:
|
||||
pll_fb = Signal()
|
||||
pll_out = Signal()
|
||||
self.specials += [
|
||||
Instance("PLLE2_BASE",
|
||||
p_CLKIN1_PERIOD=8.0,
|
||||
i_CLKIN1=clk_out,
|
||||
i_CLKFBIN=pll_fb,
|
||||
o_CLKFBOUT=pll_fb,
|
||||
|
||||
# VCO @ 1GHz
|
||||
p_CLKFBOUT_MULT=8, p_DIVCLK_DIVIDE=1,
|
||||
|
||||
# 100MHz for bootstrap
|
||||
p_CLKOUT1_DIVIDE=10, p_CLKOUT1_PHASE=0.0, o_CLKOUT1=pll_out,
|
||||
),
|
||||
Instance("BUFG", i_I=pll_out, o_O=self.cd_bootstrap.clk)
|
||||
]
|
||||
else:
|
||||
raise ValueError("Bootstrap frequency must be 100 or 125MHz")
|
||||
|
||||
|
||||
class GenericStandalone(SoCCore):
|
||||
|
@ -95,6 +118,7 @@ class GenericStandalone(SoCCore):
|
|||
SoCCore.__init__(self, platform=platform, csr_data_width=32, ident=ident, ps_cd_sys=False)
|
||||
|
||||
self.config["HW_REV"] = description["hw_rev"]
|
||||
|
||||
|
||||
self.submodules += SMAClkinForward(self.platform)
|
||||
|
||||
|
@ -109,8 +133,7 @@ class GenericStandalone(SoCCore):
|
|||
p_DIFF_TERM="TRUE", p_IBUF_LOW_PWR="FALSE",
|
||||
i_I=clk_synth.p, i_IB=clk_synth.n, o_O=clk_synth_se)
|
||||
fix_serdes_timing_path(platform)
|
||||
self.submodules.bootstrap = GTP125BootstrapClock(self.platform)
|
||||
|
||||
self.submodules.bootstrap = GTPBootstrapClock(self.platform, description["rtio_frequency"])
|
||||
|
||||
self.submodules.sys_crg = zynq_clocking.SYSCRG(self.platform, self.ps7, clk_synth_se)
|
||||
platform.add_false_path_constraints(
|
||||
|
@ -134,7 +157,9 @@ class GenericStandalone(SoCCore):
|
|||
self.rtio_channels.append(rtio.LogChannel())
|
||||
|
||||
self.submodules.rtio_tsc = rtio.TSC(glbl_fine_ts_width=3)
|
||||
self.submodules.rtio_core = rtio.Core(self.rtio_tsc, self.rtio_channels)
|
||||
self.submodules.rtio_core = rtio.Core(
|
||||
self.rtio_tsc, self.rtio_channels, lane_count=description["sed_lanes"]
|
||||
)
|
||||
self.csr_devices.append("rtio_core")
|
||||
|
||||
if self.acpki:
|
||||
|
@ -203,7 +228,7 @@ class GenericMaster(SoCCore):
|
|||
gtx0 = self.gt_drtio.gtxs[0]
|
||||
self.specials += Instance("BUFG", i_I=gtx0.txoutclk, o_O=txout_buf)
|
||||
|
||||
self.submodules.bootstrap = GTP125BootstrapClock(self.platform)
|
||||
self.submodules.bootstrap = GTPBootstrapClock(self.platform, clk_freq)
|
||||
self.submodules.sys_crg = zynq_clocking.SYSCRG(
|
||||
self.platform,
|
||||
self.ps7,
|
||||
|
@ -268,7 +293,9 @@ class GenericMaster(SoCCore):
|
|||
self.add_csr_group("drtioaux", drtioaux_csr_group)
|
||||
self.add_memory_group("drtioaux_mem", drtioaux_memory_group)
|
||||
|
||||
self.submodules.rtio_core = rtio.Core(self.rtio_tsc, self.rtio_channels)
|
||||
self.submodules.rtio_core = rtio.Core(
|
||||
self.rtio_tsc, self.rtio_channels, lane_count=description["sed_lanes"]
|
||||
)
|
||||
self.csr_devices.append("rtio_core")
|
||||
|
||||
if self.acpki:
|
||||
|
@ -344,7 +371,7 @@ class GenericSatellite(SoCCore):
|
|||
gtx0 = self.gt_drtio.gtxs[0]
|
||||
self.specials += Instance("BUFG", i_I=gtx0.txoutclk, o_O=txout_buf)
|
||||
|
||||
self.submodules.bootstrap = GTP125BootstrapClock(self.platform)
|
||||
self.submodules.bootstrap = GTPBootstrapClock(self.platform, clk_freq)
|
||||
self.submodules.sys_crg = zynq_clocking.SYSCRG(
|
||||
self.platform,
|
||||
self.ps7,
|
||||
|
@ -437,7 +464,9 @@ class GenericSatellite(SoCCore):
|
|||
self.submodules.rtio_dma = dma.DMA(self.ps7.s_axi_hp0)
|
||||
self.csr_devices.append("rtio_dma")
|
||||
|
||||
self.submodules.local_io = SyncRTIO(self.rtio_tsc, self.rtio_channels)
|
||||
self.submodules.local_io = SyncRTIO(
|
||||
self.rtio_tsc, self.rtio_channels, lane_count=description["sed_lanes"]
|
||||
)
|
||||
self.comb += self.drtiosat.async_errors.eq(self.local_io.async_errors)
|
||||
|
||||
self.submodules.cri_con = rtio.CRIInterconnectShared(
|
||||
|
|
|
@ -187,6 +187,22 @@ async fn handle_run_kernel(
|
|||
) -> Result<()> {
|
||||
control.borrow_mut().tx.async_send(kernel::Message::StartRequest).await;
|
||||
loop {
|
||||
#[cfg(has_drtio)]
|
||||
while let Some(subkernel_finished) =
|
||||
subkernel::get_finished_with_exception(aux_mutex, routing_table, timer).await?
|
||||
{
|
||||
if subkernel_finished.status == subkernel::FinishStatus::CommLost {
|
||||
error!(
|
||||
"Communication with satellite lost while subkernel {} was running",
|
||||
subkernel_finished.id
|
||||
);
|
||||
}
|
||||
if let Some(exception) = subkernel_finished.exception {
|
||||
if let Some(stream) = stream {
|
||||
write_chunk(stream, &exception).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
let reply = control.borrow_mut().rx.async_recv().await;
|
||||
match reply {
|
||||
kernel::Message::RpcSend { is_async, data } => {
|
||||
|
|
|
@ -75,7 +75,7 @@ fn init_rtio(timer: &mut GlobalTimer) {
|
|||
}
|
||||
// if it's not locked, it will hang at the CSR.
|
||||
|
||||
timer.delay_ms(20); // wait for CPLL/QPLL/SYS PLL lock
|
||||
timer.delay_ms(50); // wait for CPLL/QPLL/SYS PLL lock
|
||||
let clk = unsafe { pl::csr::sys_crg::current_clock_read() };
|
||||
if clk == 1 {
|
||||
info!("SYS CLK switched successfully");
|
||||
|
@ -94,7 +94,7 @@ fn init_drtio(timer: &mut GlobalTimer) {
|
|||
pl::csr::gt_drtio::stable_clkin_write(1);
|
||||
}
|
||||
|
||||
timer.delay_ms(20); // wait for CPLL/QPLL/SYS PLL lock
|
||||
timer.delay_ms(50); // wait for CPLL/QPLL/SYS PLL lock
|
||||
let clk = unsafe { pl::csr::sys_crg::current_clock_read() };
|
||||
if clk == 1 {
|
||||
info!("SYS CLK switched successfully");
|
||||
|
@ -263,7 +263,10 @@ pub fn init(timer: &mut GlobalTimer, cfg: &Config) {
|
|||
{
|
||||
let i2c = unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() };
|
||||
match clk {
|
||||
RtioClock::Ext0_Bypass => si5324::bypass(i2c, SI5324_EXT_INPUT, timer).expect("cannot bypass Si5324"),
|
||||
RtioClock::Ext0_Bypass => {
|
||||
info!("bypassing the PLL for RTIO clock");
|
||||
si5324::bypass(i2c, SI5324_EXT_INPUT, timer).expect("cannot bypass Si5324")
|
||||
}
|
||||
_ => setup_si5324(i2c, timer, clk),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue