OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [TapActionDRScan.h] - Blame information for rev 197

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 63 julius
// ----------------------------------------------------------------------------
2
 
3
// TAP DR-Scan action: definition
4
 
5
// Copyright (C) 2009  Embecosm Limited <info@embecosm.com>
6
 
7
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
8
 
9
// This file is part of the Embecosm cycle accurate SystemC JTAG library.
10
 
11
// This program is free software: you can redistribute it and/or modify it
12
// under the terms of the GNU Lesser General Public License as published by
13
// the Free Software Foundation, either version 3 of the License, or (at your
14
// option) any later version.
15
 
16
// This program is distributed in the hope that it will be useful, but WITHOUT
17
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
19
// License for more details.
20
 
21
// You should have received a copy of the GNU Lesser General Public License
22
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 
24
// The C/C++ parts of this program are commented throughout in a fashion
25
// suitable for processing with Doxygen.
26
 
27
// ----------------------------------------------------------------------------
28
 
29
// $Id$
30
 
31
 
32
#ifndef TAP_ACTION_DR_SCAN__H
33
#define TAP_ACTION_DR_SCAN__H
34
 
35
#include <stdint.h>
36
 
37
#include "TapAction.h"
38
#include "TapStateMachine.h"
39
 
40
 
41
//! Class to represent a TAP DR-Scan action.
42
 
43
//! JTAG data registers can be huge and are represented generically as arrays
44
//! of uint64_t. However for efficiency versions of methods are provided based
45
//! on a single uint64_t.
46
 
47
//! The SystemC classes for large unsigned ints are fabulously inefficient in
48
//! the reference implementation, so are not used here.
49
 
50
class TapActionDRScan
51
  : public TapAction
52
{
53
public:
54
 
55
  // Constructors and destructor
56
  TapActionDRScan (sc_core::sc_event *_doneEvent,
57
                   uint64_t           _dRegInArray[],
58
                   int                _dRegSize);
59
  TapActionDRScan (sc_core::sc_event *_doneEvent,
60
                   uint64_t           _dRegIn,
61
                   int                _dRegSize);
62
  TapActionDRScan (sc_core::sc_event *_doneEvent,
63
                   uint64_t           _dRegInArray[],
64
                   int                _dRegSize,
65
                   int                _goToPauseState,
66
                   int                _bitsBeforePauseState);
67
  TapActionDRScan (sc_core::sc_event *_doneEvent,
68
                   uint64_t           _dRegIn,
69
                   int                _dRegSize,
70
                   int                _goToPauseState,
71
                   int                _bitsBeforePauseState);
72
  ~TapActionDRScan ();
73
 
74
  // Get the shifted out value
75
  void      getDRegOut (uint64_t  dRegArray[]);
76
  uint64_t  getDRegOut ();
77
 
78
 
79
protected:
80
 
81
  // Process the action for IR-Scan
82
  bool  process (TapStateMachine *tapStateMachine,
83
                 bool            &tdi,
84
                 bool             tdo,
85
                 bool            &tms);
86
 
87
 
88
private:
89
 
90
  //! Number of bits in the data register
91
  int  dRegBitSize;
92
 
93
  //! Number of uint64_t words in the data register
94
  int  dRegWordSize;
95
 
96
  //! Mask for top word in multi-word register
97
  uint64_t  topMask;
98
 
99
  //! The value being shifted in
100
  uint64_t *dRegInArray;
101
 
102
  //! The value being shifted in (small version optimization)
103
  uint64_t  dRegIn;
104
 
105
  //! The value shifted out
106
  uint64_t *dRegOutArray;
107
 
108
  //! The value being shifted out (small version optimization)
109
  uint64_t  dRegOut;
110
 
111
  //! Should we go to PAUSE state and poll tdo during operation?
112
  int goToPauseState;
113
 
114
  //! Number of bits to shift before going to PAUSE state and polling tdo
115
  int bitsBeforePause;
116
 
117
  int pauseStateCount;
118
 
119
  //! Bits shifted so far
120
  int  bitsShifted;
121
 
122
  //! Where we are in the Shift-DR process
123
  enum {
124
    SHIFT_DR_PREPARING,
125
    SHIFT_DR_SHIFTING,
126
    SHIFT_DR_SHIFTING_BEFORE_PAUSE,
127
    SHIFT_DR_SHIFTING_PAUSE,
128
    SHIFT_DR_EXIT2,
129
    SHIFT_DR_SHIFTING_AFTER_PAUSE,
130
    SHIFT_DR_UPDATING
131
  } dRScanState;
132
 
133
  // Utilities to shift the bottom bit out and top bit in
134
  bool  shiftDRegOut ();
135
  void  shiftDRegIn (bool  bitIn);
136
 
137
};      // TapActionDRScan
138
 
139
#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.