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

powered by: WebSVN 2.1.0

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