cbus_req_mon.v 884 Bytes
// 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