From c86bd938e7ff3debe1df09639e2479e02353ab17 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 7 Apr 2020 12:35:05 -0700 Subject: lib: Properly do reset routines in client_zero The current reset routines write a '1' twice for reset, instead of '0' then '1' (resets get triggered on a rising edge). --- host/lib/rfnoc/client_zero.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib/rfnoc/client_zero.cpp') diff --git a/host/lib/rfnoc/client_zero.cpp b/host/lib/rfnoc/client_zero.cpp index 81ac5830d..ce39569ba 100644 --- a/host/lib/rfnoc/client_zero.cpp +++ b/host/lib/rfnoc/client_zero.cpp @@ -183,18 +183,22 @@ void client_zero::reset_ctrl(uint16_t portno) { _check_port_number(portno); // The flush and reset registers are the second write register + // A reset gets triggered on the rising edge + regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, 0); regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, (1 << 1) /* 1st bit */); + // We wait the requested time (see the RFNoC spec) before returning std::this_thread::sleep_for(100us); - regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, (1 << 1)); } void client_zero::reset_chdr(uint16_t portno) { _check_port_number(portno); // The flush and reset registers are the second write register + // A reset gets triggered on the rising edge + regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, 0); regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, (1 << 2) /* 2nd bit */); + // We wait the requested time (see the RFNoC spec) before returning std::this_thread::sleep_for(1ms); - regs().poke32(_get_port_base_addr(portno) + FLUSH_RESET_ADDR, (1 << 2)); } client_zero::block_config_info client_zero::get_block_info(uint16_t portno) -- cgit v1.2.3