-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathahb_interface.sv
59 lines (44 loc) · 1.25 KB
/
ahb_interface.sv
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
`ifndef ADDRESS_WIDTH
`define ADDRESS_WIDTH 32
`endif
`ifndef DATA_WIDTH
`define DATA_WIDTH 32
`endif
interface ahb_interface (input logic clock);
logic HRESETn;
logic [`ADDRESS_WIDTH-1:0] HADDR;
logic [1:0] HTRANS;
logic HWRITE;
logic [`DATA_WIDTH-1:0] HWDATA;
logic HSELAHB;
logic [`DATA_WIDTH-1:0] HRDATA;
logic HREADY;
logic HRESP;
//AHB Driver
clocking ahb_driver_cb @(posedge clock);
default input #1 output #1;
output HRESETn;
output HADDR;
output HTRANS;
output HWRITE;
output HWDATA;
output HSELAHB;
input HREADY;
endclocking
//AHB Monitor
clocking ahb_monitor_cb @(posedge clock);
default input #1 output #1;
input HRESETn;
input HADDR;
input HTRANS;
input HWRITE;
input HWDATA;
input HSELAHB;
input HRDATA;
input HREADY;
input HRESP;
endclocking
//MODPORTS
modport AHB_DRIVER (clocking ahb_driver_cb, input clock);
modport AHB_MONITOR (clocking ahb_monitor_cb, input clock);
endinterface