OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [TapAction.h] - Diff between revs 63 and 462

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 63 Rev 462
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
 
 
// TAP action header: abstract class definition
// TAP action header: abstract class definition
 
 
// Copyright (C) 2009  Embecosm Limited <info@embecosm.com>
// Copyright (C) 2009  Embecosm Limited <info@embecosm.com>
 
 
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
 
// This file is part of the Embecosm cycle accurate SystemC JTAG library.
// This file is part of the Embecosm cycle accurate SystemC JTAG library.
 
 
// This program is free software: you can redistribute it and/or modify it
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or (at your
// the Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
// option) any later version.
 
 
// This program is distributed in the hope that it will be useful, but WITHOUT
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License for more details.
// License for more details.
 
 
// You should have received a copy of the GNU Lesser General Public License
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
// The C/C++ parts of this program are commented throughout in a fashion
// The C/C++ parts of this program are commented throughout in a fashion
// suitable for processing with Doxygen.
// suitable for processing with Doxygen.
 
 
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
 
 
// $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;
 
 
  //! Counter for the reset process
        //! Counter for the reset process
  int  resetCounter;
        int resetCounter;
 
 
};      // TapAction ()
};                              // TapAction ()
 
 
#endif  // TAP_ACTION__H
#endif // TAP_ACTION__H
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.