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

Subversion Repositories openrisc

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

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 63 Rev 462
Line 32... Line 32...
 
 
#include "TapAction.h"
#include "TapAction.h"
 
 
class  sc_event;
class  sc_event;
 
 
 
 
//! Constructor
//! Constructor
 
 
//! Records the SystemC event used to notify completion and sets the
//! Records the SystemC event used to notify completion and sets the
//! resetCounter to zero.
//! resetCounter to zero.
 
 
//! @param _actionType  The action type
//! @param _actionType  The action type
 
 
TapAction::TapAction (sc_core::sc_event *_doneEvent) :
TapAction::TapAction (sc_core::sc_event *_doneEvent) :
  doneEvent (_doneEvent),
doneEvent(_doneEvent), resetCounter(0)
  resetCounter (0)
 
{
{
 
 
}       // TapAction ()
}       // TapAction ()
 
 
 
 
//! Accessor to get the SystemC completion event
//! Accessor to get the SystemC completion event
 
 
//! @return  The SystemC completion event
//! @return  The SystemC completion event
 
 
sc_core::sc_event *
sc_core::sc_event * TapAction::getDoneEvent()
TapAction::getDoneEvent ()
 
{
{
  return  doneEvent;
  return  doneEvent;
 
 
}       // getDoneEvent ()
}       // getDoneEvent ()
 
 
 
 
//! Function to check the TAP is in a consistent state, optionally with a
//! Function to check the TAP is in a consistent state, optionally with a
//! warning.
//! warning.
 
 
//! This is a convenience for subclasses (hence protected), so they can ensure
//! This is a convenience for subclasses (hence protected), so they can ensure
//! the state machine is in a consistent state.
//! the state machine is in a consistent state.
Line 80... Line 75...
//! @param[in]  warn             True to indicate a warning message should be
//! @param[in]  warn             True to indicate a warning message should be
//!                              issued when starting a reset cycle.
//!                              issued when starting a reset cycle.
 
 
//! @return  TRUE if the TAP state machine was already in a consistent state.
//! @return  TRUE if the TAP state machine was already in a consistent state.
 
 
bool
bool TapAction::checkResetDone(TapStateMachine * tapStateMachine,
TapAction::checkResetDone (TapStateMachine *tapStateMachine,
                               bool & tms, bool warn)
                           bool            &tms,
 
                           bool             warn)
 
{
{
  // Nothing more to do if we are consistent
  // Nothing more to do if we are consistent
  if (tapStateMachine->getResetDone ())
        if (tapStateMachine->getResetDone()) {
    {
 
      return  true;
      return  true;
    }
    }
 
 
  // Need to reset. If requested and this is the first cycle of reset, give a
  // Need to reset. If requested and this is the first cycle of reset, give a
  // warning.
  // warning.
  if (warn && (0 == resetCounter))
        if (warn && (0 == resetCounter)) {
    {
                std::cerr << "JTAG TAP state inconsistent: resetting" <<
      std::cerr << "JTAG TAP state inconsistent: resetting" << std::endl;
                    std::endl;
    }
    }
 
 
  // Drive towards reset
  // Drive towards reset
  resetCounter++;
  resetCounter++;
  tms = 1;
  tms = 1;
 
 
  // If we have got to the end of the reset sequence we can clear the
  // If we have got to the end of the reset sequence we can clear the
  // tapStateMachine and report we are consistent. However we will not return
  // tapStateMachine and report we are consistent. However we will not return
  // true until the next call.
  // true until the next call.
  if (tapStateMachine->TAP_RESET_CYCLES == resetCounter)
        if (tapStateMachine->TAP_RESET_CYCLES == resetCounter) {
    {
 
      tapStateMachine->setResetDone (true);
      tapStateMachine->setResetDone (true);
      resetCounter = 0;                          // Ready for next time
      resetCounter = 0;                          // Ready for next time
    }
        } else {
  else
 
    {
 
      return false;
      return false;
    }
    }
}       // checkResetDone ()
}       // checkResetDone ()
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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