Upon receiving an interrupt, the corresponding bit in the interrupt status register will be set and an IRQ will be raised for the CPU. The cpu can then respond to the interrupt and clear the interrupt by writing back to the interrupt status register.
17 lines
403 B
Systemverilog
17 lines
403 B
Systemverilog
module addr_decode(
|
|
input logic [15:0] addr,
|
|
output logic ram_cs,
|
|
output logic rom_cs,
|
|
output logic hex_cs,
|
|
output logic uart_cs,
|
|
output logic irq_cs
|
|
);
|
|
|
|
assign rom_cs = addr[15];
|
|
assign ram_cs = ~addr[15] && addr < 16'h7ff0;
|
|
assign hex_cs = addr >= 16'h7ff0 && addr < 16'h7ff4;
|
|
assign uart_cs = addr >= 16'h7ff4 && addr < 16'h7ff6;
|
|
assign irq_cs = addr == 16'h7fff;
|
|
|
|
endmodule
|