| 1 | // ========== Copyright Header Begin ========================================== |
| 2 | // |
| 3 | // OpenSPARC T2 Processor File: niu_ldgintr_utils.vr |
| 4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 6 | // |
| 7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 8 | // |
| 9 | // This program is free software; you can redistribute it and/or modify |
| 10 | // it under the terms of the GNU General Public License as published by |
| 11 | // the Free Software Foundation; version 2 of the License. |
| 12 | // |
| 13 | // This program is distributed in the hope that it will be useful, |
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | // GNU General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with this program; if not, write to the Free Software |
| 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | // |
| 22 | // For the avoidance of doubt, and except that if any non-GPL license |
| 23 | // choice is available it will apply instead, Sun elects to use only |
| 24 | // the General Public License version 2 (GPLv2) at this time for any |
| 25 | // software where a choice of GPL license versions is made |
| 26 | // available with the language indicating that GPLv2 or any later version |
| 27 | // may be used, or where a choice of which version of the GPL is applied is |
| 28 | // otherwise unspecified. |
| 29 | // |
| 30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 31 | // CA 95054 USA or visit www.sun.com if you need additional information or |
| 32 | // have any questions. |
| 33 | // |
| 34 | // ========== Copyright Header End ============================================ |
| 35 | #include <vera_defines.vrh> |
| 36 | #include "niu_int_dev.vrh" |
| 37 | #include "niu_int_ldg.vrh" |
| 38 | #include "niu_int_qmgr.vrh" |
| 39 | #include "niu_int_sidmgr.vrh" |
| 40 | #include "pio_driver.vrh" |
| 41 | |
| 42 | #define TIME {get_time(HI), get_time(LO)} |
| 43 | |
| 44 | |
| 45 | class CNiuLdgEx extends CNiuLdg { |
| 46 | task new (integer i) { |
| 47 | super.new(i); |
| 48 | } |
| 49 | task ldgIsr((integer blanket_int=0),(CniuGenIntrMsg IntrMsg=null) ); |
| 50 | task mask_intr(integer type); |
| 51 | task unmask_intr(integer type); |
| 52 | function bit[31:0] read_pending_bits(integer type, (integer compare=0)) ; |
| 53 | |
| 54 | } |
| 55 | task CNiuLdgEx::ldgIsr((integer blanket_int=0),(CniuGenIntrMsg IntrMsg=null) ){ |
| 56 | bit [31:0] pbits; |
| 57 | printf("CNiuLdgEx::ldgIsr Custom Start ISR!! Time - %d \n",TIME); |
| 58 | // Add tasks here |
| 59 | // mask |
| 60 | mask_intr(IntrMsg.int_message); |
| 61 | CheckIntrDev(blanket_int); |
| 62 | repeat(1000)@(posedge CLOCK); |
| 63 | // add tasks here |
| 64 | // read pending registers |
| 65 | pbits = read_pending_bits(IntrMsg.int_message,1); |
| 66 | printf("pbits - %x , TIME - %d \n",pbits,TIME); |
| 67 | unmask_intr(IntrMsg.int_message); |
| 68 | printf("CNiuLdgEx::ldgIsr Exiting ISR!! Time - %d \n",TIME); |
| 69 | // unmask |
| 70 | } |
| 71 | task CNiuLdgEx:: mask_intr(integer type){ |
| 72 | integer func; |
| 73 | integer row,mask; |
| 74 | |
| 75 | func = sid[6:5]; |
| 76 | |
| 77 | } |
| 78 | task CNiuLdgEx:: unmask_intr(integer type){ |
| 79 | integer func; |
| 80 | integer row,mask; |
| 81 | func = sid[6:5]; |
| 82 | } |
| 83 | function bit[31:0] CNiuLdgEx:: read_pending_bits(integer type, (integer compare=0)) { |
| 84 | integer func; |
| 85 | bit[63:0] ldsv0,ldsv1,ldsv2; |
| 86 | bit [68:0] intr_dev_id_ldf0; |
| 87 | bit [68:0] intr_dev_id_ldf1; |
| 88 | bit [68:0] intr_dev_id; |
| 89 | |
| 90 | } |
| 91 | |
| 92 | |