pbus_mon.v
1.57 KB
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
module pbus_mon(ad16_aleh, ad16_alel, ad16_read, ad16_write, ad16_data);
`include "rcp.vh"
input ad16_aleh;
input ad16_alel;
input ad16_read;
input ad16_write;
input [AD16_DATA_SIZE-1:0] ad16_data;
reg [AD16_DATA_SIZE-1:0] address_high, address_low;
reg monitor_enable;
initial monitor_enable = $test$plusargs("pbus_mon");
always @(negedge ad16_aleh) begin
if (monitor_enable) begin
if (ad16_alel) begin
$display(`CLOCK_COUNT, " : pbus latch high address - %h",
ad16_data);
address_high = ad16_data;
end
end
end
always @(negedge ad16_alel) begin
if (monitor_enable) begin
if (!ad16_aleh) begin
$display(`CLOCK_COUNT, " : pbus latch low address - %h",
ad16_data);
address_low = ad16_data;
end
end
end
always @(posedge ad16_read) begin
if (monitor_enable) begin
if (!ad16_aleh && !ad16_alel) begin
$display(`CLOCK_COUNT, " : pbus read data - %h@%h",
ad16_data, {address_high, address_low});
{address_high, address_low} = {address_high, address_low} + 2;
end
end
end
always @(posedge ad16_write) begin
if (monitor_enable) begin
if (!ad16_aleh && !ad16_alel) begin
$display(`CLOCK_COUNT, " : pbus write data - %h@%h",
ad16_data, {address_high, address_low});
{address_high, address_low} = {address_high, address_low} + 2;
end
end
end
endmodule