URL
https://opencores.org/ocsvn/a-z80/a-z80/trunk
Subversion Repositories a-z80
[/] [a-z80/] [trunk/] [cpu/] [toplevel/] [tb_iorq.sv] - Rev 15
Go to most recent revision | Compare with Previous | Blame | View Log
//--------------------------------------------------------------
// Interrupt test for simulation
// This model injects an interrupt opcode on the bus
//--------------------------------------------------------------
module iorq (Data, M1, IORQ);
// Set to 1 if you want debug printout on each IO access
int debug = 0;
inout [7:0] Data;
input M1, IORQ;
// Define the opcode to be sent through IORQ (FF=RST38, C7=RST0,...)
// To test interrupts in mode 0, uncommend one of these lines (pushed opcode):
//`define OPCODE 8'hFF
//`define OPCODE 8'hC7
// To test interrupts in mode 2, uncommend this line (this is a vector):
`define OPCODE 8'h80
// Return data on an IORQ condition
assign Data = (!M1 && !IORQ) ? `OPCODE : {8{1'bz}};
int fd;
always @(!M1 && !IORQ) begin
if (debug)
$strobe("[IORQ] DB=%H", `OPCODE);
end
endmodule
Go to most recent revision | Compare with Previous | Blame | View Log