OpenASIP 2.2
Loading...
Searching...
No Matches
MemoryGridTable.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 MemoryGridTable.hh
26 *
27 * Declaration of MemoryGridTable class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_MEMORY_GRID_TABLE_HH
34#define TTA_MEMORY_GRID_TABLE_HH
35
36#include <string>
37#include <wx/wx.h>
38#include <wx/grid.h>
39#include "BaseType.hh"
40
41class Memory;
42
43/**
44 * Grid table class which allows wxGrid to access TargetMemory contents
45 * without copying the memory contents to separate table.
46 */
47class MemoryGridTable : public wxGridTableBase {
48public:
49 MemoryGridTable(Memory& memory);
50 virtual ~MemoryGridTable();
51 virtual int GetNumberRows();
52 virtual int GetNumberCols();
53 virtual bool IsEmptyCell(int row, int col);
54 virtual wxString GetValue(int row, int col);
55 virtual wxString GetRowLabelValue(int row);
56 virtual wxString GetColLabelValue(int col);
57 virtual void SetValue(int row, int col, const wxString& value);
58
59 void writeValue(int row, int column, UIntWord memoryValue);
60 void writeValue(int row, int column, DoubleWord memoryValue);
61 void findAddress(Word addr, int& row, int& col);
62 void setNumberOfColumns(unsigned columns);
63
70
79
82 unsigned sizeOfCell() const;
83
84
85private:
86 Word cellAddress(int row, int column) const;
87 wxString memoryContents(ULongWord addr);
88
89 /// Memory to access.
91 /// Start address of the memory range to display.
92 Word start_;
93 /// End address of the memory range to display.
94 Word end_;
95
96 /// String that is displayed in a cell that is not in the current AS.
97 static const std::string NOT_AVAILABLE;
98 static const int COLUMNS;
99 /// Maximum number of rows to display in the window.
100 static const Word MAX_ROWS;
101 /// Current data mode of the window (hex/binary/int...).
103 /// Current size mode of the window (1/2/4... MAUs per cell).
105 /// Size of MAU in bits.
107 /// Current number of columns in the grid.
109};
110
111#endif
unsigned long ULongWord
Definition BaseType.hh:51
Word UIntWord
Definition BaseType.hh:144
double DoubleWord
Definition BaseType.hh:166
void writeValue(int row, int column, UIntWord memoryValue)
Word start_
Start address of the memory range to display.
int mauSize_
Size of MAU in bits.
void setNumberOfColumns(unsigned columns)
virtual wxString GetValue(int row, int col)
wxString memoryContents(ULongWord addr)
virtual wxString GetRowLabelValue(int row)
virtual int GetNumberCols()
static const Word MAX_ROWS
Maximum number of rows to display in the window.
void findAddress(Word addr, int &row, int &col)
DataMode dataMode_
Current data mode of the window (hex/binary/int...).
virtual wxString GetColLabelValue(int col)
unsigned sizeOfCell() const
Memory & memory_
Memory to access.
Word cellAddress(int row, int column) const
void setDataMode(DataMode mode)
Word end_
End address of the memory range to display.
void setSizeMode(SizeMode mode)
static const std::string NOT_AVAILABLE
String that is displayed in a cell that is not in the current AS.
static const int COLUMNS
virtual int GetNumberRows()
SizeMode sizeMode_
Current size mode of the window (1/2/4... MAUs per cell).
virtual ~MemoryGridTable()
virtual void SetValue(int row, int col, const wxString &value)
virtual bool IsEmptyCell(int row, int col)
unsigned numberOfColumns_
Current number of columns in the grid.
mode
Definition tceopgen.cc:45