-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimerWrapper.v
More file actions
44 lines (37 loc) · 973 Bytes
/
timerWrapper.v
File metadata and controls
44 lines (37 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// timerWrapper.v
module timerWrapper(
PCLK,
PENABLE,
PSEL,
PRESETN,
PWRITE,
PREADY,
PSLVERR,
PADDR,
PWDATA,
PRDATA,
TIMEINT,
SWITCH
);
// APB Bus Interface
input PCLK,PENABLE, PSEL, PRESETN, PWRITE, SWITCH;
input [31:0] PWDATA;
input [7:0] PADDR;
output [31:0] PRDATA;
output PREADY, PSLVERR;
output TIMEINT;
assign BUS_WRITE_EN = (PENABLE && PWRITE && PSEL);
assign BUS_READ_EN = (!PWRITE && PSEL); //Data is ready during first cycle to make it availble on the bus when PENABLE is asserted
assign PREADY = 1'b1;
assign PSLVERR = 1'b0;
timer timer_0( .pclk(PCLK),
.nreset(PRESETN),
.bus_write_en(BUS_WRITE_EN),
.bus_read_en(BUS_READ_EN),
.bus_addr(PADDR),
.bus_write_data(PWDATA),
.bus_read_data(PRDATA),
.fabint(TIMEINT),
.switch(SWITCH)
);
endmodule