Skip to content

Commit

Permalink
(fpga) Add transport cycle for the system reset signal
Browse files Browse the repository at this point in the history
       Add a register that samples the system reset signal sent from
       the tk1 core to the clk_pll core. This adds one cycle in
       transport latency.

Signed-off-by: Joachim Strömbergson <[email protected]>
  • Loading branch information
secworks committed Aug 20, 2024
1 parent 7636889 commit 74b194e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hw/application_fpga/rtl/clk_reset_gen.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ module clk_reset_gen #(parameter RESET_CYCLES = 200)
reg rst_n_reg = 1'h0;
reg rst_n_new;

reg sys_reset_reg;


//----------------------------------------------------------------
// Wires.
//----------------------------------------------------------------
wire hfosc_clk;
wire pll_clk;

Expand Down Expand Up @@ -95,7 +101,8 @@ module clk_reset_gen #(parameter RESET_CYCLES = 200)
//----------------------------------------------------------------
always @(posedge clk)
begin : reg_update
rst_n_reg <= rst_n_new;
rst_n_reg <= rst_n_new;
sys_reset_reg <= sys_reset;

if (rst_ctr_we)
rst_ctr_reg <= rst_ctr_new;
Expand All @@ -111,7 +118,7 @@ module clk_reset_gen #(parameter RESET_CYCLES = 200)
rst_ctr_new = 8'h0;
rst_ctr_we = 1'h0;

if (sys_reset) begin
if (sys_reset_reg) begin
rst_ctr_new = 8'h0;
rst_ctr_we = 1'h1;
end
Expand Down

0 comments on commit 74b194e

Please sign in to comment.