summaryrefslogtreecommitdiffstats
path: root/tester/covoar/TraceList.h
blob: dc4d369ed4adfffd5c08bf2fe922c1f39a8b79af (plain) (blame)
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
/*! @file TraceList.h
 *  @brief TraceList Specification
 *
 *  This file contains the specification of the TraceList class.
 */

#ifndef __TRACE_LIST_H__
#define __TRACE_LIST_H__

#include <stdint.h>
#include <list>
#include <string>

namespace Trace {

  /*! @class TraceList
   *
   *  This class defines XXX
   */
  class TraceList {

  public:

    /*!
     *  This enumberated type defines an exit reason
     *  for the end of a section.
     */
    typedef enum {
      EXIT_REASON_BRANCH_TAKEN,
      EXIT_REASON_BRANCH_NOT_TAKEN,
      EXIT_REASON_OTHER
    } exitReason_t;

    /*!
     *  This type defines the information kept for each range.
     */
    typedef struct {
      /*!
       *  This member variable contains the low address for the
       *  trace range.
       */
      uint32_t          lowAddress;

      /*!
       *  This member variable contains the length of the trace
       *  range.
       */
      uint16_t          length;

      /*!
       *  This member variable contains the reason that this
       *  trace range ended.
       */
      exitReason_t      exitReason;
    } traceRange_t;

    /*!
     *  This member variable contains a list of CoverageRange instances.
     */
    typedef std::list<traceRange_t> ranges_t;

    /*!
     *  This member variable contains a list of coverageRange
     *  instaces.
     */
    ranges_t set;

    /*!
     *  This method constructs a TraceList instance.
     */
    TraceList();

    /*!
     *  This method destructs a TraceList instance.
     */
    ~TraceList();

    /*!
     *  This method adds a range entry to the set of ranges.
     *
     *  @param[in] lowAddressArg specifies the lowest address of the range
     *  @param[in] highAddressArg specifies the highest address of the range
     *  @param[in] why specifies the reason that the range was finished
     *
     */
    void add(
      uint32_t         lowAddressArg,
      uint32_t         highAddressArg,
      exitReason_t     why
    );

    /*!
     *  This method displays the trace information in the variable t.
     */
    void ShowTrace( traceRange_t *t);


    /*!
     *  This method iterates through set displaying the data on the screen.
     */
    void ShowList();

  };

}
#endif