cbus_req_mon.v
884 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
// cbus_req_mon.v v1 Frank Berndt;
// cbus request monitor;
// watches cbus requests per device;
// :set tabstop=4
module cbus_req_mon (
device, write_request, read_request, dma_request,
);
input [4*8-1:0] device;
input write_request;
input read_request;
input dma_request;
reg write_ok; // write requests ok;
reg read_ok; // read requests ok;
reg dma_ok; // dma requests ok;
initial
begin
write_ok = 1;
read_ok = 1;
dma_ok = 1;
end
always @(posedge write_request)
begin
if( !write_ok)
$display("ERROR: %t: %M: unexpected %0s cbus write request", $time, device);
end
always @(posedge read_request)
begin
if( !read_ok)
$display("ERROR: %t: %M: unexpected %0s cbus read request", $time, device);
end
always @(posedge dma_request)
begin
if( !dma_ok)
$display("ERROR: %t: %M: unexpected %0s dma request", $time, device);
end
endmodule