summaryrefslogtreecommitdiffstats
path: root/src/usr/pore/poreve/porevesrc/dbg.H
blob: cb085d729da0a1f1ae74c0203cd1379dcb1caa24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*  IBM_PROLOG_BEGIN_TAG
 *  This is an automatically generated prolog.
 *
 *  $Source: src/usr/pore/poreve/porevesrc/dbg.H $
 *
 *  IBM CONFIDENTIAL
 *
 *  COPYRIGHT International Business Machines Corp. 2012
 *
 *  p1
 *
 *  Object Code Only (OCO) source materials
 *  Licensed Internal Code Source Materials
 *  IBM HostBoot Licensed Internal Code
 *
 *  The source code for this program is not published or other-
 *  wise divested of its trade secrets, irrespective of what has
 *  been deposited with the U.S. Copyright Office.
 *
 *  Origin: 30
 *
 *  IBM_PROLOG_END_TAG
 */
#ifndef __VSBE_POREVEDBG_H
#define __VSBE_POREVEDBG_H

// $Id: dbg.H,v 1.2 2011/06/03 19:50:19 jeshua Exp $

/// \file dbg.H
/// \brief The PORE Virtual Environment - Debugged

#include "poreve.H"

namespace vsbe {
    class PoreVeDbg;
};


////////////////////////////////////////////////////////////////////////////
// PoreVeDbg
////////////////////////////////////////////////////////////////////////////

/// The PoreVe Debug configuration
///
/// This derivation from PoreVe supports the Tcl debug environment for
/// PoreVe. The constructor takes an extra argument which is a character
/// string containing the name of a script (file) to run when the debugger
/// starts. 

class
vsbe::PoreVeDbg : public vsbe::PoreVe {

public:

    ////////////////////////////// Creators //////////////////////////////

    /// Construct the PoreVeDbg
    ///
    /// \param[in] i_id The PORE IBUF_ID (engine type) of the Pore component.
    /// This will be PORE_SBE for host boot/SBE applications, and PORE_SLW for
    /// testing Sleep/Winkle applications. 
    ///
    /// \param[in] i_masterTarget  The fapi::Target associated with the master
    /// chip in an HBI master/slave configuration.  This target is also
    /// installed into \a iv_slaveTarget by the constructor.
    ///
    /// \param[in] i_arg A private argument for the created model.  In the
    /// case of this debugged model this is a character string naming a script
    /// to be run when the debugger starts.
    PoreVeDbg(const PoreIbufId i_id, 
              const fapi::Target i_masterTarget,
              const void* i_arg);

    virtual ~PoreVeDbg();


    ////////////////////  Simulation Interface    /////////////////////////

    /// See PoreModel::run()
    ///
    /// This API is provided as a convenience.  Currently the only model in
    /// the system that is 'clocked' is the PoreModel.
    virtual int
    run(const uint64_t i_instructions, uint64_t& o_ran);


    ////////////////////  Public Implementation ////////////////////////////

    /// PoreVeDbg is a singleton class, and this is the singleton instance.
    static PoreVeDbg* cv_instance;


    //////////////////// Protected Implementation //////////////////////////

protected:

    /// The argument passed at creation
    char* iv_arg;

    /// Used by the run() method.  
    ///
    /// The first time run() is called on the debug model the debugging
    /// environment is initialized and any script specified at creation is
    /// executed. 
    bool iv_initialized;

    
    ///////////////////////////// Safety //////////////////////////////////

private:
    PoreVeDbg(const PoreVeDbg& i_rhs);
    PoreVeDbg& operator=(const PoreVeDbg& i_rhs);
};

#endif  // __VSBE_POREVEDBG_H
OpenPOWER on IntegriCloud