OpenASIP  2.0
AutoSelectImplementationsDialog.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 AutoSelectImplementationsDialog.hh
26  *
27  * Declaration of AutoSelectImplementationsDialog class.
28  *
29  * @author Mikko Järvelä 2013 (jarvela7-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_AUTO_SELECT_IMPLEMENTATIONS_DIALOG_HH
34 #define TTA_AUTO_SELECT_IMPLEMENTATIONS_DIALOG_HH
35 
36 #include <wx/wx.h>
37 #include "TCEString.hh"
38 #include "Machine.hh"
39 #include "HDBManager.hh"
41 
42 namespace IDF {
43  class MachineImplementation;
44  class UnitImplementationLocation;
45 }
46 
47 namespace HDB {
48  class HDBManager;
49 }
50 
51 namespace TTAMachine {
52  class Machine;
53 }
54 
55 /**
56  * Dialog for searching and selecting implementations for empty RF/IU/FU
57  * units automatically from user chosen HDB file.
58  */
59 class AutoSelectImplementationsDialog : public wxDialog {
60 public:
62  wxWindow* parent,
66 
67 private:
68  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
69 
70  void onBrowse(wxCommandEvent& event);
71  void onClose(wxCommandEvent& event);
72  void onFind(wxCommandEvent& event);
73 
77 
78  /// Machine containing navigators fo RFs, IUs and FUs.
80  // Contains machine's implementation.
82 
83  /// Choice selection for list of HDB files.
84  wxChoice* hdbChoice_;
85 
86  /// Checkbox widget for register file flag.
87  wxCheckBox* cboxRF_;
88  /// Checkbox widget for immediate unit flag.
89  wxCheckBox* cboxIU_;
90  /// Checkbox widget for function unit flag.
91  wxCheckBox* cboxFU_;
92 
93  /// Set for hdb paths.
94  std::set<TCEString> hdbs_;
95 
96  // Default HDB file to set in the beginning
97  static const std::string defaultHDB_;
98 
99  // HDB & ID pair for units without implementation
100  struct HdbIdPair {
102  int id;
103  };
104 
105  // units that are without implementation, but for which an
106  // implementation file was found (HDB & ID pair)
107  std::map<const IDF::UnitImplementationLocation*, HdbIdPair> foundRF_;
108  std::map<const IDF::UnitImplementationLocation*, HdbIdPair> foundIU_;
109  std::map<const IDF::UnitImplementationLocation*, HdbIdPair> foundFU_;
110 
111  enum {
121  };
122 
123  DECLARE_EVENT_TABLE()
124 };
125 #endif
AutoSelectImplementationsDialog::cboxIU_
wxCheckBox * cboxIU_
Checkbox widget for immediate unit flag.
Definition: AutoSelectImplementationsDialog.hh:89
AutoSelectImplementationsDialog::onBrowse
void onBrowse(wxCommandEvent &event)
Definition: AutoSelectImplementationsDialog.cc:121
HDB
Definition: CostDatabase.hh:49
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
AutoSelectImplementationsDialog::findRFImplementations
void findRFImplementations(HDB::HDBManager &hdb)
Definition: AutoSelectImplementationsDialog.cc:302
AutoSelectImplementationsDialog::ID_CLOSE
@ ID_CLOSE
Definition: AutoSelectImplementationsDialog.hh:120
AutoSelectImplementationsDialog::findFUImplementations
void findFUImplementations(HDB::HDBManager &hdb)
Definition: AutoSelectImplementationsDialog.cc:394
AutoSelectImplementationsDialog::cboxRF_
wxCheckBox * cboxRF_
Checkbox widget for register file flag.
Definition: AutoSelectImplementationsDialog.hh:87
AutoSelectImplementationsDialog
Definition: AutoSelectImplementationsDialog.hh:59
AutoSelectImplementationsDialog::ID_HDB_CHOICE
@ ID_HDB_CHOICE
Definition: AutoSelectImplementationsDialog.hh:112
AutoSelectImplementationsDialog::hdbs_
std::set< TCEString > hdbs_
Set for hdb paths.
Definition: AutoSelectImplementationsDialog.hh:94
AutoSelectImplementationsDialog::onFind
void onFind(wxCommandEvent &event)
Definition: AutoSelectImplementationsDialog.cc:156
TCEString.hh
AutoSelectImplementationsDialog::~AutoSelectImplementationsDialog
virtual ~AutoSelectImplementationsDialog()
Definition: AutoSelectImplementationsDialog.cc:114
AutoSelectImplementationsDialog::onClose
void onClose(wxCommandEvent &event)
Definition: AutoSelectImplementationsDialog.cc:144
AutoSelectImplementationsDialog::cboxFU_
wxCheckBox * cboxFU_
Checkbox widget for function unit flag.
Definition: AutoSelectImplementationsDialog.hh:91
AutoSelectImplementationsDialog::hdbChoice_
wxChoice * hdbChoice_
Choice selection for list of HDB files.
Definition: AutoSelectImplementationsDialog.hh:84
AutoSelectImplementationsDialog::ID_IU
@ ID_IU
Definition: AutoSelectImplementationsDialog.hh:118
AutoSelectImplementationsDialog::foundIU_
std::map< const IDF::UnitImplementationLocation *, HdbIdPair > foundIU_
Definition: AutoSelectImplementationsDialog.hh:108
AutoSelectImplementationsDialog::AutoSelectImplementationsDialog
AutoSelectImplementationsDialog(wxWindow *parent, TTAMachine::Machine &machine, IDF::MachineImplementation &impl)
Definition: AutoSelectImplementationsDialog.cc:69
AutoSelectImplementationsDialog::HdbIdPair::hdbFile
TCEString hdbFile
Definition: AutoSelectImplementationsDialog.hh:101
AutoSelectImplementationsDialog::machine_
TTAMachine::Machine & machine_
Machine containing navigators fo RFs, IUs and FUs.
Definition: AutoSelectImplementationsDialog.hh:79
AutoSelectImplementationsDialog::ID_BROWSE
@ ID_BROWSE
Definition: AutoSelectImplementationsDialog.hh:113
HDB::HDBManager
Definition: HDBManager.hh:82
AutoSelectImplementationsDialog::impl_
IDF::MachineImplementation & impl_
Definition: AutoSelectImplementationsDialog.hh:81
Machine.hh
AutoSelectImplementationsDialog::findIUImplementations
void findIUImplementations(HDB::HDBManager &hdb)
Definition: AutoSelectImplementationsDialog.cc:348
AutoSelectImplementationsDialog::HdbIdPair
Definition: AutoSelectImplementationsDialog.hh:100
AutoSelectImplementationsDialog::ID_FIND
@ ID_FIND
Definition: AutoSelectImplementationsDialog.hh:116
AutoSelectImplementationsDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: AutoSelectImplementationsDialog.cc:438
AutoSelectImplementationsDialog::HdbIdPair::id
int id
Definition: AutoSelectImplementationsDialog.hh:102
AutoSelectImplementationsDialog::ID_RF
@ ID_RF
Definition: AutoSelectImplementationsDialog.hh:117
AutoSelectImplementationsDialog::foundRF_
std::map< const IDF::UnitImplementationLocation *, HdbIdPair > foundRF_
Definition: AutoSelectImplementationsDialog.hh:107
TCEString
Definition: TCEString.hh:53
AutoSelectImplementationsDialog::foundFU_
std::map< const IDF::UnitImplementationLocation *, HdbIdPair > foundFU_
Definition: AutoSelectImplementationsDialog.hh:109
AutoSelectImplementationsDialog::ID_LINE
@ ID_LINE
Definition: AutoSelectImplementationsDialog.hh:114
AutoSelectImplementationsDialog::ID_FU
@ ID_FU
Definition: AutoSelectImplementationsDialog.hh:119
TTAMachine
Definition: Assembler.hh:48
HDBManager.hh
AutoSelectImplementationsDialog::ID_TEXT
@ ID_TEXT
Definition: AutoSelectImplementationsDialog.hh:115
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
UnitImplementationLocation.hh
AutoSelectImplementationsDialog::defaultHDB_
static const std::string defaultHDB_
Definition: AutoSelectImplementationsDialog.hh:97
IDF
Definition: DSDBManager.hh:54
TTAMachine::Machine
Definition: Machine.hh:73