From 546350ae4107db4116b35b5bd4a99c4988f3e89f Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 10 Oct 2021 23:19:39 -0700 Subject: [PATCH] [FPGA-Verilog] Revert back to the previous precomputing strategy for shift register clocks --- .../fpga_verilog/verilog_top_testbench_memory_bank.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openfpga/src/fpga_verilog/verilog_top_testbench_memory_bank.cpp b/openfpga/src/fpga_verilog/verilog_top_testbench_memory_bank.cpp index 883eb6c81..7f6076c21 100644 --- a/openfpga/src/fpga_verilog/verilog_top_testbench_memory_bank.cpp +++ b/openfpga/src/fpga_verilog/verilog_top_testbench_memory_bank.cpp @@ -416,11 +416,11 @@ int print_verilog_top_testbench_configuration_protocol_ql_memory_bank_stimulus(s /* Compute the auto-tuned clock period first, this is the lower bound of the shift register clock periods: * - the BL/WL shift register clock only works in the second half of the programming clock period - * - consider a 10% slack for clocks to avoid racing between programming clock and shift register clocks at edge + * - consider two additional clocks to avoid racing between programming clock and shift register clocks at edge * TODO: To figure out what is the min. slack required here. See something strange in HDL simulation */ - float bl_sr_clock_period = 0.25 * prog_clock_period / (fabric_bits_by_addr.bl_word_size() * 1.1) / timescale; - float wl_sr_clock_period = 0.25 * prog_clock_period / (fabric_bits_by_addr.wl_word_size() * 1.1) / timescale; + float bl_sr_clock_period = 0.25 * prog_clock_period / (fabric_bits_by_addr.bl_word_size() + 2) / timescale; + float wl_sr_clock_period = 0.25 * prog_clock_period / (fabric_bits_by_addr.wl_word_size() + 2) / timescale; VTR_LOG("Precomputed clock frequency (=%g %s) for %s.\n", 1. / (2. * bl_sr_clock_period * timescale) / 1e6, @@ -805,7 +805,7 @@ void print_verilog_full_testbench_ql_memory_bank_shift_register_bitstream(std::f fp << "if ("; fp << TOP_TB_BL_SHIFT_REGISTER_COUNT_PORT_NAME; fp << " >= "; - fp << "`" << TOP_TB_BITSTREAM_BL_WORD_SIZE_VARIABLE << " - 0"; + fp << "`" << TOP_TB_BITSTREAM_BL_WORD_SIZE_VARIABLE << " - 1"; fp << ") begin"; fp << std::endl; @@ -861,7 +861,7 @@ void print_verilog_full_testbench_ql_memory_bank_shift_register_bitstream(std::f fp << "if ("; fp << TOP_TB_WL_SHIFT_REGISTER_COUNT_PORT_NAME; fp << " >= "; - fp << "`" << TOP_TB_BITSTREAM_WL_WORD_SIZE_VARIABLE << " - 0"; + fp << "`" << TOP_TB_BITSTREAM_WL_WORD_SIZE_VARIABLE << " - 1"; fp << ") begin"; fp << std::endl;