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

Subversion Repositories openrisc

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

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
#ifndef TAP_ACTION_DR_SCAN__H
32
#define TAP_ACTION_DR_SCAN__H
33
 
34
#include <stdint.h>
35
 
36
#include "TapAction.h"
37
#include "TapStateMachine.h"
38
 
39
//! Class to represent a TAP DR-Scan action.
40
 
41
//! JTAG data registers can be huge and are represented generically as arrays
42
//! of uint64_t. However for efficiency versions of methods are provided based
43
//! on a single uint64_t.
44
 
45
//! The SystemC classes for large unsigned ints are fabulously inefficient in
46
//! the reference implementation, so are not used here.
47
 
48 462 julius
class TapActionDRScan:public TapAction {
49 63 julius
public:
50
 
51 462 julius
        // Constructors and destructor
52
        TapActionDRScan(sc_core::sc_event * _doneEvent,
53
                        uint64_t _dRegInArray[], int _dRegSize);
54
         TapActionDRScan(sc_core::sc_event * _doneEvent,
55
                         uint64_t _dRegIn, int _dRegSize);
56
         TapActionDRScan(sc_core::sc_event * _doneEvent,
57
                         uint64_t _dRegInArray[],
58
                         int _dRegSize,
59
                         int _goToPauseState, int _bitsBeforePauseState);
60
         TapActionDRScan(sc_core::sc_event * _doneEvent,
61
                         uint64_t _dRegIn,
62
                         int _dRegSize,
63
                         int _goToPauseState, int _bitsBeforePauseState);
64
        ~TapActionDRScan();
65 63 julius
 
66 462 julius
        // Get the shifted out value
67
        void getDRegOut(uint64_t dRegArray[]);
68
        uint64_t getDRegOut();
69 63 julius
 
70
protected:
71
 
72 462 julius
        // Process the action for IR-Scan
73
         bool process(TapStateMachine * tapStateMachine,
74
                      bool & tdi, bool tdo, bool & tms);
75 63 julius
 
76
private:
77
 
78 462 julius
        //! Number of bits in the data register
79
        int dRegBitSize;
80 63 julius
 
81 462 julius
        //! Number of uint64_t words in the data register
82
        int dRegWordSize;
83 63 julius
 
84 462 julius
        //! Mask for top word in multi-word register
85
        uint64_t topMask;
86 63 julius
 
87 462 julius
        //! The value being shifted in
88
        uint64_t *dRegInArray;
89 63 julius
 
90 462 julius
        //! The value being shifted in (small version optimization)
91
        uint64_t dRegIn;
92 63 julius
 
93 462 julius
        //! The value shifted out
94
        uint64_t *dRegOutArray;
95 63 julius
 
96 462 julius
        //! The value being shifted out (small version optimization)
97
        uint64_t dRegOut;
98 63 julius
 
99 462 julius
        //! Should we go to PAUSE state and poll tdo during operation?
100
        int goToPauseState;
101 63 julius
 
102 462 julius
        //! Number of bits to shift before going to PAUSE state and polling tdo
103
        int bitsBeforePause;
104 63 julius
 
105 462 julius
        int pauseStateCount;
106 63 julius
 
107 462 julius
        //! Bits shifted so far
108
        int bitsShifted;
109 63 julius
 
110 462 julius
        //! Where we are in the Shift-DR process
111
        enum {
112
                SHIFT_DR_PREPARING,
113
                SHIFT_DR_SHIFTING,
114
                SHIFT_DR_SHIFTING_BEFORE_PAUSE,
115
                SHIFT_DR_SHIFTING_PAUSE,
116
                SHIFT_DR_EXIT2,
117
                SHIFT_DR_SHIFTING_AFTER_PAUSE,
118
                SHIFT_DR_UPDATING
119
        } dRScanState;
120 63 julius
 
121 462 julius
        // Utilities to shift the bottom bit out and top bit in
122
        bool shiftDRegOut();
123
        void shiftDRegIn(bool bitIn);
124 63 julius
 
125 462 julius
};                              // TapActionDRScan
126 63 julius
 
127 462 julius
#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.