„Timer.sv“ hinzufügen
This commit is contained in:
parent
8f0a77d498
commit
2581373682
41
Timer.sv
Normal file
41
Timer.sv
Normal 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…
x
Reference in New Issue
Block a user