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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [src/] [TapActionReset.cpp] - 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 reset action : implementation
// TAP reset action : implementation
 
 
// 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$
 
 
 
 
#include "TapActionReset.h"
#include "TapActionReset.h"
 
 
 
 
//! Constructor
//! Constructor
 
 
//! Records the SystemC completion event with the parent. Sets the ::firstTime
//! Records the SystemC completion event with the parent. Sets the ::firstTime
//! flag, so the ::process () method will mark the tapStateMachine as not
//! flag, so the ::process () method will mark the tapStateMachine as not
//! reset.
//! reset.
 
 
//! @param[in] _doneEvent  The SystemC completion event
//! @param[in] _doneEvent  The SystemC completion event
 
 
TapActionReset::TapActionReset (sc_core::sc_event *_doneEvent) :
TapActionReset::TapActionReset (sc_core::sc_event *_doneEvent) :
  TapAction (_doneEvent),
TapAction(_doneEvent), firstTime(true)
  firstTime (true)
 
{
{
 
 
}       // TapActionReset ()
}                               // TapActionReset ()
 
 
 
 
//! Process the reset action
//! Process the reset action
 
 
//! This reuses the parent class ::checkResetDone() method. The first time we
//! This reuses the parent class ::checkResetDone() method. The first time we
//! are called, we mark the state machine as being in an inconsistent state,
//! are called, we mark the state machine as being in an inconsistent state,
//! to force the reset.
//! to force the reset.
 
 
//! We use the value of the TAP state machine's resetDone flag to trigger
//! We use the value of the TAP state machine's resetDone flag to trigger
//! completion, since this is set on the final reset cycle. The result from
//! completion, since this is set on the final reset cycle. The result from
//! ::checkResetDone () is only true on the first cycle AFTER reset.
//! ::checkResetDone () is only true on the first cycle AFTER reset.
 
 
//! @see TapAction::
//! @see TapAction::
 
 
//! @param[in]  tapStateMachine  The TAP state machine with which this action
//! @param[in]  tapStateMachine  The TAP state machine with which this action
//!                              is associated. 
//!                              is associated. 
//! @param[out] tdi              The value to drive on TDI
//! @param[out] tdi              The value to drive on TDI
//! @param[in]  tdo              The value currently on TDO
//! @param[in]  tdo              The value currently on TDO
//! @param[out] tms              The value to drive on TMS
//! @param[out] tms              The value to drive on TMS
 
 
//! @return  True if the action is complete
//! @return  True if the action is complete
 
 
bool
bool TapActionReset::process(TapStateMachine * tapStateMachine,
TapActionReset::process (TapStateMachine *tapStateMachine,
                             bool & tdi, bool tdo, bool & tms)
                         bool            &tdi,
 
                         bool             tdo,
 
                         bool            &tms)
 
{
 
  if (firstTime)
 
    {
    {
 
        if (firstTime) {
      tapStateMachine->setResetDone (false);
      tapStateMachine->setResetDone (false);
      firstTime = false;
                firstTime = false;
    }
    }
 
 
  // Parent does the work (no warning message). Our result draws on the value
  // Parent does the work (no warning message). Our result draws on the value
  // set in the tapStateMachine, to avoid an extra cycle.
        // set in the tapStateMachine, to avoid an extra cycle.
  checkResetDone (tapStateMachine, tms, false);
        checkResetDone(tapStateMachine, tms, false);
 
 
  return tapStateMachine->getResetDone ();
        return tapStateMachine->getResetDone();
 
 
}       // process ()
}                               // process ()
 
 

powered by: WebSVN 2.1.0

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