Browse Source

„Timer.sv“ hinzufügen

master
Johannes Schmitt 10 months ago
parent
commit
2581373682
1 changed files with 41 additions and 0 deletions
  1. 41
    0
      Timer.sv

+ 41
- 0
Timer.sv View File

@@ -0,0 +1,41 @@
//------------------------------------------------------
//
// File : Timer.sv
// Related Files :
// Author(s) :
// Email :
// Organization : Georg-Simon-Ohm-Hochschule Nuernberg
// Notes :
//
//------------------------------------------------------
// History
//------------------------------------------------------
// Version| Author | Mod. Date | Changes Made:
// v1.00 | | 11.05.2023 |
//------------------------------------------------------
//eoh


module timer (bus_e bus); // (bus.timer b, clock_if.clock_port_top i)

integer counter = 0; // internal count reg
integer reload_val;

always @ (posedge bus.clk or bus.reset) begin // b.dip[0] <---- soll reset sein i.clk <-- busclk
if (!bus.reset) begin
counter <= 0;
bus.out_10s <= 0; // b.timer <--- out_10s
end else begin
if(counter <= 100) begin // zu testzwecken kürzer 1000000
counter++;
bus.out_10s <= 0;
end else begin
counter <= 0;
bus.out_10s <= 1;
end
end

end

endmodule : timer

Loading…
Cancel
Save