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.

Timer.sv 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //------------------------------------------------------
  2. //
  3. // File : Timer.sv
  4. // Related Files :
  5. // Author(s) :
  6. // Email :
  7. // Organization : Georg-Simon-Ohm-Hochschule Nuernberg
  8. // Notes :
  9. //
  10. //------------------------------------------------------
  11. // History
  12. //------------------------------------------------------
  13. // Version| Author | Mod. Date | Changes Made:
  14. // v1.00 | | 11.05.2023 |
  15. //------------------------------------------------------
  16. //eoh
  17. module timer (bus_e bus); // (bus.timer b, clock_if.clock_port_top i)
  18. integer counter = 0; // internal count reg
  19. integer reload_val;
  20. always @ (posedge bus.clk or bus.reset) begin // b.dip[0] <---- soll reset sein i.clk <-- busclk
  21. if (!bus.reset) begin
  22. counter <= 0;
  23. bus.out_10s <= 0; // b.timer <--- out_10s
  24. end else begin
  25. if(counter <= 100) begin // zu testzwecken kürzer 1000000
  26. counter++;
  27. bus.out_10s <= 0;
  28. end else begin
  29. counter <= 0;
  30. bus.out_10s <= 1;
  31. end
  32. end
  33. end
  34. endmodule : timer