-
Notifications
You must be signed in to change notification settings - Fork 12
/
AHB_Master.v
70 lines (57 loc) · 1002 Bytes
/
AHB_Master.v
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
59
60
61
62
63
64
65
66
67
68
69
70
// AHB to APG Bridge | Maven Silicon
//
//
//
// AHB Master
// Date:14-06-2022
//
// By-Prajwal Kumar Sahu
module AHB_Master(Hclk,Hresetn,Hresp,Hrdata,Hwrite,Hreadyin,Hreadyout,Htrans,Hwdata,Haddr);
input Hclk,Hresetn,Hreadyout;
input [1:0]Hresp;
input [31:0] Hrdata;
output reg Hwrite,Hreadyin;
output reg [1:0] Htrans;
output reg [31:0] Hwdata,Haddr;
reg [2:0] Hburst;
reg [2:0] Hsize;
task single_write();
begin
@(posedge Hclk)
#2;
begin
Hwrite=1;
Htrans=2'b10;
Hsize=3'b000;
Hburst=3'b000;
Hreadyin=1;
Haddr=32'h8000_0001;
end
@(posedge Hclk)
#2;
begin
Htrans=2'b00;
Hwdata=8'hA3;
end
end
endtask
task single_read();
begin
@(posedge Hclk)
#2;
begin
Hwrite=0;
Htrans=2'b10;
Hsize=3'b000;
Hburst=3'b000;
Hreadyin=1;
Haddr=32'h8000_00A2;
end
@(posedge Hclk)
#2;
begin
Htrans=2'b00;
end
end
endtask
endmodule