OpenASIP 2.2
Loading...
Searching...
No Matches
RFDialog.cc
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.cc
26 *
27 * Definition of RFDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include <wx/valgen.h>
34#include <boost/format.hpp>
35
36#include "RFDialog.hh"
37#include "RFPortDialog.hh"
38#include "ModelConstants.hh"
39#include "ProDeConstants.hh"
40#include "WxConversion.hh"
41#include "Conversion.hh"
42#include "WarningDialog.hh"
43#include "InformationDialog.hh"
44#include "Machine.hh"
45#include "MachineTester.hh"
46#include "RegisterFile.hh"
47#include "UserManualCmd.hh"
48#include "Port.hh"
49#include "WidgetTools.hh"
50#include "GUITextGenerator.hh"
51#include "ProDeTextGenerator.hh"
52
53using boost::format;
54using std::string;
55using namespace TTAMachine;
56
57BEGIN_EVENT_TABLE(RFDialog, wxDialog)
58 EVT_TEXT(ID_NAME, RFDialog::onName)
60 EVT_BUTTON(ID_DELETE_PORT, RFDialog::onDeletePort)
61 EVT_BUTTON(ID_EDIT_PORT, RFDialog::onEditPort)
62 EVT_MENU(ID_EDIT_PORT, RFDialog::onEditPort)
63 EVT_MENU(ID_DELETE_PORT, RFDialog::onDeletePort)
65 EVT_LIST_ITEM_RIGHT_CLICK(ID_PORT_LIST, RFDialog::onPortRightClick)
66
68
69 EVT_LIST_ITEM_FOCUSED(ID_PORT_LIST, RFDialog::onPortSelection)
70 EVT_LIST_DELETE_ITEM(ID_PORT_LIST, RFDialog::onPortSelection)
74
75
76/**
77 * The Constructor.
78 *
79 * @param parent Parent window of the dialog.
80 * @param registerFile Register file to add/edit.
81 */
83 wxWindow* parent,
84 RegisterFile* registerFile):
85 wxDialog(parent, -1, _T(""), wxDefaultPosition),
86 registerFile_(registerFile),
87 name_(_T("")),
88 size_(1),
90 maxReads_(0),
91 maxWrites_(0),
92 zeroRegister_(false),
93 portListCtrl_(NULL),
94 typeChoice_(NULL) {
95
96 //registerFile_->updateMaxReadsAndWrites();
97 createContents(this, true, true);
98
99 FindWindow(wxID_OK)->Disable();
100 FindWindow(ID_EDIT_PORT)->Disable();
101 FindWindow(ID_DELETE_PORT)->Disable();
102
103 FindWindow(ID_NAME)->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
104
105 portListCtrl_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_PORT_LIST));
106 typeChoice_ = dynamic_cast<wxChoice*>(FindWindow(ID_TYPE));
107
108 // Set widget validators.
109 FindWindow(ID_WIDTH)->SetValidator(wxGenericValidator(&width_));
110 FindWindow(ID_SIZE)->SetValidator(wxGenericValidator(&size_));
111 FindWindow(ID_GUARD_LATENCY)->SetValidator(
112 wxGenericValidator(&guardLatency_));
113
114 FindWindow(ID_ZERO_REGISTER)->SetValidator(
115 wxGenericValidator(&zeroRegister_));
116
117 // set widget texts
118 setTexts();
119
120 TransferDataToWindow();
121}
122
123
124/**
125 * The Destructor.
126 */
129
130
131/**
132 * Sets texts for widgets.
133 */
134void
138
139 // Dialog title
140 format fmt = prodeTexts->text(ProDeTextGenerator::TXT_RF_DIALOG_TITLE);
141 SetTitle(WxConversion::toWxString(fmt.str()));
142
143 // buttons
144 WidgetTools::setLabel(generator, FindWindow(wxID_OK),
146
147 WidgetTools::setLabel(generator, FindWindow(wxID_CANCEL),
149
152
155
158
161
162 // widget labels
165
168
171
174
177
180
183
184 // choicer texts
186 typeChoice_->Append(WxConversion::toWxString(fmt.str()));
188 typeChoice_->Append(WxConversion::toWxString(fmt.str()));
190 typeChoice_->Append(WxConversion::toWxString(fmt.str()));
191
192 // box sizer label
195
196 // Create port list column.
197 wxListCtrl* portList =
198 dynamic_cast<wxListCtrl*>(FindWindow(ID_PORT_LIST));
199 fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_NAME);
200 portList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
201 wxLIST_FORMAT_LEFT, 200);
202}
203
204/**
205 * Transfers data from the RegisterFile object to the dialog widgets.
206 *
207 * @return false, if an error occured in the transfer.
208 */
209bool
211
213
214 return wxWindow::TransferDataToWindow();
215}
216
217
218/**
219 * Reads data form the RegisterFile and updates GUI.
220 *
221 */
222void
224
225 //registerFile_->updateMaxReadsAndWrites();
226
234
235 switch (registerFile_->type()) {
237 typeChoice_->SetSelection(0);
238 break;
240 typeChoice_->SetSelection(1);
241 break;
243 typeChoice_->SetSelection(2);
244 break;
245 default:
246 assert(false);
247 }
248
250
251 // wxWidgets GTK1 version seems to bug with spincontrol validators.
252 // The widget value has to be set manually.
253 dynamic_cast<wxSpinCtrl*>(FindWindow(ID_SIZE))->SetValue(size_);
254 dynamic_cast<wxSpinCtrl*>(FindWindow(ID_WIDTH))->SetValue(width_);
255 dynamic_cast<wxStaticText*>(FindWindow(ID_MAX_READS))->SetLabel(
257 dynamic_cast<wxStaticText*>(FindWindow(ID_MAX_WRITES))->SetLabel(
259 dynamic_cast<wxSpinCtrl*>(
261 dynamic_cast<wxCheckBox*>(
263}
264
265/**
266 * Updates the port list widget.
267 */
268void
270 portListCtrl_->DeleteAllItems();
271 for (int i=0; i < registerFile_->portCount(); i++) {
272
273 wxString name =
275
276 portListCtrl_->InsertItem(i, name);
277 }
278}
279
280
281/**
282 * Validates input in the controls, and updates the RegisterFile.
283 */
284void
285RFDialog::onOK(wxCommandEvent&) {
286 if (!Validate()) {
287 return;
288 }
289
290 if (!TransferDataFromWindow()) {
291 return;
292 }
293
294 string trimmedName =
295 WxConversion::toString(name_.Trim(false).Trim(true));
296
297 // Check the name validity.
298 if (!MachineTester::isValidComponentName(trimmedName)) {
300 format message =
302 InformationDialog warning(
303 this, WxConversion::toWxString(message.str()));
304 warning.ShowModal();
305 return;
306 }
307
308 if (registerFile_->name() != trimmedName) {
309
312
313 for (int i = 0; i < navigator.count(); i++) {
314 RegisterFile* rf = navigator.item(i);
315 if (trimmedName == rf->name()) {
316 ProDeTextGenerator* prodeTexts =
318 format message =
320 format a_rf =
322 format machine =
324 format rf =
326 message % trimmedName % a_rf.str() % machine.str() % rf.str();
327 WarningDialog warning(
328 this, WxConversion::toWxString(message.str()));
329 warning.ShowModal();
330 return;
331 }
332 }
333 }
334
335 try {
336 registerFile_->setName(trimmedName);
341 } catch (Exception& e) {
342 InformationDialog dialog(
344 dialog.ShowModal();
345 return;
346 }
347
348 // set register file type
349 switch (typeChoice_->GetSelection()) {
350 case 0:
352 break;
353 case 1:
355 break;
356 case 2:
358 break;
359 default:
360 assert(false);
361 }
362
363 //registerFile_->updateMaxReadsAndWrites();
364 EndModal(wxID_OK);
365}
366
367
368/**
369 * Checks whether name field is empty and disables OK button of the
370 * dialog if it is.
371 */
372void
373RFDialog::onName(wxCommandEvent&) {
374 if (!TransferDataFromWindow()) {
375 assert(false);
376 }
377 wxString trimmedName = name_.Trim(false).Trim(true);
378 if (trimmedName == _T("")) {
379 FindWindow(wxID_OK)->Disable();
380 } else {
381 FindWindow(wxID_OK)->Enable();
382 }
383}
384
385
386/**
387 * Returns pointer to the port which is selected on the port list.
388 *
389 * @return Pointer to the port which is selected on the port list.
390 */
391Port*
393 long item = -1;
394 item = portListCtrl_->GetNextItem(
395 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
396
397 if (item == -1) {
398 return NULL;
399 }
400
401 string portName =
402 WxConversion::toString(portListCtrl_->GetItemText(item));
403
404 return registerFile_->port(portName);
405}
406
407
408/**
409 * Creates and shows an empty RFPortDialog for adding ports.
410 */
411void
412RFDialog::onAddPort(wxCommandEvent&) {
413
414 // Generate name for the new port.
415 int i = 1;
418 while (registerFile_->hasPort(newName)) {
421 i++;
422 }
423
424 RFPort* port = new RFPort(newName, *registerFile_);
425 RFPortDialog portDialog(this, port);
426 if (portDialog.ShowModal() == wxID_OK) {
428 } else {
429 delete port;
430 }
431
433
434}
435
436
437/**
438 * Deletes selected port from the port list.
439 */
440void
441RFDialog::onDeletePort(wxCommandEvent&) {
442 Port* selected = selectedPort();
443 assert(selected != NULL);
444 delete selected;
446
448}
449
450
451/**
452 * Handles left mouse button double clicks on the port list.
453 */
454void
456 wxCommandEvent dummy;
458}
459
460
461/**
462 * Handles the 'Edit Port' button event.
463 *
464 * Opens a RFPortDialog with the selected port's attributes set.
465 */
466void
467RFDialog::onEditPort(wxCommandEvent&) {
468
469 Port* port = selectedPort();
470 if (port == NULL) {
471 // No port selected.
472 return;
473 }
474
475 RFPortDialog portDialog(this, port);
476 if (portDialog.ShowModal() == wxID_OK) {
478 }
479}
480
481/**
482 * Disables and enables Edit and Delete buttons under the port list.
483 *
484 * If a port is selected, buttons are enabled. If no port is selected the
485 * buttons will be disabled.
486 */
487void
489 if (portListCtrl_->GetSelectedItemCount() != 1) {
490 FindWindow(ID_DELETE_PORT)->Disable();
491 FindWindow(ID_EDIT_PORT)->Disable();
492 return;
493 }
494 FindWindow(ID_DELETE_PORT)->Enable();
495 FindWindow(ID_EDIT_PORT)->Enable();
496}
497
498
499/**
500 * Opens a pop-up menu when right mouse button was pressed.
501 *
502 * @param event Information about right mouse click event.
503 */
504void
505RFDialog::onPortRightClick(wxListEvent& event) {
506
507 portListCtrl_->SetItemState(event.GetIndex(), wxLIST_STATE_SELECTED,
508 wxLIST_STATE_SELECTED);
509
510 wxMenu* contextMenu = new wxMenu();
511
513 format button = prodeTexts->text(
515 contextMenu->Append(
517 button = prodeTexts->text(
519 contextMenu->Append(
521 portListCtrl_->PopupMenu(contextMenu, event.GetPoint());
522}
523
524
525/**
526 * Creates the dialog window contents.
527 *
528 * This method was generated with wxDesigner.
529 *
530 * @return Main sizer of the created contents.
531 * @param parent The dialog window.
532 * @param call_fit If true, fits the contents inside the dialog.
533 * @param set_sizer If true, sets the main sizer as dialog contents.
534 */
535wxSizer*
536RFDialog::createContents(wxWindow *parent, bool call_fit, bool set_sizer) {
537
538 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
539
540 wxFlexGridSizer *item1 = new wxFlexGridSizer( 2, 0, 0 );
541
542 wxStaticText *item2 = new wxStaticText( parent, ID_LABEL_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
543 item1->Add( item2, 0, wxALIGN_RIGHT|wxALL, 5 );
544
545 wxTextCtrl *item3 = new wxTextCtrl( parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(200,-1), 0 );
546 item1->Add( item3, 0, wxGROW|wxALL, 5 );
547
548 wxStaticText *item4 = new wxStaticText( parent, ID_LABEL_TYPE, wxT("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
549 item1->Add( item4, 0, wxALIGN_RIGHT|wxALL, 5 );
550
551 wxString *strs5 = (wxString*) NULL;
552 wxChoice *item5 = new wxChoice( parent, ID_TYPE, wxDefaultPosition, wxSize(100,-1), 0, strs5, 0 );
553 item1->Add( item5, 0, wxGROW|wxALL, 5 );
554
555 wxStaticText *item6 = new wxStaticText( parent, ID_LABEL_SIZE, wxT("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
556 item1->Add( item6, 0, wxALIGN_RIGHT|wxALL, 5 );
557
558 wxSpinCtrl *item7 = new wxSpinCtrl( parent, ID_SIZE, wxT("1"), wxDefaultPosition, wxSize(-1,-1), 0, 1, 10000, 1 );
559 item1->Add( item7, 0, wxGROW|wxALL, 5 );
560
561 wxStaticText *item8 = new wxStaticText( parent, ID_LABEL_WIDTH, wxT("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
562 item1->Add( item8, 0, wxALIGN_RIGHT|wxALL, 5 );
563
564 wxSpinCtrl *item9 = new wxSpinCtrl( parent, ID_WIDTH, wxT("1"), wxDefaultPosition, wxSize(-1,-1), 0, 1, 10000, 1 );
565 item1->Add( item9, 0, wxGROW|wxALL, 5 );
566
567 wxStaticText *item10 = new wxStaticText( parent, ID_LABEL_MAX_READS, wxT("Max-Reads:"), wxDefaultPosition, wxDefaultSize, 0 );
568 item1->Add( item10, 0, wxALIGN_RIGHT|wxALL, 5 );
569
570 wxStaticText *item11 = new wxStaticText( parent, ID_MAX_READS, wxT("0"), wxDefaultPosition, wxSize(100,-1), 0);
571 item1->Add( item11, 0, wxGROW|wxALL, 5 );
572
573 wxStaticText *item12 = new wxStaticText( parent, ID_LABEL_MAX_WRITES, wxT("Max-Writes:"), wxDefaultPosition, wxDefaultSize, 0 );
574 item1->Add( item12, 0, wxALIGN_RIGHT|wxALL, 5 );
575
576 wxStaticText *item13 = new wxStaticText( parent, ID_MAX_WRITES, wxT("0"), wxDefaultPosition, wxSize(100,-1), 0);
577 item1->Add( item13, 0, wxGROW|wxALL, 5 );
578
579 wxStaticText *item14 = new wxStaticText( parent, ID_LABEL_GUARD_LATENCY, wxT("Guard Latency:"), wxDefaultPosition, wxDefaultSize, 0 );
580 item1->Add( item14, 0, wxALIGN_RIGHT|wxALL, 5 );
581
582 wxSpinCtrl *item15 = new wxSpinCtrl( parent, ID_GUARD_LATENCY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 1, 0 );
583 item1->Add( item15, 0, wxGROW|wxALL, 5 );
584
585 item0->Add( item1, 0, wxGROW|wxALL, 5 );
586
587 wxStaticBox *item17 = new wxStaticBox( parent, -1, wxT("Ports:") );
588 wxStaticBoxSizer *item16 = new wxStaticBoxSizer( item17, wxVERTICAL );
589 portsSizer_ = item16;
590
591 wxListCtrl *item18 = new wxListCtrl( parent, ID_PORT_LIST, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER );
592 item16->Add( item18, 0, wxGROW|wxALL, 5 );
593
594 wxBoxSizer *item19 = new wxBoxSizer( wxHORIZONTAL );
595
596 wxButton *item20 = new wxButton( parent, ID_ADD_PORT, wxT("&Add.."), wxDefaultPosition, wxDefaultSize, 0 );
597 item19->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
598
599 wxButton *item21 = new wxButton( parent, ID_EDIT_PORT, wxT("&Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
600 item19->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
601
602 wxButton *item22 = new wxButton( parent, ID_DELETE_PORT, wxT("&Delete"), wxDefaultPosition, wxDefaultSize, 0 );
603 item19->Add( item22, 0, wxALIGN_CENTER|wxALL, 5 );
604
605 item16->Add( item19, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
606
607 item0->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
608
609 wxBoxSizer *item23 = new wxBoxSizer( wxHORIZONTAL );
610
611 wxButton *item24 = new wxButton( parent, ID_HELP, wxT("&Help"), wxDefaultPosition, wxDefaultSize, 0 );
612 item23->Add( item24, 0, wxALIGN_CENTER|wxALL, 5 );
613
614 wxButton *item25 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
615 item23->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
616
617 wxButton *item26 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
618 item23->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
619
620 item0->Add( item23, 0, wxALIGN_CENTER|wxALL, 5 );
621
622 wxCheckBox *item27 = new wxCheckBox( parent, ID_ZERO_REGISTER, wxT("Zero register"), wxDefaultPosition, wxDefaultSize, 0);
623 item1->Add( item27, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
624
625 if (set_sizer)
626 {
627 parent->SetSizer( item0 );
628 if (call_fit)
629 item0->SetSizeHints( parent );
630 }
631
632 return item0;
633}
#define assert(condition)
END_EVENT_TABLE() using namespace IDF
TTAMachine::Machine * machine
the architecture definition of the estimated processor
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection EVT_LIST_ITEM_DESELECTED(ID_ARCH_PORT_LIST, FUImplementationDialog::onArchPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_ARCH_PORT_LIST
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection FUImplementationDialog::onArchPortActivation EVT_LIST_ITEM_SELECTED(ID_EXTERNAL_PORT_LIST, FUImplementationDialog::onExternalPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_EXTERNAL_PORT_LIST
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection FUImplementationDialog::onArchPortActivation FUImplementationDialog::onExternalPortActivation FUImplementationDialog::onParameterSelection EVT_LIST_ITEM_ACTIVATED(ID_PARAMETER_LIST, FUImplementationDialog::onParameterActivation) EVT_LIST_ITEM_DESELECTED(ID_PARAMETER_LIST
EVT_BUTTON(ID_EDIT_ARCH_PORT, FUImplementationDialog::onEditArchitecturePort) EVT_BUTTON(ID_ADD_EXTERNAL_PORT
const int DEFAULT_WIDTH
Default window width.
find Finds info of the inner loops in the false
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
static std::string toString(const T &source)
std::string errorMessage() const
Definition Exception.cc:123
@ TXT_BUTTON_EDIT_DIALOG
Label for edit button (with trailing ...).
@ TXT_BUTTON_ADD_DIALOG
Label for add button (with trailing ...).
@ TXT_BUTTON_HELP
Label for help button.
@ TXT_BUTTON_DELETE
Label for delete button.
@ TXT_BUTTON_CANCEL
Label for cancel button.
@ TXT_BUTTON_OK
Label for OK button.
static GUITextGenerator * instance()
static bool isValidComponentName(const std::string &name)
static const std::string COMP_NEW_NAME_PREFIX_PORT
Prefix for new port names.
static ProDeTextGenerator * instance()
@ MSG_ERROR_SAME_NAME
Error: Same name exists.
@ MSG_ERROR_ILLEGAL_NAME
Error: Illegal component name.
@ TXT_LABEL_BUTTON_EDIT
Label for &Edit... button.
@ TXT_LABEL_NAME
Label for component name widget.
@ TXT_LABEL_MAX_READS
Label for Max-Reads widget.
@ COMP_REGISTER_FILE
Register file (w/o article).
@ TXT_LABEL_WIDTH
Label for bit width widget.
@ TXT_LABEL_MAX_WRITES
Label for Max-Writes widget.
@ COMP_MACHINE
Text for machine description.
@ TXT_LABEL_BUTTON_DELETE
Label for &Delete button.
@ TXT_LABEL_TYPE
Label for type widget.
@ TXT_RF_PORTS_BOX
Ports box title.
@ TXT_RF_TYPE_NORMAL
Register file type: normal.
@ TXT_LABEL_GUARD_LATENCY
Label for guard latency.
@ TXT_RF_TYPE_VOLATILE
Register file type: volatile.
@ TXT_LABEL_SIZE
Label for size widget.
@ TXT_RF_DIALOG_TITLE
Register file Dialog title.
@ COMP_A_REGISTER_FILE
Register file (w/ article).
@ TXT_COLUMN_NAME
Label for name column in a list.
@ TXT_RF_TYPE_RESERVED
Register file type: reserved.
void onName(wxCommandEvent &event)
Definition RFDialog.cc:373
int size_
Number of registers.
Definition RFDialog.hh:77
virtual bool TransferDataToWindow()
Definition RFDialog.cc:210
void onDeletePort(wxCommandEvent &event)
Definition RFDialog.cc:441
int maxWrites_
Maximum writes.
Definition RFDialog.hh:83
void updatePortList()
Definition RFDialog.cc:269
wxListCtrl * portListCtrl_
Port list control.
Definition RFDialog.hh:90
void onOK(wxCommandEvent &event)
Definition RFDialog.cc:285
void updateWidgets()
Definition RFDialog.cc:223
wxStaticBoxSizer * portsSizer_
Sizer containing the port list and associated buttons.
Definition RFDialog.hh:70
void setTexts()
Definition RFDialog.cc:135
@ ID_LABEL_MAX_WRITES
Definition RFDialog.hh:113
@ ID_LABEL_MAX_READS
Definition RFDialog.hh:112
@ ID_ADD_PORT
Definition RFDialog.hh:104
@ ID_LABEL_SIZE
Definition RFDialog.hh:109
@ ID_DELETE_PORT
Definition RFDialog.hh:106
@ ID_EDIT_PORT
Definition RFDialog.hh:105
@ ID_LABEL_NAME
Definition RFDialog.hh:108
@ ID_MAX_READS
Definition RFDialog.hh:100
@ ID_GUARD_LATENCY
Definition RFDialog.hh:102
@ ID_LABEL_WIDTH
Definition RFDialog.hh:110
@ ID_LABEL_GUARD_LATENCY
Definition RFDialog.hh:114
@ ID_MAX_WRITES
Definition RFDialog.hh:101
@ ID_ZERO_REGISTER
Definition RFDialog.hh:115
@ ID_LABEL_TYPE
Definition RFDialog.hh:111
@ ID_PORT_LIST
Definition RFDialog.hh:103
TTAMachine::Port * selectedPort() const
Definition RFDialog.cc:392
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition RFDialog.cc:536
wxString name_
Name of the register file.
Definition RFDialog.hh:75
wxChoice * typeChoice_
Opcode choice control.
Definition RFDialog.hh:92
void onAddPort(wxCommandEvent &event)
Definition RFDialog.cc:412
void onActivatePort(wxListEvent &event)
Definition RFDialog.cc:455
int width_
Width.
Definition RFDialog.hh:79
virtual ~RFDialog()
Definition RFDialog.cc:127
void onPortRightClick(wxListEvent &event)
Definition RFDialog.cc:505
int maxReads_
Max reads.
Definition RFDialog.hh:81
void onEditPort(wxCommandEvent &event)
Definition RFDialog.cc:467
TTAMachine::RegisterFile * registerFile_
Register file to modify.
Definition RFDialog.hh:73
void onPortSelection(wxListEvent &event)
Definition RFDialog.cc:488
int guardLatency_
Guard latency.
Definition RFDialog.hh:85
bool zeroRegister_
Zero register.
Definition RFDialog.hh:87
virtual int numberOfRegisters() const
virtual int width() const
virtual void setWidth(int width)
virtual RFPort * port(const std::string &name) const
virtual Machine * machine() const
virtual TCEString name() const
ComponentType * item(int index) const
virtual RegisterFileNavigator registerFileNavigator() const
Definition Machine.cc:450
virtual std::string name() const
Definition Port.cc:141
virtual void setType(RegisterFile::Type type)
virtual void setZeroRegister(const bool &value)
virtual int maxReads() const
virtual void setName(const std::string &name)
virtual bool zeroRegister() const
@ VOLATILE
Used for user-controlled I/O communication.
@ NORMAL
Used for general register allocation.
@ RESERVED
Used for custom, user controlled register allocation.
virtual void setGuardLatency(int latency)
virtual int guardLatency() const
virtual RegisterFile::Type type() const
virtual void setNumberOfRegisters(int registers)
virtual int maxWrites() const
virtual bool hasPort(const std::string &name) const
Definition Unit.cc:96
virtual int portCount() const
Definition Unit.cc:135
virtual boost::format text(int textId)
static void setWidgetLabel(wxWindow *widget, std::string text)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)