You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
604 B

2 years ago
2 years ago
2 years ago
  1. module zutils_debug_led #(
  2. parameter PERIOD_COUNT = 1000000
  3. ) (
  4. input clk, //clock input
  5. input rst_n, //asynchronous reset input, low active
  6. output reg debug_led
  7. );
  8. reg [31:0] counter = 0;
  9. always @(posedge clk or negedge rst_n) begin
  10. if (!rst_n) begin
  11. counter <= 0;
  12. debug_led <= 1'b0;
  13. end else begin
  14. if (counter == PERIOD_COUNT - 1) begin
  15. counter <= 0;
  16. debug_led <= ~debug_led;
  17. end else begin
  18. counter <= counter + 1;
  19. end
  20. end
  21. end
  22. endmodule