OpenASIP  2.0
ProximMemoryWindow.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 ProximMemoryWindow.cc
26  *
27  * Declaration of ProximMemoryWindow 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_MEMORY_WINDOW_HH
35 #define TTA_PROXIM_MEMORY_WINDOW_HH
36 
37 #include "ProximSimulatorWindow.hh"
38 #include "SimulatorEvent.hh"
39 
40 class MemorySystem;
41 class MemoryControl;
42 class SimulatorFrontend;
43 
44 namespace TTAMachine {
45  class AddressSpace;
46 }
47 
48 /**
49  * Proxim subwindow which displays memory contents.
50  *
51  * This window listens to SimulatorEvents and updates the window
52  * contents automatically.
53  */
55 public:
56  ProximMemoryWindow(ProximMainFrame* parent, int id);
57  virtual ~ProximMemoryWindow();
58  virtual void reset();
59 private:
60  void onProgramLoaded(const SimulatorEvent& event);
61  void onSimulationStop(const SimulatorEvent& event);
62  void loadProgramMemory();
63  void loadMemory(const TTAMachine::AddressSpace& as);
64  void initialize();
65  void onASChoice(wxCommandEvent& event);
66  void onDisplayRangeChoice(wxCommandEvent& event);
67  void createContents();
68 
69  /// Memory system to display in teh window.
71  /// MemoryControl widget which displays the memory contents.
73  /// Simulator instance which contains the memory system to display.
75  /// Toplevel sizer for the window widgets.
76  wxBoxSizer* sizer_;
77  /// Address space choicer widget.
78  wxChoice* asChoice_;
79  /// Sizer for address range widgets.
80  wxStaticBoxSizer* addressRangeSizer_;
81  /// Static text control displaying address space information.
82  wxStaticText* asInfoText_;
83 
84  // Widget IDs.
85  enum {
86  ID_AS_CHOICE = 10000,
94  };
95  DECLARE_EVENT_TABLE()
96 };
97 
98 #endif
ProximMemoryWindow::loadMemory
void loadMemory(const TTAMachine::AddressSpace &as)
Definition: ProximMemoryWindow.cc:96
ProximMainFrame
Definition: ProximMainFrame.hh:58
ProximSimulatorWindow.hh
ProximMemoryWindow::memorySystem_
MemorySystem * memorySystem_
Memory system to display in teh window.
Definition: ProximMemoryWindow.hh:70
ProximMemoryWindow::ID_TEXT_AS
@ ID_TEXT_AS
Definition: ProximMemoryWindow.hh:87
ProximMemoryWindow::~ProximMemoryWindow
virtual ~ProximMemoryWindow()
Definition: ProximMemoryWindow.cc:86
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
SimulatorEvent.hh
ProximMemoryWindow::ID_TEXT_AS_INFO
@ ID_TEXT_AS_INFO
Definition: ProximMemoryWindow.hh:88
ProximMemoryWindow::onProgramLoaded
void onProgramLoaded(const SimulatorEvent &event)
Definition: ProximMemoryWindow.cc:133
ProximMemoryWindow::asChoice_
wxChoice * asChoice_
Address space choicer widget.
Definition: ProximMemoryWindow.hh:78
ProximMemoryWindow
Definition: ProximMemoryWindow.hh:54
ProximMemoryWindow::onASChoice
void onASChoice(wxCommandEvent &event)
Definition: ProximMemoryWindow.cc:175
ProximMemoryWindow::loadProgramMemory
void loadProgramMemory()
Definition: ProximMemoryWindow.cc:155
ProximMemoryWindow::ID_TEXT_DISPLAY
@ ID_TEXT_DISPLAY
Definition: ProximMemoryWindow.hh:91
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
ProximMemoryWindow::onDisplayRangeChoice
void onDisplayRangeChoice(wxCommandEvent &event)
ProximMemoryWindow::asInfoText_
wxStaticText * asInfoText_
Static text control displaying address space information.
Definition: ProximMemoryWindow.hh:82
ProximMemoryWindow::memoryControl_
MemoryControl * memoryControl_
MemoryControl widget which displays the memory contents.
Definition: ProximMemoryWindow.hh:72
ProximMemoryWindow::ID_DISPLAY_SIZE_CHOICE
@ ID_DISPLAY_SIZE_CHOICE
Definition: ProximMemoryWindow.hh:92
MemoryControl
Definition: MemoryControl.hh:53
ProximMemoryWindow::ID_TEXT_START_ADDRESS
@ ID_TEXT_START_ADDRESS
Definition: ProximMemoryWindow.hh:89
ProximMemoryWindow::ID_LINE
@ ID_LINE
Definition: ProximMemoryWindow.hh:93
MemorySystem
Definition: MemorySystem.hh:55
ProximMemoryWindow::onSimulationStop
void onSimulationStop(const SimulatorEvent &event)
Definition: ProximMemoryWindow.cc:189
ProximMemoryWindow::ProximMemoryWindow
ProximMemoryWindow(ProximMainFrame *parent, int id)
Definition: ProximMemoryWindow.cc:65
ProximMemoryWindow::simulator_
SimulatorFrontend * simulator_
Simulator instance which contains the memory system to display.
Definition: ProximMemoryWindow.hh:74
ProximMemoryWindow::createContents
void createContents()
Definition: ProximMemoryWindow.cc:221
ProximMemoryWindow::ID_AS_CHOICE
@ ID_AS_CHOICE
Definition: ProximMemoryWindow.hh:86
ProximMemoryWindow::addressRangeSizer_
wxStaticBoxSizer * addressRangeSizer_
Sizer for address range widgets.
Definition: ProximMemoryWindow.hh:80
ProximMemoryWindow::reset
virtual void reset()
Definition: ProximMemoryWindow.cc:142
ProximMemoryWindow::initialize
void initialize()
ProximMemoryWindow::sizer_
wxBoxSizer * sizer_
Toplevel sizer for the window widgets.
Definition: ProximMemoryWindow.hh:76
SimulatorEvent
Definition: SimulatorEvent.hh:42
TTAMachine
Definition: Assembler.hh:48
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
ProximMemoryWindow::ID_START_ADDRESS
@ ID_START_ADDRESS
Definition: ProximMemoryWindow.hh:90