OpenASIP  2.0
BusDialog.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 BusDialog.hh
26  *
27  * Declaration of BusDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_BUS_DIALOG_HH
33 #define TTA_BUS_DIALOG_HH
34 
35 #include <wx/wx.h>
36 #include <wx/listctrl.h>
37 #include <wx/spinctrl.h>
38 #include <wx/valgen.h>
39 #include <vector>
40 #include <string>
41 
42 using std::vector;
43 
44 namespace TTAMachine {
45  class Bus;
46  class RegisterGuard;
47  class PortGuard;
48  class Segment;
49 }
50 
51 /**
52  * Dialog for querying transport bus parameters from the user.
53  */
54 class BusDialog : public wxDialog {
55 public:
56  BusDialog(wxWindow* parent, TTAMachine::Bus* bus);
57  virtual ~BusDialog();
58 
59 private:
60  virtual bool TransferDataToWindow();
61  void onOK(wxCommandEvent&);
62  void onHelp(wxCommandEvent& event);
63  void onBusName(wxCommandEvent&);
64  void onAddSegment(wxCommandEvent&);
65  void onSegmentName(wxCommandEvent&);
66  void onSegmentSelection(wxListEvent&);
67  void onSegmentRightClick(wxListEvent& event);
68  void onDeleteSegment(wxCommandEvent&);
69  void onSegmentUp(wxCommandEvent&);
70  void onSegmentDown(wxCommandEvent&);
71  void setTexts();
72 
73  void onRFGuardSelection(wxListEvent&);
74  void onAddRFGuard(wxCommandEvent&);
75  void onDeleteRFGuard(wxCommandEvent&);
76  void onEditRFGuard(wxCommandEvent&);
77  void onFUGuardSelection(wxListEvent&);
78  void onAddFUGuard(wxCommandEvent&);
79  void onDeleteFUGuard(wxCommandEvent&);
80  void onEditFUGuard(wxCommandEvent&);
81  void onUnconditionalGuard(wxCommandEvent&);
82  void onWidth(wxSpinEvent&);
83  void updateSegmentList();
84  void updateGuardLists();
85 
86  void onRFGuardRightClick(wxListEvent& event);
87  void onActivateRFGuard(wxListEvent& event);
88  void onFUGuardRightClick(wxListEvent& event);
89  void onActivateFUGuard(wxListEvent& event);
90 
94  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
95 
96  /// Transport Bus to edit.
98  /// Name of the bus.
99  wxString name_;
100  /// Width of the bus.
101  int width_;
102  /// Short immediate width
104  /// Name for a new segment.
105  wxString newSegName_;
106 
107  /// List widget for the segment list.
108  wxListCtrl* segList_;
109  /// Check box for always true unconditional guard.
110  wxCheckBox* alwaysTrueGuard_;
111  /// Check box for always false unconditional guard.
112  wxCheckBox* alwaysFalseGuard_;
113  /// Radio box for immediate extension.
115  /// Register file guard list control.
116  wxListCtrl* rfGuardList_;
117  /// Function unit port guard list control.
118  wxListCtrl* fuGuardList_;
119 
120  /// Static boxsizer for the bus properties.
121  wxStaticBoxSizer* busSizer_;
122  /// Static boxsizer for the short immediate properties.
123  wxStaticBoxSizer* siSizer_;
124  /// Static boxsizer for the register guard properties.
125  wxStaticBoxSizer* registerGuardSizer_;
126  /// Static boxsizer for the port guard properties.
127  wxStaticBoxSizer* portGuardSizer_;
128  /// Static boxsizer for the segment properties.
129  wxStaticBoxSizer* segmentSizer_;
130 
131 
132  /// list of register guards
133  vector<TTAMachine::RegisterGuard*> registerGuards_;
134  /// list of port guards
135  vector<TTAMachine::PortGuard*> portGuards_;
136 
137  /// enumerated IDs for dialog controls
138  enum {
139  ID_BUS_NAME = 10000,
165  };
166 
167  /// The event table for the controls of the dialog.
168  DECLARE_EVENT_TABLE()
169 };
170 #endif
BusDialog::fuGuardList_
wxListCtrl * fuGuardList_
Function unit port guard list control.
Definition: BusDialog.hh:118
BusDialog::immediateExtensionBox_
wxRadioBox * immediateExtensionBox_
Radio box for immediate extension.
Definition: BusDialog.hh:114
BusDialog::BusDialog
BusDialog(wxWindow *parent, TTAMachine::Bus *bus)
Definition: BusDialog.cc:122
BusDialog::name_
wxString name_
Name of the bus.
Definition: BusDialog.hh:99
BusDialog::registerGuardSizer_
wxStaticBoxSizer * registerGuardSizer_
Static boxsizer for the register guard properties.
Definition: BusDialog.hh:125
BusDialog::ID_FALSE_GUARD
@ ID_FALSE_GUARD
Definition: BusDialog.hh:144
BusDialog::busSizer_
wxStaticBoxSizer * busSizer_
Static boxsizer for the bus properties.
Definition: BusDialog.hh:121
BusDialog::rfGuardList_
wxListCtrl * rfGuardList_
Register file guard list control.
Definition: BusDialog.hh:116
BusDialog::ID_SEGMENT_DOWN
@ ID_SEGMENT_DOWN
Definition: BusDialog.hh:148
TTAMachine::Segment
Definition: Segment.hh:54
BusDialog::ID_FU_GUARD_LIST
@ ID_FU_GUARD_LIST
Definition: BusDialog.hh:155
BusDialog::onAddRFGuard
void onAddRFGuard(wxCommandEvent &)
Definition: BusDialog.cc:898
BusDialog::immWidth_
int immWidth_
Short immediate width.
Definition: BusDialog.hh:103
BusDialog::ID_LABEL_SI_WIDTH
@ ID_LABEL_SI_WIDTH
Definition: BusDialog.hh:163
TTAMachine::Bus
Definition: Bus.hh:53
BusDialog::ID_DELETE_FU_GUARD
@ ID_DELETE_FU_GUARD
Definition: BusDialog.hh:158
BusDialog::onOK
void onOK(wxCommandEvent &)
Definition: BusDialog.cc:797
BusDialog::updateGuardLists
void updateGuardLists()
Definition: BusDialog.cc:412
BusDialog::ID_SEGMENT_UP
@ ID_SEGMENT_UP
Definition: BusDialog.hh:147
BusDialog::ID_EDIT_FU_GUARD
@ ID_EDIT_FU_GUARD
Definition: BusDialog.hh:157
BusDialog::ID_SEGMENT_NAME
@ ID_SEGMENT_NAME
Definition: BusDialog.hh:146
BusDialog::onSegmentSelection
void onSegmentSelection(wxListEvent &)
Definition: BusDialog.cc:693
BusDialog::onHelp
void onHelp(wxCommandEvent &event)
BusDialog::onAddFUGuard
void onAddFUGuard(wxCommandEvent &)
Definition: BusDialog.cc:998
BusDialog::ID_SEGMENT_LIST
@ ID_SEGMENT_LIST
Definition: BusDialog.hh:145
BusDialog::onSegmentDown
void onSegmentDown(wxCommandEvent &)
Definition: BusDialog.cc:775
BusDialog::registerGuards_
vector< TTAMachine::RegisterGuard * > registerGuards_
list of register guards
Definition: BusDialog.hh:133
BusDialog::ID_BUS_NAME
@ ID_BUS_NAME
Definition: BusDialog.hh:139
BusDialog::siSizer_
wxStaticBoxSizer * siSizer_
Static boxsizer for the short immediate properties.
Definition: BusDialog.hh:123
BusDialog::alwaysTrueGuard_
wxCheckBox * alwaysTrueGuard_
Check box for always true unconditional guard.
Definition: BusDialog.hh:110
BusDialog::onEditFUGuard
void onEditFUGuard(wxCommandEvent &)
Definition: BusDialog.cc:1047
BusDialog::ID_DELETE_RF_GUARD
@ ID_DELETE_RF_GUARD
Definition: BusDialog.hh:154
BusDialog::newSegName_
wxString newSegName_
Name for a new segment.
Definition: BusDialog.hh:105
BusDialog::onSegmentRightClick
void onSegmentRightClick(wxListEvent &event)
Definition: BusDialog.cc:712
BusDialog::onDeleteRFGuard
void onDeleteRFGuard(wxCommandEvent &)
Definition: BusDialog.cc:922
BusDialog::ID_TRUE_GUARD
@ ID_TRUE_GUARD
Definition: BusDialog.hh:143
BusDialog::width_
int width_
Width of the bus.
Definition: BusDialog.hh:101
BusDialog::ID_LABEL_SEGMENT_NAME
@ ID_LABEL_SEGMENT_NAME
Definition: BusDialog.hh:164
TTAMachine::RegisterGuard
Definition: Guard.hh:137
BusDialog::ID_LABEL_BUS_NAME
@ ID_LABEL_BUS_NAME
Definition: BusDialog.hh:160
BusDialog::onDeleteSegment
void onDeleteSegment(wxCommandEvent &)
Definition: BusDialog.cc:735
BusDialog::portGuards_
vector< TTAMachine::PortGuard * > portGuards_
list of port guards
Definition: BusDialog.hh:135
BusDialog::segmentSizer_
wxStaticBoxSizer * segmentSizer_
Static boxsizer for the segment properties.
Definition: BusDialog.hh:129
BusDialog::onFUGuardRightClick
void onFUGuardRightClick(wxListEvent &event)
Definition: BusDialog.cc:1136
BusDialog::onAddSegment
void onAddSegment(wxCommandEvent &)
Definition: BusDialog.cc:567
BusDialog::onWidth
void onWidth(wxSpinEvent &)
Definition: BusDialog.cc:1063
BusDialog::ID_HELP
@ ID_HELP
Definition: BusDialog.hh:159
BusDialog::ID_EDIT_RF_GUARD
@ ID_EDIT_RF_GUARD
Definition: BusDialog.hh:153
BusDialog::ID_LABEL_BUS_WIDTH
@ ID_LABEL_BUS_WIDTH
Definition: BusDialog.hh:161
BusDialog::ID_SI_EXTENSION
@ ID_SI_EXTENSION
Definition: BusDialog.hh:142
BusDialog::onBusName
void onBusName(wxCommandEvent &)
Definition: BusDialog.cc:617
BusDialog::onActivateFUGuard
void onActivateFUGuard(wxListEvent &event)
Definition: BusDialog.cc:1160
BusDialog::setTexts
void setTexts()
Definition: BusDialog.cc:192
BusDialog::onUnconditionalGuard
void onUnconditionalGuard(wxCommandEvent &)
Definition: BusDialog.cc:635
BusDialog::~BusDialog
virtual ~BusDialog()
Definition: BusDialog.cc:184
BusDialog::onActivateRFGuard
void onActivateRFGuard(wxListEvent &event)
Definition: BusDialog.cc:1123
BusDialog::onDeleteFUGuard
void onDeleteFUGuard(wxCommandEvent &)
Definition: BusDialog.cc:1032
BusDialog::ID_RF_GUARD_LIST
@ ID_RF_GUARD_LIST
Definition: BusDialog.hh:151
BusDialog::ID_ADD_RF_GUARD
@ ID_ADD_RF_GUARD
Definition: BusDialog.hh:152
BusDialog::selectedRFGuard
TTAMachine::RegisterGuard * selectedRFGuard() const
Definition: BusDialog.cc:543
BusDialog::portGuardSizer_
wxStaticBoxSizer * portGuardSizer_
Static boxsizer for the port guard properties.
Definition: BusDialog.hh:127
BusDialog::selectedSegment
TTAMachine::Segment * selectedSegment() const
Definition: BusDialog.cc:501
BusDialog
Definition: BusDialog.hh:54
BusDialog::ID_ADD_FU_GUARD
@ ID_ADD_FU_GUARD
Definition: BusDialog.hh:156
BusDialog::segList_
wxListCtrl * segList_
List widget for the segment list.
Definition: BusDialog.hh:108
TTAMachine::PortGuard
Definition: Guard.hh:99
BusDialog::ID_ADD_SEGMENT
@ ID_ADD_SEGMENT
Definition: BusDialog.hh:149
BusDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: BusDialog.cc:337
BusDialog::onFUGuardSelection
void onFUGuardSelection(wxListEvent &)
Definition: BusDialog.cc:1081
BusDialog::alwaysFalseGuard_
wxCheckBox * alwaysFalseGuard_
Check box for always false unconditional guard.
Definition: BusDialog.hh:112
BusDialog::bus_
TTAMachine::Bus * bus_
Transport Bus to edit.
Definition: BusDialog.hh:97
BusDialog::selectedFUGuard
TTAMachine::PortGuard * selectedFUGuard() const
Definition: BusDialog.cc:522
BusDialog::ID_SI_WIDTH
@ ID_SI_WIDTH
Definition: BusDialog.hh:141
TTAMachine
Definition: Assembler.hh:48
BusDialog::ID_DELETE_SEGMENT
@ ID_DELETE_SEGMENT
Definition: BusDialog.hh:150
BusDialog::onSegmentUp
void onSegmentUp(wxCommandEvent &)
Definition: BusDialog.cc:752
BusDialog::onSegmentName
void onSegmentName(wxCommandEvent &)
Definition: BusDialog.cc:676
BusDialog::updateSegmentList
void updateSegmentList()
Definition: BusDialog.cc:486
BusDialog::onEditRFGuard
void onEditRFGuard(wxCommandEvent &)
Definition: BusDialog.cc:958
BusDialog::ID_LABEL_WIDTH
@ ID_LABEL_WIDTH
Definition: BusDialog.hh:162
BusDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: BusDialog.cc:1178
BusDialog::onRFGuardRightClick
void onRFGuardRightClick(wxListEvent &event)
Definition: BusDialog.cc:1099
BusDialog::onRFGuardSelection
void onRFGuardSelection(wxListEvent &)
Definition: BusDialog.cc:978
BusDialog::ID_BUS_WIDTH
@ ID_BUS_WIDTH
Definition: BusDialog.hh:140