Rev 576 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 668 | lvd | 1 | // ZX-Evo Base Configuration (c) NedoPC 2008,2009,2010,2011,2012,2013,2014 |
| 576 | lvd | 2 | // |
| 3 | // break function: when CPU M1 address equals to predefined, NMI is generated |
||
| 4 | |||
| 668 | lvd | 5 | /* |
| 6 | This file is part of ZX-Evo Base Configuration firmware. |
||
| 7 | |||
| 8 | ZX-Evo Base Configuration firmware is free software: |
||
| 9 | you can redistribute it and/or modify it under the terms of |
||
| 10 | the GNU General Public License as published by |
||
| 11 | the Free Software Foundation, either version 3 of the License, or |
||
| 12 | (at your option) any later version. |
||
| 13 | |||
| 14 | ZX-Evo Base Configuration firmware is distributed in the hope that |
||
| 15 | it will be useful, but WITHOUT ANY WARRANTY; without even |
||
| 16 | the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 17 | See the GNU General Public License for more details. |
||
| 18 | |||
| 19 | You should have received a copy of the GNU General Public License |
||
| 20 | along with ZX-Evo Base Configuration firmware. |
||
| 21 | If not, see <http://www.gnu.org/licenses/>. |
||
| 22 | */ |
||
| 23 | |||
| 576 | lvd | 24 | `include "../include/tune.v" |
| 25 | |||
| 26 | module zbreak |
||
| 27 | ( |
||
| 28 | input wire fclk, // global FPGA clock |
||
| 29 | input wire rst_n, // system reset |
||
| 30 | |||
| 31 | input wire zpos, |
||
| 32 | input wire zneg, |
||
| 33 | |||
| 34 | |||
| 35 | input wire [15:0] a, |
||
| 36 | |||
| 37 | input wire mreq_n, |
||
| 38 | input wire m1_n, |
||
| 39 | |||
| 40 | |||
| 41 | input wire brk_ena, |
||
| 42 | input wire [15:0] brk_addr, |
||
| 43 | |||
| 44 | |||
| 45 | output reg imm_nmi |
||
| 46 | ); |
||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | always @(posedge fclk, negedge rst_n) |
||
| 51 | if( !rst_n ) |
||
| 52 | imm_nmi <= 1'b0; |
||
| 53 | else if( zneg && !mreq_n && !m1_n && a==brk_addr && brk_ena && !imm_nmi ) |
||
| 54 | imm_nmi <= 1'b1; |
||
| 55 | else |
||
| 56 | imm_nmi <= 1'b0; |
||
| 57 | |||
| 58 | |||
| 59 | endmodule |
||
| 60 |