OpenASIP  2.0
DisassemblyGridTable.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 DisassemblyGridTable.hh
26  *
27  * Declaration of DisassemblyGridTable 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_DISASSEMBLY_GRID_TABLE_HH
34 #define TTA_DISASSEMBLY_GRID_TABLE_HH
35 
36 #include <map>
37 #include <string>
38 #include <wx/wx.h>
39 #include <wx/grid.h>
40 #include "BaseType.hh"
41 
42 namespace TTAProgram {
43  class Program;
44 }
45 
46 class POMDisassembler;
47 
48 /**
49  * Grid table class which allows wxGrid to display disassembly of a tta program
50  * by disassembling only the currently visible instructions. Purpose of the
51  * 'lazy' disasembling is to conserve memory and processing time when the
52  * program is very large.
53  */
54 class DisassemblyGridTable : public wxGridTableBase {
55 public:
57  virtual ~DisassemblyGridTable();
58  virtual int GetNumberRows();
59  virtual int GetNumberCols();
60  virtual bool IsEmptyCell(int row, int col);
61  virtual wxString GetValue(int row, int col);
62  virtual wxString GetRowLabelValue(int row);
63  virtual wxString GetColLabelValue(int col);
64  virtual void SetValue(int row, int col, const wxString& value);
65  virtual bool CanHaveAttributes();
66  int rowOfAddress(Word address);
67  Word addressOfRow(int row);
69 protected:
70  /// Program loaded in the table.
72 private:
73  /// Disassembler for generating instruction disassemblies.
75 
76  /// Type for the labels multimap
77  typedef std::multimap<int, std::string> LabelMap;
78 
79  /// Program labels.
81 };
82 
83 #endif
DisassemblyGridTable::GetRowLabelValue
virtual wxString GetRowLabelValue(int row)
Definition: DisassemblyGridTable.cc:168
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
DisassemblyGridTable::GetColLabelValue
virtual wxString GetColLabelValue(int col)
Definition: DisassemblyGridTable.cc:180
DisassemblyGridTable::GetValue
virtual wxString GetValue(int row, int col)
Definition: DisassemblyGridTable.cc:121
BaseType.hh
DisassemblyGridTable::labels_
LabelMap labels_
Program labels.
Definition: DisassemblyGridTable.hh:80
DisassemblyGridTable::IsEmptyCell
virtual bool IsEmptyCell(int row, int col)
Definition: DisassemblyGridTable.cc:108
DisassemblyGridTable::loadProgram
void loadProgram(const TTAProgram::Program &program)
Definition: DisassemblyGridTable.cc:224
DisassemblyGridTable::addressOfRow
Word addressOfRow(int row)
Definition: DisassemblyGridTable.cc:254
POMDisassembler
Definition: POMDisassembler.hh:70
DisassemblyGridTable::GetNumberRows
virtual int GetNumberRows()
Definition: DisassemblyGridTable.cc:79
DisassemblyGridTable::LabelMap
std::multimap< int, std::string > LabelMap
Type for the labels multimap.
Definition: DisassemblyGridTable.hh:77
DisassemblyGridTable::rowOfAddress
int rowOfAddress(Word address)
Definition: DisassemblyGridTable.cc:266
DisassemblyGridTable
Definition: DisassemblyGridTable.hh:54
DisassemblyGridTable::SetValue
virtual void SetValue(int row, int col, const wxString &value)
Definition: DisassemblyGridTable.cc:213
DisassemblyGridTable::DisassemblyGridTable
DisassemblyGridTable()
Definition: DisassemblyGridTable.cc:55
DisassemblyGridTable::GetNumberCols
virtual int GetNumberCols()
Definition: DisassemblyGridTable.cc:92
DisassemblyGridTable::program_
const TTAProgram::Program * program_
Program loaded in the table.
Definition: DisassemblyGridTable.hh:71
DisassemblyGridTable::CanHaveAttributes
virtual bool CanHaveAttributes()
Definition: DisassemblyGridTable.cc:204
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
DisassemblyGridTable::disassembler_
POMDisassembler * disassembler_
Disassembler for generating instruction disassemblies.
Definition: DisassemblyGridTable.hh:74
DisassemblyGridTable::~DisassemblyGridTable
virtual ~DisassemblyGridTable()
Definition: DisassemblyGridTable.cc:64