OpenASIP  2.0
ProximDisassemblyWindow.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 ProximDisassemblyWindow.cc
26  *
27  * Declaration of ProximDisassemblyWindow class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 
34 #ifndef TTA_PROXIM_DISASSEMBLY_WINDOW_HH
35 #define TTA_PROXIM_DISASSEMBLY_WINDOW_HH
36 
37 #include <map>
38 #include <wx/wx.h>
39 #include <wx/grid.h>
40 #include "SimulatorEvent.hh"
41 #include "ProximSimulatorWindow.hh"
42 
43 class ProximMainFrame;
46 
47 namespace TTAProgram {
48  class Program;
49 }
50 
51 /**
52  * A window which can be utilized to display disassembly of a program object
53  * model.
54  *
55  * This class listens to SimulatorEvents and updates the window information
56  * automatically.
57  */
59 public:
61  virtual ~ProximDisassemblyWindow();
62  virtual void reset();
64  void showAddress(unsigned address);
66 
67 private:
68  void initialize();
69  void resetGrid();
70  void onProgramLoaded(const SimulatorEvent& event);
71  void onSimulatorStop(const SimulatorEvent& event);
73  void onRightClick(wxGridEvent& event);
74  void onSetBreakpoint(wxCommandEvent& event);
75  void onSetTempBp(wxCommandEvent& event);
76  void onRunUntil(wxCommandEvent& event);
77  void onMappedMenuCommand(wxCommandEvent& event);
78 
79  /// The grid disapleying the disassembly.
80  wxGrid* codeGrid_;
81  /// Grid table which handles on-the-fly disassembly of the loaded program.
83 
84  /// A map which contains command strings for context menu items.
85  std::map<unsigned, std::string> menuCommand_;
86 
87  /// Width of the column displaying the arrow pointign current instruction.
88  static const unsigned INFO_COLUMN_WIDTH;
89  /// Width of the instruction address column.
90  static const unsigned ADDRESS_COLUMN_WIDTH;
91  /// Width of the breakpoint info column.
92  static const unsigned BP_COLUMN_WIDTH;
93  /// Width of the instruction disassembly column.
94  static const unsigned DISASSEMBLY_COLUMN_WIDTH;
95 
96  /// Context menu command IDs.
97  enum {
98  MENU_ID_SET_BP = 10000,
101  MENU_ID_FIRST_MAPPED // Keep this as the last menu item.
102  };
103 
104  DECLARE_EVENT_TABLE()
105 };
106 
107 #endif
ProximMainFrame
Definition: ProximMainFrame.hh:58
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
ProximSimulatorWindow.hh
ProximDisassemblyWindow::~ProximDisassemblyWindow
virtual ~ProximDisassemblyWindow()
Definition: ProximDisassemblyWindow.cc:97
SimulatorEvent.hh
ProximDisassemblyWindow::codeGrid_
wxGrid * codeGrid_
The grid disapleying the disassembly.
Definition: ProximDisassemblyWindow.hh:80
ProximDisassemblyWindow::MENU_ID_RUN_UNTIL
@ MENU_ID_RUN_UNTIL
Definition: ProximDisassemblyWindow.hh:100
ProximDisassemblyWindow::reset
virtual void reset()
Definition: ProximDisassemblyWindow.cc:155
ProximDisassemblyWindow::setMoveAttrProvider
void setMoveAttrProvider(ProximDisasmAttrProvider *attrProvider)
Definition: ProximDisassemblyWindow.cc:391
ProximDisassemblyWindow::menuCommand_
std::map< unsigned, std::string > menuCommand_
A map which contains command strings for context menu items.
Definition: ProximDisassemblyWindow.hh:85
ProximDisassemblyWindow::onSetTempBp
void onSetTempBp(wxCommandEvent &event)
Definition: ProximDisassemblyWindow.cc:300
ProximDisassemblyWindow::MENU_ID_SET_TEMP_BP
@ MENU_ID_SET_TEMP_BP
Definition: ProximDisassemblyWindow.hh:99
ProximDisassemblyWindow::ADDRESS_COLUMN_WIDTH
static const unsigned ADDRESS_COLUMN_WIDTH
Width of the instruction address column.
Definition: ProximDisassemblyWindow.hh:90
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
ProximDisassemblyWindow::resetGrid
void resetGrid()
Definition: ProximDisassemblyWindow.cc:117
ProximDisasmAttrProvider
Definition: ProximDisasmAttrProvider.hh:44
ProximDisassemblyWindow::onSimulatorCommand
void onSimulatorCommand(SimulatorEvent &event)
Definition: ProximDisassemblyWindow.cc:346
ProximDisassemblyWindow::INFO_COLUMN_WIDTH
static const unsigned INFO_COLUMN_WIDTH
Width of the column displaying the arrow pointign current instruction.
Definition: ProximDisassemblyWindow.hh:88
ProximDisassemblyWindow::onRunUntil
void onRunUntil(wxCommandEvent &event)
Definition: ProximDisassemblyWindow.cc:314
ProximDisassemblyWindow::MENU_ID_FIRST_MAPPED
@ MENU_ID_FIRST_MAPPED
Definition: ProximDisassemblyWindow.hh:101
ProximDisassemblyWindow::initialize
void initialize()
Definition: ProximDisassemblyWindow.cc:105
ProximDisassemblyWindow::ProximDisassemblyWindow
ProximDisassemblyWindow(ProximMainFrame *parent, int id)
Definition: ProximDisassemblyWindow.cc:84
ProximDisassemblyWindow::DISASSEMBLY_COLUMN_WIDTH
static const unsigned DISASSEMBLY_COLUMN_WIDTH
Width of the instruction disassembly column.
Definition: ProximDisassemblyWindow.hh:94
ProximDisassemblyWindow::onRightClick
void onRightClick(wxGridEvent &event)
Definition: ProximDisassemblyWindow.cc:209
ProximDisassemblyWindow::codeTable_
ProximDisassemblyGridTable * codeTable_
Grid table which handles on-the-fly disassembly of the loaded program.
Definition: ProximDisassemblyWindow.hh:82
ProximDisassemblyWindow::MENU_ID_SET_BP
@ MENU_ID_SET_BP
Definition: ProximDisassemblyWindow.hh:98
ProximDisassemblyWindow::onMappedMenuCommand
void onMappedMenuCommand(wxCommandEvent &event)
Definition: ProximDisassemblyWindow.cc:373
ProximDisassemblyWindow::loadProgram
void loadProgram(const TTAProgram::Program &program)
Definition: ProximDisassemblyWindow.cc:179
ProximDisassemblyGridTable
Definition: ProximDisassemblyGridTable.hh:47
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
SimulatorEvent
Definition: SimulatorEvent.hh:42
ProximDisassemblyWindow::showAddress
void showAddress(unsigned address)
Definition: ProximDisassemblyWindow.cc:359
ProximDisassemblyWindow
Definition: ProximDisassemblyWindow.hh:58
ProximDisassemblyWindow::BP_COLUMN_WIDTH
static const unsigned BP_COLUMN_WIDTH
Width of the breakpoint info column.
Definition: ProximDisassemblyWindow.hh:92
ProximDisassemblyWindow::onProgramLoaded
void onProgramLoaded(const SimulatorEvent &event)
Definition: ProximDisassemblyWindow.cc:198
ProximDisassemblyWindow::onSimulatorStop
void onSimulatorStop(const SimulatorEvent &event)
Definition: ProximDisassemblyWindow.cc:328
ProximDisassemblyWindow::onSetBreakpoint
void onSetBreakpoint(wxCommandEvent &event)
Definition: ProximDisassemblyWindow.cc:286