OpenASIP  2.0
AddRFFromHDBDialog.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 AddRFFromHDBDialog.hh
26  *
27  * Declaration of AddRFFromHDBDialog 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_ADD_RF_FROM_HDB_DIALOG_HH
34 #define TTA_ADD_RF_FROM_HDB_DIALOG_HH
35 
36 #include <map>
37 #include <wx/wx.h>
38 #include <wx/listctrl.h>
39 
40 class Model;
41 
42 struct ListItemData {
43  int id;
44  int width;
45  int size;
46  int readPorts;
49  int maxReads;
50  int maxWrites;
51  int hdbId;
52  wxString path;
53 };
54 
55 namespace HDB {
56  class RFArchitecture;
57  class HDBManager;
58 }
59 
60 /**
61  * Dialog for adding register file architectures directly from HDB to the
62  * current machine.
63  */
64 class AddRFFromHDBDialog : public wxDialog {
65 public:
66  AddRFFromHDBDialog(wxWindow* parent, Model* model);
67  virtual ~AddRFFromHDBDialog();
68 
69 private:
70  virtual bool TransferDataToWindow();
71  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
72  void onListSelectionChange(wxListEvent& event);
73  void onAdd(wxCommandEvent& event);
74  void onClose(wxCommandEvent& event);
75  bool loadHDB(const HDB::HDBManager& manager);
76  void onColumnClick(wxListEvent& event);
77  void setColumnImage(int col, int image);
78 
79  /// Model of the current adf file.
81  /// Immediate slot list widget.
82  wxListCtrl* list_;
83  /// Map of rf architectures displayed in the dialog list.
84  std::map<int, HDB::RFArchitecture*> rfArchitectures_;
85 
87  bool sortASC_;
88 
89  enum {
90  ID_LIST = 10000,
94  };
95 
96  /// Default size for the rf, if the size is parameterized in the HDB.
97  static const int DEFAULT_SIZE;
98  /// Default bit width for the rf, if the size is parameterized in the HDB.
99  static const int DEFAULT_WIDTH;
100  /// File filter for the HDB files.
101  static const wxString HDB_FILE_FILTER;
102 
103  DECLARE_EVENT_TABLE()
104 };
105 #endif
AddRFFromHDBDialog::~AddRFFromHDBDialog
virtual ~AddRFFromHDBDialog()
Definition: AddRFFromHDBDialog.cc:183
HDB
Definition: CostDatabase.hh:49
AddRFFromHDBDialog::DEFAULT_SIZE
static const int DEFAULT_SIZE
Default size for the rf, if the size is parameterized in the HDB.
Definition: AddRFFromHDBDialog.hh:97
AddRFFromHDBDialog::ID_CLOSE
@ ID_CLOSE
Definition: AddRFFromHDBDialog.hh:92
AddRFFromHDBDialog::model_
Model * model_
Model of the current adf file.
Definition: AddRFFromHDBDialog.hh:80
AddRFFromHDBDialog::onListSelectionChange
void onListSelectionChange(wxListEvent &event)
Definition: AddRFFromHDBDialog.cc:296
AddRFFromHDBDialog::onClose
void onClose(wxCommandEvent &event)
Definition: AddRFFromHDBDialog.cc:373
ListItemData::size
int size
Definition: AddIUFromHDBDialog.hh:46
ListItemData::readPorts
int readPorts
Definition: AddIUFromHDBDialog.hh:47
ListItemData::bidirPorts
int bidirPorts
Definition: AddRFFromHDBDialog.hh:48
ListItemData::id
int id
Definition: AddFUFromHDBDialog.hh:48
AddRFFromHDBDialog::loadHDB
bool loadHDB(const HDB::HDBManager &manager)
Definition: AddRFFromHDBDialog.cc:231
AddRFFromHDBDialog::sortASC_
bool sortASC_
Definition: AddRFFromHDBDialog.hh:87
AddRFFromHDBDialog::DEFAULT_WIDTH
static const int DEFAULT_WIDTH
Default bit width for the rf, if the size is parameterized in the HDB.
Definition: AddRFFromHDBDialog.hh:99
AddRFFromHDBDialog
Definition: AddRFFromHDBDialog.hh:64
HDB::HDBManager
Definition: HDBManager.hh:82
AddRFFromHDBDialog::ID_LINE
@ ID_LINE
Definition: AddRFFromHDBDialog.hh:93
AddRFFromHDBDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: AddRFFromHDBDialog.cc:193
AddRFFromHDBDialog::list_
wxListCtrl * list_
Immediate slot list widget.
Definition: AddRFFromHDBDialog.hh:82
Model
Definition: Model.hh:50
ListItemData::maxReads
int maxReads
Definition: AddRFFromHDBDialog.hh:49
AddRFFromHDBDialog::ID_ADD
@ ID_ADD
Definition: AddRFFromHDBDialog.hh:91
ListItemData
Definition: AddFUFromHDBDialog.hh:47
ListItemData::writePorts
int writePorts
Definition: AddRFFromHDBDialog.hh:47
AddRFFromHDBDialog::HDB_FILE_FILTER
static const wxString HDB_FILE_FILTER
File filter for the HDB files.
Definition: AddRFFromHDBDialog.hh:101
AddRFFromHDBDialog::onAdd
void onAdd(wxCommandEvent &event)
Definition: AddRFFromHDBDialog.cc:309
AddRFFromHDBDialog::rfArchitectures_
std::map< int, HDB::RFArchitecture * > rfArchitectures_
Map of rf architectures displayed in the dialog list.
Definition: AddRFFromHDBDialog.hh:84
AddRFFromHDBDialog::AddRFFromHDBDialog
AddRFFromHDBDialog(wxWindow *parent, Model *model)
Definition: AddRFFromHDBDialog.cc:142
ListItemData::maxWrites
int maxWrites
Definition: AddRFFromHDBDialog.hh:50
AddRFFromHDBDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: AddRFFromHDBDialog.cc:387
AddRFFromHDBDialog::sortColumn_
int sortColumn_
Definition: AddRFFromHDBDialog.hh:86
ListItemData::width
int width
Definition: AddIUFromHDBDialog.hh:45
AddRFFromHDBDialog::ID_LIST
@ ID_LIST
Definition: AddRFFromHDBDialog.hh:90
ListItemData::path
wxString path
Definition: AddFUFromHDBDialog.hh:52
ListItemData::hdbId
int hdbId
Definition: AddFUFromHDBDialog.hh:51
AddRFFromHDBDialog::onColumnClick
void onColumnClick(wxListEvent &event)
Definition: AddRFFromHDBDialog.cc:421
AddRFFromHDBDialog::setColumnImage
void setColumnImage(int col, int image)
Definition: AddRFFromHDBDialog.cc:450