* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: SS_IrqSync.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
SS_IrqSync( SS_Strand
* s
);
// raise() is called by the DUT to cause the simulator to take the indicated
// trap at the next step().
void raise( SS_Trap::Type irq_type
);
// check() is called by the simulator just before it steps an instruction.
// It will launch the highest priority trap that has seen store() followed by
// raise() if a trap is pending. If a trap is pending for too long (timed out)
// it will be removed and an error is printed. check() returns true if in trap
// was launched, false otherwise.
IrqInfo( SS_Trap::Type _irq_type
, uint_t _priority
, uint64_t _time_out
, IrqInfo
* _next
=0 )
uint64_t time_out
; // Timeout happens when > cur_time, but is not precise!! Who cares?!
SS_Strand
* strand
; // The strand associat6ed with this IrqSync
uint64_t cur_time
; // The current time
IrqInfo
* head
; // The head of priority ordered pending traps (interrupts)
// store() is called by the simulator to store a trap that has to be taken
// after the device under test (DUT) calls raise(). The do_time_out flag
// is used to force taking the trap at the next check() call.
static void store( void* irq_sync
, SS_Trap::Type irq_type
, bool do_time_out
);