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

Subversion Repositories openrisc

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

Only display areas with differences | Details | Blame | View Log

Rev 63 Rev 462
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
 
 
// TAP DR-Scan action: definition
// TAP DR-Scan action: 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_DR_SCAN__H
#ifndef TAP_ACTION_DR_SCAN__H
#define TAP_ACTION_DR_SCAN__H
#define TAP_ACTION_DR_SCAN__H
 
 
#include <stdint.h>
#include <stdint.h>
 
 
#include "TapAction.h"
#include "TapAction.h"
#include "TapStateMachine.h"
#include "TapStateMachine.h"
 
 
 
 
//! Class to represent a TAP DR-Scan action.
//! Class to represent a TAP DR-Scan action.
 
 
//! JTAG data registers can be huge and are represented generically as arrays
//! JTAG data registers can be huge and are represented generically as arrays
//! of uint64_t. However for efficiency versions of methods are provided based
//! of uint64_t. However for efficiency versions of methods are provided based
//! on a single uint64_t.
//! on a single uint64_t.
 
 
//! The SystemC classes for large unsigned ints are fabulously inefficient in
//! The SystemC classes for large unsigned ints are fabulously inefficient in
//! the reference implementation, so are not used here.
//! the reference implementation, so are not used here.
 
 
class TapActionDRScan
class TapActionDRScan:public TapAction {
  : public TapAction
 
{
 
public:
public:
 
 
  // Constructors and destructor
        // Constructors and destructor
  TapActionDRScan (sc_core::sc_event *_doneEvent,
  TapActionDRScan (sc_core::sc_event *_doneEvent,
                   uint64_t           _dRegInArray[],
                        uint64_t _dRegInArray[], int _dRegSize);
                   int                _dRegSize);
 
  TapActionDRScan (sc_core::sc_event *_doneEvent,
  TapActionDRScan (sc_core::sc_event *_doneEvent,
                   uint64_t           _dRegIn,
                         uint64_t _dRegIn, int _dRegSize);
                   int                _dRegSize);
 
  TapActionDRScan (sc_core::sc_event *_doneEvent,
  TapActionDRScan (sc_core::sc_event *_doneEvent,
                   uint64_t           _dRegInArray[],
                         uint64_t _dRegInArray[],
                   int                _dRegSize,
                   int                _dRegSize,
                   int                _goToPauseState,
                         int _goToPauseState, int _bitsBeforePauseState);
                   int                _bitsBeforePauseState);
 
  TapActionDRScan (sc_core::sc_event *_doneEvent,
  TapActionDRScan (sc_core::sc_event *_doneEvent,
                   uint64_t           _dRegIn,
                         uint64_t _dRegIn,
                   int                _dRegSize,
                   int                _dRegSize,
                   int                _goToPauseState,
                         int _goToPauseState, int _bitsBeforePauseState);
                   int                _bitsBeforePauseState);
 
  ~TapActionDRScan ();
  ~TapActionDRScan ();
 
 
  // Get the shifted out value
        // Get the shifted out value
  void      getDRegOut (uint64_t  dRegArray[]);
        void getDRegOut(uint64_t dRegArray[]);
  uint64_t  getDRegOut ();
        uint64_t getDRegOut();
 
 
 
 
protected:
protected:
 
 
  // Process the action for IR-Scan
        // Process the action for IR-Scan
  bool  process (TapStateMachine *tapStateMachine,
  bool  process (TapStateMachine *tapStateMachine,
                 bool            &tdi,
                      bool & tdi, bool tdo, bool & tms);
                 bool             tdo,
 
                 bool            &tms);
 
 
 
 
 
private:
private:
 
 
  //! Number of bits in the data register
        //! Number of bits in the data register
  int  dRegBitSize;
        int dRegBitSize;
 
 
  //! Number of uint64_t words in the data register
        //! Number of uint64_t words in the data register
  int  dRegWordSize;
        int dRegWordSize;
 
 
  //! Mask for top word in multi-word register
        //! Mask for top word in multi-word register
  uint64_t  topMask;
        uint64_t topMask;
 
 
  //! The value being shifted in
        //! The value being shifted in
  uint64_t *dRegInArray;
        uint64_t *dRegInArray;
 
 
  //! The value being shifted in (small version optimization)
        //! The value being shifted in (small version optimization)
  uint64_t  dRegIn;
        uint64_t dRegIn;
 
 
  //! The value shifted out
        //! The value shifted out
  uint64_t *dRegOutArray;
        uint64_t *dRegOutArray;
 
 
  //! The value being shifted out (small version optimization)
        //! The value being shifted out (small version optimization)
  uint64_t  dRegOut;
        uint64_t dRegOut;
 
 
  //! Should we go to PAUSE state and poll tdo during operation?
        //! Should we go to PAUSE state and poll tdo during operation?
  int goToPauseState;
        int goToPauseState;
 
 
  //! Number of bits to shift before going to PAUSE state and polling tdo
        //! Number of bits to shift before going to PAUSE state and polling tdo
  int bitsBeforePause;
        int bitsBeforePause;
 
 
  int pauseStateCount;
        int pauseStateCount;
 
 
  //! Bits shifted so far
        //! Bits shifted so far
  int  bitsShifted;
        int bitsShifted;
 
 
  //! Where we are in the Shift-DR process
        //! Where we are in the Shift-DR process
  enum {
        enum {
    SHIFT_DR_PREPARING,
                SHIFT_DR_PREPARING,
    SHIFT_DR_SHIFTING,
                SHIFT_DR_SHIFTING,
    SHIFT_DR_SHIFTING_BEFORE_PAUSE,
                SHIFT_DR_SHIFTING_BEFORE_PAUSE,
    SHIFT_DR_SHIFTING_PAUSE,
                SHIFT_DR_SHIFTING_PAUSE,
    SHIFT_DR_EXIT2,
                SHIFT_DR_EXIT2,
    SHIFT_DR_SHIFTING_AFTER_PAUSE,
                SHIFT_DR_SHIFTING_AFTER_PAUSE,
    SHIFT_DR_UPDATING
                SHIFT_DR_UPDATING
  } dRScanState;
        } dRScanState;
 
 
  // Utilities to shift the bottom bit out and top bit in
        // Utilities to shift the bottom bit out and top bit in
  bool  shiftDRegOut ();
        bool shiftDRegOut();
  void  shiftDRegIn (bool  bitIn);
        void shiftDRegIn(bool bitIn);
 
 
};      // TapActionDRScan
};                              // TapActionDRScan
 
 
#endif  // TAP_ACTION_DR_SCAN__H
#endif // TAP_ACTION_DR_SCAN__H
 
 

powered by: WebSVN 2.1.0

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