Line 26... |
Line 26... |
|
|
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
|
|
// $Id$
|
// $Id$
|
|
|
|
|
#ifndef TAP_ACTION__H
|
#ifndef TAP_ACTION__H
|
#define TAP_ACTION__H
|
#define TAP_ACTION__H
|
|
|
#include "TapStateMachine.h"
|
#include "TapStateMachine.h"
|
|
|
namespace sc_core
|
namespace sc_core {
|
{
|
|
class sc_event;
|
class sc_event;
|
}
|
}
|
|
|
|
|
//! Enumeration of all the TAP actions supported.
|
//! Enumeration of all the TAP actions supported.
|
|
|
enum TapActionType {
|
enum TapActionType {
|
TAP_ACTION_RESET = 0,
|
TAP_ACTION_RESET = 0,
|
TAP_ACTION_SHIFT_DR = 1,
|
TAP_ACTION_SHIFT_DR = 1,
|
TAP_ACTION_SHIFT_IR = 2
|
TAP_ACTION_SHIFT_IR = 2
|
};
|
};
|
|
|
|
|
//! Abstract class to represent a TAP action.
|
//! Abstract class to represent a TAP action.
|
|
|
//! Subclasses implement specific actions: Reset (TapActionReset::), DR-Scan
|
//! Subclasses implement specific actions: Reset (TapActionReset::), DR-Scan
|
//! (TapActionDRScan::) and IR-Scan (TapActionIRScan::).
|
//! (TapActionDRScan::) and IR-Scan (TapActionIRScan::).
|
|
|
//! We keep a SystemC event, which is used to notify the creator of
|
//! We keep a SystemC event, which is used to notify the creator of
|
//! completion. Since we are not a SystemC class, we don't do the notification
|
//! completion. Since we are not a SystemC class, we don't do the notification
|
//! ourselves.
|
//! ourselves.
|
|
|
class TapAction
|
class TapAction {
|
{
|
|
public:
|
public:
|
|
|
friend class JtagSC;
|
friend class JtagSC;
|
|
|
// Constructor
|
// Constructor
|
TapAction (sc_core::sc_event *_doneEvent);
|
TapAction (sc_core::sc_event *_doneEvent);
|
|
|
|
|
protected:
|
protected:
|
|
|
// Accessor for the SystemC event to notify completion
|
// Accessor for the SystemC event to notify completion
|
sc_core::sc_event *getDoneEvent ();
|
sc_core::sc_event *getDoneEvent ();
|
|
|
// Process the action. Pure virtual, so must be implemented by subclasses.
|
// Process the action. Pure virtual, so must be implemented by subclasses.
|
virtual bool process (TapStateMachine *tapStateMachine,
|
virtual bool process (TapStateMachine *tapStateMachine,
|
bool &tdi,
|
bool & tdi, bool tdo, bool & tms) = 0;
|
bool tdo,
|
|
bool &tms) = 0;
|
|
|
|
// Function to drive the TAP to a consistent state, optionally with a
|
// Function to drive the TAP to a consistent state, optionally with a
|
// warning.
|
// warning.
|
bool checkResetDone (TapStateMachine *tapStateMachine,
|
bool checkResetDone (TapStateMachine *tapStateMachine,
|
bool &tms,
|
bool & tms, bool warn = false);
|
bool warn = false);
|
|
|
|
|
|
private:
|
private:
|
|
|
//! The associated SystemC event to mark completion
|
//! The associated SystemC event to mark completion
|
sc_core::sc_event *doneEvent;
|
sc_core::sc_event *doneEvent;
|