Advertisement
AlexanderAntonov

Untitled

Nov 1st, 2022
808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module reset_sync
  2. #(
  3.     parameter SYNC_STAGES = 4
  4. )
  5. (
  6.     input clk_i, arst_i,
  7.     output srst_o
  8. );
  9.  
  10. reg [SYNC_STAGES-1:0] reset_syncbuf;
  11. assign srst_o = reset_syncbuf[0];
  12.  
  13. always @(posedge clk_i, posedge arst_i)
  14.     begin
  15.     if (arst_i) reset_syncbuf <= {SYNC_STAGES{1'b1}};
  16.     else reset_syncbuf <= {1'b0, reset_syncbuf[SYNC_STAGES-1:1]};
  17.     end
  18.  
  19. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement