OpenASIP  2.0
FUImplementationDialog.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 FUImplementationDialog.hh
26  *
27  * Declaration of FUImplementationDialog 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_FU_IMPLEMENTATION_DIALOG_HH
34 #define TTA_FU_IMPLEMENTATION_DIALOG_HH
35 
36 #include <wx/listctrl.h>
37 #include "FUImplementation.hh"
38 
39 // Remove this define when opcode editing should be disabled.
40 // Also edit hdb/HDBManager.cc not to write opcodes into hdb anymore.
41 #define ALLOW_OPCODE_EDITING
42 
43 class wxListCtrl;
44 
45 namespace TTAMachine {
46  class FunctionUnit;
47 }
48 
49 /**
50  * Dialog for editing FU implementations.
51  */
52 class FUImplementationDialog : public wxDialog {
53 public:
55  wxWindow* parent, wxWindowID id,
57  const TTAMachine::FunctionUnit& architecture);
58 
59  virtual ~FUImplementationDialog();
60 private:
61 
62  void onOK(wxCommandEvent& event);
63  void update(bool onInit = false);
64 
68 
69  void onArchPortActivation(wxListEvent& event);
70  void onArchPortSelection(wxListEvent& event);
71  void onAddArchitecturePort(wxCommandEvent& event);
72  void onEditArchitecturePort(wxCommandEvent& event);
73  void onDeleteArchitecturePort(wxCommandEvent& event);
74 
75  void onExternalPortActivation(wxListEvent& event);
76  void onExternalPortSelection(wxListEvent& event);
77  void onAddExternalPort(wxCommandEvent& event);
78  void onEditExternalPort(wxCommandEvent& event);
79  void onDeleteExternalPort(wxCommandEvent& event);
80 
81  void onParameterActivation(wxListEvent& event);
82  void onParameterSelection(wxListEvent& event);
83  void onAddParameter(wxCommandEvent& event);
84  void onEditParameter(wxCommandEvent& event);
85  void onDeleteParameter(wxCommandEvent& event);
86 
87  void onSourceFileSelection(wxListEvent& event);
88  void onAddSourceFile(wxCommandEvent& event);
89  void onDeleteSourceFile(wxCommandEvent& event);
90 
91  void onMoveSourceFileUp(wxCommandEvent& event);
92  void onMoveSourceFileDown(wxCommandEvent& event);
93 
94 #ifdef ALLOW_OPCODE_EDITING
95  void onOpcodeSelection(wxListEvent& event);
96  void onSetOpcode(wxCommandEvent& event);
97  void onClearOpcode(wxCommandEvent& event);
98 #endif
99 
100  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
101 
102  /// Window indentifiers for dialog widgets.
103  enum {
104  ID_LABEL_NAME = 10000,
115 #ifdef ALLOW_OPCODE_EDITING
119 #endif
138  };
139 
140  /// FU Implementation to modify.
142  /// Function unit architecture the FUImplementation implements.
144 
146 
147  /// Pointer to the architecture port list widget.
148  wxListCtrl* archPortList_;
149  /// Pointer to the external port list widget.
150  wxListCtrl* externalPortList_;
151  /// Pointer to the parameter list widget.
152  wxListCtrl* parameterList_;
153  /// Pointer to the opcode list widget.
154  wxListCtrl* opcodeList_;
155  /// Pointer to the source file list widget.
156  wxListCtrl* sourceList_;
157 
158  wxString name_;
159  wxString opcodePort_;
160  wxString clkPort_;
161  wxString rstPort_;
162  wxString gLockPort_;
163  wxString gLockReqPort_;
164 
165  DECLARE_EVENT_TABLE()
166 };
167 
168 #endif
FUImplementationDialog::ID_SOURCE_LIST
@ ID_SOURCE_LIST
Definition: FUImplementationDialog.hh:124
FUImplementationDialog::ID_OPCODE
@ ID_OPCODE
Definition: FUImplementationDialog.hh:118
HDB::FUExternalPort
Definition: FUExternalPort.hh:52
FUImplementationDialog::onDeleteSourceFile
void onDeleteSourceFile(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:838
FUImplementationDialog::onAddParameter
void onAddParameter(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:539
FUImplementationDialog::opcodeWarningShowed_
bool opcodeWarningShowed_
Definition: FUImplementationDialog.hh:145
FUImplementationDialog::~FUImplementationDialog
virtual ~FUImplementationDialog()
Definition: FUImplementationDialog.cc:236
FUImplementationDialog::ID_MOVE_SOURCE_DOWN
@ ID_MOVE_SOURCE_DOWN
Definition: FUImplementationDialog.hh:137
FUImplementationDialog::parameterList_
wxListCtrl * parameterList_
Pointer to the parameter list widget.
Definition: FUImplementationDialog.hh:152
FUImplementationDialog::externalPortList_
wxListCtrl * externalPortList_
Pointer to the external port list widget.
Definition: FUImplementationDialog.hh:150
FUImplementationDialog::onEditExternalPort
void onEditExternalPort(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:465
FUImplementationDialog::onEditParameter
void onEditParameter(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:573
FUImplementationDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: FUImplementationDialog.hh:104
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
FUImplementationDialog
Definition: FUImplementationDialog.hh:52
HDB::FUPortImplementation
Definition: FUPortImplementation.hh:46
FUImplementationDialog::ID_LABEL_GLOCK_PORT
@ ID_LABEL_GLOCK_PORT
Definition: FUImplementationDialog.hh:110
FUImplementationDialog::onArchPortActivation
void onArchPortActivation(wxListEvent &event)
Definition: FUImplementationDialog.cc:422
FUImplementationDialog::selectedParameter
HDB::FUImplementation::Parameter selectedParameter()
Definition: FUImplementationDialog.cc:713
FUImplementationDialog::ID_CLK_PORT
@ ID_CLK_PORT
Definition: FUImplementationDialog.hh:107
FUImplementationDialog::ID_ADD_SOURCE
@ ID_ADD_SOURCE
Definition: FUImplementationDialog.hh:125
FUImplementationDialog::ID_PARAMETER_LIST
@ ID_PARAMETER_LIST
Definition: FUImplementationDialog.hh:127
FUImplementationDialog::ID_LABEL_OPCODE_PORT_NAME
@ ID_LABEL_OPCODE_PORT_NAME
Definition: FUImplementationDialog.hh:131
FUImplementationDialog::ID_EDIT_ARCH_PORT
@ ID_EDIT_ARCH_PORT
Definition: FUImplementationDialog.hh:134
FUImplementationDialog::onDeleteExternalPort
void onDeleteExternalPort(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:504
FUImplementationDialog::onOpcodeSelection
void onOpcodeSelection(wxListEvent &event)
Definition: FUImplementationDialog.cc:734
FUImplementationDialog::ID_CLEAR_OPCODE
@ ID_CLEAR_OPCODE
Definition: FUImplementationDialog.hh:116
FUImplementationDialog::update
void update(bool onInit=false)
Definition: FUImplementationDialog.cc:247
FUImplementationDialog::ID_EXTERNAL_PORT_LIST
@ ID_EXTERNAL_PORT_LIST
Definition: FUImplementationDialog.hh:120
FUImplementationDialog::onSourceFileSelection
void onSourceFileSelection(wxListEvent &event)
Definition: FUImplementationDialog.cc:961
FUImplementationDialog::ID_OPCODE_PORT
@ ID_OPCODE_PORT
Definition: FUImplementationDialog.hh:132
FUImplementationDialog::onMoveSourceFileUp
void onMoveSourceFileUp(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:862
FUImplementationDialog::ID_EDIT_PARAMETER
@ ID_EDIT_PARAMETER
Definition: FUImplementationDialog.hh:128
FUImplementationDialog::ID_MOVE_SOURCE_UP
@ ID_MOVE_SOURCE_UP
Definition: FUImplementationDialog.hh:136
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
FUImplementationDialog::onOK
void onOK(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:980
FUImplementationDialog::onParameterActivation
void onParameterActivation(wxListEvent &event)
Definition: FUImplementationDialog.cc:604
FUImplementationDialog::onDeleteParameter
void onDeleteParameter(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:634
FUImplementationDialog::onAddSourceFile
void onAddSourceFile(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:813
FUImplementationDialog::onAddExternalPort
void onAddExternalPort(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:443
FUImplementationDialog::gLockPort_
wxString gLockPort_
Definition: FUImplementationDialog.hh:162
FUImplementationDialog::ID_NAME
@ ID_NAME
Definition: FUImplementationDialog.hh:105
FUImplementationDialog::onExternalPortActivation
void onExternalPortActivation(wxListEvent &event)
Definition: FUImplementationDialog.cc:485
FUImplementationDialog::selectedArchPort
HDB::FUPortImplementation * selectedArchPort()
Definition: FUImplementationDialog.cc:675
FUImplementationDialog::onMoveSourceFileDown
void onMoveSourceFileDown(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:911
FUImplementationDialog::rstPort_
wxString rstPort_
Definition: FUImplementationDialog.hh:161
FUImplementation.hh
FUImplementationDialog::onAddArchitecturePort
void onAddArchitecturePort(wxCommandEvent &event)
FUImplementationDialog::ID_EDIT_EXTERNAL_PORT
@ ID_EDIT_EXTERNAL_PORT
Definition: FUImplementationDialog.hh:122
FUImplementationDialog::ID_SET_OPCODE
@ ID_SET_OPCODE
Definition: FUImplementationDialog.hh:117
FUImplementationDialog::ID_ARCH_PORT_LIST
@ ID_ARCH_PORT_LIST
Definition: FUImplementationDialog.hh:133
FUImplementationDialog::archPortList_
wxListCtrl * archPortList_
Pointer to the architecture port list widget.
Definition: FUImplementationDialog.hh:148
FUImplementationDialog::onSetOpcode
void onSetOpcode(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:775
FUImplementationDialog::ID_DELETE_EXTERNAL_PORT
@ ID_DELETE_EXTERNAL_PORT
Definition: FUImplementationDialog.hh:123
HDB::FUImplementation
Definition: FUImplementation.hh:53
FUImplementationDialog::FUImplementationDialog
FUImplementationDialog(wxWindow *parent, wxWindowID id, HDB::FUImplementation &implementation, const TTAMachine::FunctionUnit &architecture)
Definition: FUImplementationDialog.cc:139
FUImplementationDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: FUImplementationDialog.cc:1064
FUImplementationDialog::ID_ADD_PARAMETER
@ ID_ADD_PARAMETER
Definition: FUImplementationDialog.hh:129
FUImplementationDialog::name_
wxString name_
Definition: FUImplementationDialog.hh:158
FUImplementationDialog::ID_LABEL_CLK_PORT
@ ID_LABEL_CLK_PORT
Definition: FUImplementationDialog.hh:106
FUImplementationDialog::ID_RST_PORT
@ ID_RST_PORT
Definition: FUImplementationDialog.hh:109
FUImplementationDialog::ID_GLOCK_PORT
@ ID_GLOCK_PORT
Definition: FUImplementationDialog.hh:111
FUImplementationDialog::sourceList_
wxListCtrl * sourceList_
Pointer to the source file list widget.
Definition: FUImplementationDialog.hh:156
FUImplementationDialog::ID_DELETE_SOURCE
@ ID_DELETE_SOURCE
Definition: FUImplementationDialog.hh:126
FUImplementationDialog::ID_LINE
@ ID_LINE
Definition: FUImplementationDialog.hh:135
FUImplementationDialog::ID_DELETE_PARAMETER
@ ID_DELETE_PARAMETER
Definition: FUImplementationDialog.hh:130
FUImplementationDialog::onDeleteArchitecturePort
void onDeleteArchitecturePort(wxCommandEvent &event)
FUImplementationDialog::ID_GLOCK_REQ_PORT
@ ID_GLOCK_REQ_PORT
Definition: FUImplementationDialog.hh:113
FUImplementationDialog::onClearOpcode
void onClearOpcode(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:756
FUImplementationDialog::clkPort_
wxString clkPort_
Definition: FUImplementationDialog.hh:160
HDB::Parameter
Definition: HDBTypes.hh:46
FUImplementationDialog::onEditArchitecturePort
void onEditArchitecturePort(wxCommandEvent &event)
Definition: FUImplementationDialog.cc:383
FUImplementationDialog::ID_LABEL_GLOCK_REQ_PORT
@ ID_LABEL_GLOCK_REQ_PORT
Definition: FUImplementationDialog.hh:112
FUImplementationDialog::ID_OPCODE_LIST
@ ID_OPCODE_LIST
Definition: FUImplementationDialog.hh:114
FUImplementationDialog::implementation_
HDB::FUImplementation & implementation_
FU Implementation to modify.
Definition: FUImplementationDialog.hh:141
TTAMachine
Definition: Assembler.hh:48
FUImplementationDialog::onExternalPortSelection
void onExternalPortSelection(wxListEvent &event)
Definition: FUImplementationDialog.cc:522
FUImplementationDialog::onParameterSelection
void onParameterSelection(wxListEvent &event)
Definition: FUImplementationDialog.cc:655
FUImplementationDialog::ID_ADD_EXTERNAL_PORT
@ ID_ADD_EXTERNAL_PORT
Definition: FUImplementationDialog.hh:121
FUImplementationDialog::ID_LABEL_RST_PORT
@ ID_LABEL_RST_PORT
Definition: FUImplementationDialog.hh:108
FUImplementationDialog::architecture_
const TTAMachine::FunctionUnit & architecture_
Function unit architecture the FUImplementation implements.
Definition: FUImplementationDialog.hh:143
FUImplementationDialog::opcodePort_
wxString opcodePort_
Definition: FUImplementationDialog.hh:159
FUImplementationDialog::opcodeList_
wxListCtrl * opcodeList_
Pointer to the opcode list widget.
Definition: FUImplementationDialog.hh:154
FUImplementationDialog::gLockReqPort_
wxString gLockReqPort_
Definition: FUImplementationDialog.hh:163
FUImplementationDialog::onArchPortSelection
void onArchPortSelection(wxListEvent &event)
Definition: FUImplementationDialog.cc:407
FUImplementationDialog::selectedExternalPort
HDB::FUExternalPort * selectedExternalPort()
Definition: FUImplementationDialog.cc:694