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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [src/] [TapActionReset.cpp] - Blame information for rev 462

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 63 julius
// ----------------------------------------------------------------------------
2
 
3
// TAP reset action : implementation
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
#include "TapActionReset.h"
32
 
33
//! Constructor
34
 
35
//! Records the SystemC completion event with the parent. Sets the ::firstTime
36
//! flag, so the ::process () method will mark the tapStateMachine as not
37
//! reset.
38
 
39
//! @param[in] _doneEvent  The SystemC completion event
40
 
41 462 julius
TapActionReset::TapActionReset(sc_core::sc_event * _doneEvent):
42
TapAction(_doneEvent), firstTime(true)
43 63 julius
{
44
 
45 462 julius
}                               // TapActionReset ()
46 63 julius
 
47
//! Process the reset action
48
 
49
//! This reuses the parent class ::checkResetDone() method. The first time we
50
//! are called, we mark the state machine as being in an inconsistent state,
51
//! to force the reset.
52
 
53
//! We use the value of the TAP state machine's resetDone flag to trigger
54
//! completion, since this is set on the final reset cycle. The result from
55
//! ::checkResetDone () is only true on the first cycle AFTER reset.
56
 
57
//! @see TapAction::
58
 
59
//! @param[in]  tapStateMachine  The TAP state machine with which this action
60
//!                              is associated. 
61
//! @param[out] tdi              The value to drive on TDI
62
//! @param[in]  tdo              The value currently on TDO
63
//! @param[out] tms              The value to drive on TMS
64
 
65
//! @return  True if the action is complete
66
 
67 462 julius
bool TapActionReset::process(TapStateMachine * tapStateMachine,
68
                             bool & tdi, bool tdo, bool & tms)
69 63 julius
{
70 462 julius
        if (firstTime) {
71
                tapStateMachine->setResetDone(false);
72
                firstTime = false;
73
        }
74
        // Parent does the work (no warning message). Our result draws on the value
75
        // set in the tapStateMachine, to avoid an extra cycle.
76
        checkResetDone(tapStateMachine, tms, false);
77 63 julius
 
78 462 julius
        return tapStateMachine->getResetDone();
79 63 julius
 
80 462 julius
}                               // process ()

powered by: WebSVN 2.1.0

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