OpenASIP 2.2
Loading...
Searching...
No Matches
DisasmTopCountAttrProvider.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file DisasmTopCountAttrProvider.hh
26 *
27 * Declaration DisasmTopCountAttrProvider class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_DISASM_TOP_COUNT_ATTR_PROVIDER_HH
34#define TTA_DISASM_TOP_COUNT_ATTR_PROVIDER_HH
35
36#include <set>
37#include <map>
38#include <wx/listctrl.h>
39#include <wx/minifram.h>
41#include "Listener.hh"
42#include "SimulatorConstants.hh"
43
44class wxGridCellAttr;
47
48/**
49 * Attribute provider for disassembly window grid.
50 *
51 * Highlights instructions with top execution counts with background colour.
52 */
54public:
56 TracedSimulatorFrontend& simulator, size_t topCounts);
58 virtual void update();
59 virtual wxGridCellAttr* moveCellAttr(
60 InstructionAddress address, int move);
61
62 typedef std::set<InstructionAddress> AddressSet;
63 typedef std::map<ClockCycleCount, AddressSet> ExecutionCountTable;
64private:
67 InstructionAddress address, ClockCycleCount execCount);
68
70 wxColour bgColour(ClockCycleCount execCount);
71
72 /// Top execution counts and set of instruction addresses with each count.
74 /// Simulator frontend used for accessing the instructions and exec counts.
76 /// Number of top execution counts in the top execution count list.
77 size_t topCounts_;
79};
80
81
82/**
83 * Simple list window for displaying list of top execution counts.
84 */
85class DisasmExecCountFrame : public wxMiniFrame {
86public:
88 wxWindow* parent, wxWindowID id,
90
91 virtual ~DisasmExecCountFrame();
92 void update();
94 unsigned execCount, unsigned start,
95 unsigned end, const wxColour& colour);
96
97private:
98 void onClose(wxCloseEvent& event);
99 void onSelection(wxListEvent& event);
100 wxListCtrl* list_;
102
103 DECLARE_EVENT_TABLE()
104};
105
106#endif
UInt32 InstructionAddress
Definition BaseType.hh:175
CycleCount ClockCycleCount
Alias for ClockCycleCount.
void onSelection(wxListEvent &event)
void onClose(wxCloseEvent &event)
const DisasmTopCountAttrProvider::ExecutionCountTable & topCountTable_
void addExecCount(unsigned execCount, unsigned start, unsigned end, const wxColour &colour)
wxColour bgColour(ClockCycleCount execCount)
virtual wxGridCellAttr * moveCellAttr(InstructionAddress address, int move)
std::map< ClockCycleCount, AddressSet > ExecutionCountTable
std::set< InstructionAddress > AddressSet
ExecutionCountTable topCountTable_
Top execution counts and set of instruction addresses with each count.
void addToTopCountTable(InstructionAddress address, ClockCycleCount execCount)
TracedSimulatorFrontend & simulator_
Simulator frontend used for accessing the instructions and exec counts.
size_t topCounts_
Number of top execution counts in the top execution count list.