OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [toplevel/] [tb_iorq.sv] - Blame information for rev 4

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gdevic
//--------------------------------------------------------------
2
// Interrupt test for simulation
3
// This model injects an interrupt opcode on the bus
4
//--------------------------------------------------------------
5
module iorq (Data, M1, IORQ);
6
 
7
// Set to 1 if you want debug printout on each IO access
8
int debug = 0;
9
 
10
inout [7:0] Data;
11
input M1, IORQ;
12
 
13
// Define the opcode to be sent through IORQ (FF=RST38, C7=RST0,...)
14
 
15
// To test interrupts in mode 0, uncommend one of these lines (pushed opcode):
16
//`define OPCODE  8'hFF
17
//`define OPCODE  8'hC7
18
 
19
// To test interrupts in mode 2, uncommend this line (this is a vector):
20
`define OPCODE  8'h80
21
 
22
// Return data on an IORQ condition
23
assign Data = (!M1 && !IORQ) ? `OPCODE : {8{1'bz}};
24
 
25
int fd;
26
 
27
always @(!M1 && !IORQ) begin
28
    if (debug)
29
        $strobe("[IORQ] DB=%H", `OPCODE);
30
end
31
 
32
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.