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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 63 julius
// ----------------------------------------------------------------------------
2
 
3
// Main module providing the JTAG interface: 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 JTAG_SC__H
32
#define JTAG_SC__H
33
 
34
#include "systemc"
35
#include "TapAction.h"
36
 
37
 
38
//! Default size of the FIFO queuing TAP actions
39
#define DEFAULT_TAP_FIFO_SIZE  256
40
 
41
//! The main JTAG interface module
42
 
43
//! This provides a pin interface on one side (to drive JTAG ports on a chip)
44
//! and a FIFO on the other, allowing the user to queue JTAG actions.
45
 
46
//! The pin interface is:
47
//! - sysReset (input)  The system reset. When this is asserted, the interface
48
//!                     will do nothing except drive TRST low.
49
//! - tck (input)       The JTAG clock (supplied externally)
50
//! - tdi (output)      Drives the TDI pin
51
//! - tdo (input)       Receives the TDO pin
52
//! - tms (output)      Drives the TMS pin
53
//! - trst (output)     Drives the TRST pin
54
 
55
//! @note The JTAG pins are reversed, because this module is @b driving the
56
//!       pins.
57
 
58
//! The FIFO allows the user to queue actions, which are of abstract type
59
//! TapAction::. This is subclassed to provide specific actions for reset
60
//! (TapActionReset::), DR-scan (TapActionDRScan::) and IR-scan
61
//! (TapActionIRScan::).
62
 
63
//! The size of the FIFO can optionally be specified in the constructor.
64
 
65
//! The class provides a method, sensitive to the clock, which reads actions
66
//! from the FIFO and processes them, issuing the requisite sequence of
67
//! changes of the JTAG pins until the action is complete. It then notifies
68
//! the action owner of completion, through an sc_event, which is part of the
69
//! ::TapAction class.
70
//! 
71
class JtagSC
72
  : public sc_core::sc_module
73
{
74
public:
75
 
76
  // The ports. Note that the naming of the low level JTAG ports is reversed,
77
  // because we are driving the inputs! */
78
  sc_core::sc_in<bool>   sysReset;      //!< The system reset (active high)
79
 
80
  sc_core::sc_in<bool>   tck;           //!< External JTAG TCK
81
  sc_core::sc_out<bool>  tdi;           //!< JTAG TDI pin
82
  sc_core::sc_in<bool>   tdo;           //!< JTAG TDO pin
83
  sc_core::sc_out<bool>  tms;           //!< JTAG TMS pin
84
  sc_core::sc_out<bool>  trst;          //!< JTAG TRST pin
85
 
86
  //! JTAG action queue
87
  sc_core::sc_fifo<TapAction *> *tapActionQueue;
88
 
89
  // Constructor and destructor
90
  JtagSC (sc_core::sc_module_name  name,
91
          int                      fifo_size = DEFAULT_TAP_FIFO_SIZE);
92
  ~JtagSC ();
93
 
94
 
95
protected:
96
 
97
  // Method to process the actions
98
  void  processActions();
99
 
100
 
101
private:
102
 
103
  //! The TAP state machine
104
  TapStateMachine *stateMachine;
105
 
106
  //! The next TAP action
107
  TapAction *currentTapAction;
108
 
109
};      // JtagSC ()
110
 
111
#endif  // JTAG_SC__H

powered by: WebSVN 2.1.0

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