OpenASIP  2.0
RFDialog.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 RFDialog.hh
26  *
27  * Declaration of RFDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_RF_DIALOG_HH
33 #define TTA_RF_DIALOG_HH
34 
35 #include <wx/wx.h>
36 #include <wx/listctrl.h>
37 #include <wx/spinctrl.h>
38 
39 namespace TTAMachine {
40  class RegisterFile;
41  class Port;
42 }
43 
44 /**
45  * Dialog for editing register file parameters.
46  */
47 class RFDialog : public wxDialog {
48 public:
49  RFDialog(wxWindow* parent, TTAMachine::RegisterFile* registerFile);
50  virtual ~RFDialog();
51 
52 private:
53  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
54  virtual bool TransferDataToWindow();
56  void onOK(wxCommandEvent& event);
57  void onHelp(wxCommandEvent& event);
58  void onName(wxCommandEvent& event);
59  void onPortSelection(wxListEvent& event);
60  void onPortRightClick(wxListEvent& event);
61  void onAddPort(wxCommandEvent& event);
62  void onActivatePort(wxListEvent& event);
63  void onEditPort(wxCommandEvent& event);
64  void onDeletePort(wxCommandEvent& event);
65  void updateWidgets();
66  void updatePortList();
67  void setTexts();
68 
69  /// Sizer containing the port list and associated buttons.
70  wxStaticBoxSizer* portsSizer_;
71 
72  /// Register file to modify.
74  /// Name of the register file.
75  wxString name_;
76  /// Number of registers.
77  int size_;
78  /// Width.
79  int width_;
80  /// Max reads.
81  int maxReads_;
82  /// Maximum writes.
84  /// Guard latency.
86  /// Zero register
88 
89  /// Port list control.
90  wxListCtrl* portListCtrl_;
91  /// Opcode choice control.
92  wxChoice* typeChoice_;
93 
94  /// enumerated IDs for the dialog controls
95  enum {
96  ID_NAME = 10000,
116  };
117 
118  /// The event table for the controls of the dialog.
119  DECLARE_EVENT_TABLE()
120 };
121 #endif
RFDialog::name_
wxString name_
Name of the register file.
Definition: RFDialog.hh:75
RFDialog::portsSizer_
wxStaticBoxSizer * portsSizer_
Sizer containing the port list and associated buttons.
Definition: RFDialog.hh:70
RFDialog::ID_LABEL_MAX_READS
@ ID_LABEL_MAX_READS
Definition: RFDialog.hh:112
RFDialog::onPortRightClick
void onPortRightClick(wxListEvent &event)
Definition: RFDialog.cc:505
RFDialog::ID_LABEL_MAX_WRITES
@ ID_LABEL_MAX_WRITES
Definition: RFDialog.hh:113
RFDialog::ID_LABEL_TYPE
@ ID_LABEL_TYPE
Definition: RFDialog.hh:111
RFDialog::maxWrites_
int maxWrites_
Maximum writes.
Definition: RFDialog.hh:83
RFDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: RFDialog.cc:536
RFDialog::onPortSelection
void onPortSelection(wxListEvent &event)
Definition: RFDialog.cc:488
RFDialog::onActivatePort
void onActivatePort(wxListEvent &event)
Definition: RFDialog.cc:455
RFDialog::portListCtrl_
wxListCtrl * portListCtrl_
Port list control.
Definition: RFDialog.hh:90
RFDialog::ID_LABEL_WIDTH
@ ID_LABEL_WIDTH
Definition: RFDialog.hh:110
RFDialog::ID_WIDTH
@ ID_WIDTH
Definition: RFDialog.hh:99
RFDialog::ID_LABEL_SIZE
@ ID_LABEL_SIZE
Definition: RFDialog.hh:109
RFDialog::typeChoice_
wxChoice * typeChoice_
Opcode choice control.
Definition: RFDialog.hh:92
RFDialog::ID_DELETE_PORT
@ ID_DELETE_PORT
Definition: RFDialog.hh:106
RFDialog::onOK
void onOK(wxCommandEvent &event)
Definition: RFDialog.cc:285
RFDialog::guardLatency_
int guardLatency_
Guard latency.
Definition: RFDialog.hh:85
RFDialog::ID_ZERO_REGISTER
@ ID_ZERO_REGISTER
Definition: RFDialog.hh:115
RFDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: RFDialog.hh:108
RFDialog::ID_MAX_READS
@ ID_MAX_READS
Definition: RFDialog.hh:100
RFDialog::ID_ADD_PORT
@ ID_ADD_PORT
Definition: RFDialog.hh:104
RFDialog::setTexts
void setTexts()
Definition: RFDialog.cc:135
RFDialog::updatePortList
void updatePortList()
Definition: RFDialog.cc:269
RFDialog::ID_EDIT_PORT
@ ID_EDIT_PORT
Definition: RFDialog.hh:105
RFDialog::ID_LABEL_GUARD_LATENCY
@ ID_LABEL_GUARD_LATENCY
Definition: RFDialog.hh:114
TTAMachine::Port
Definition: Port.hh:54
RFDialog::onHelp
void onHelp(wxCommandEvent &event)
RFDialog::onEditPort
void onEditPort(wxCommandEvent &event)
Definition: RFDialog.cc:467
RFDialog::ID_MAX_WRITES
@ ID_MAX_WRITES
Definition: RFDialog.hh:101
RFDialog::ID_SIZE
@ ID_SIZE
Definition: RFDialog.hh:98
RFDialog::maxReads_
int maxReads_
Max reads.
Definition: RFDialog.hh:81
RFDialog::width_
int width_
Width.
Definition: RFDialog.hh:79
RFDialog::onName
void onName(wxCommandEvent &event)
Definition: RFDialog.cc:373
RFDialog::ID_TYPE
@ ID_TYPE
Definition: RFDialog.hh:97
RFDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: RFDialog.cc:210
RFDialog::size_
int size_
Number of registers.
Definition: RFDialog.hh:77
RFDialog::RFDialog
RFDialog(wxWindow *parent, TTAMachine::RegisterFile *registerFile)
Definition: RFDialog.cc:82
RFDialog::zeroRegister_
bool zeroRegister_
Zero register.
Definition: RFDialog.hh:87
RFDialog::selectedPort
TTAMachine::Port * selectedPort() const
Definition: RFDialog.cc:392
RFDialog::registerFile_
TTAMachine::RegisterFile * registerFile_
Register file to modify.
Definition: RFDialog.hh:73
RFDialog::ID_NAME
@ ID_NAME
Definition: RFDialog.hh:96
RFDialog::ID_GUARD_LATENCY
@ ID_GUARD_LATENCY
Definition: RFDialog.hh:102
RFDialog::updateWidgets
void updateWidgets()
Definition: RFDialog.cc:223
RFDialog::ID_PORT_LIST
@ ID_PORT_LIST
Definition: RFDialog.hh:103
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
RFDialog::onAddPort
void onAddPort(wxCommandEvent &event)
Definition: RFDialog.cc:412
TTAMachine
Definition: Assembler.hh:48
RFDialog::ID_HELP
@ ID_HELP
Definition: RFDialog.hh:107
RFDialog::~RFDialog
virtual ~RFDialog()
Definition: RFDialog.cc:127
RFDialog::onDeletePort
void onDeletePort(wxCommandEvent &event)
Definition: RFDialog.cc:441
RFDialog
Definition: RFDialog.hh:47