OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
RFArchitectureDialog Class Reference

#include <RFArchitectureDialog.hh>

Inheritance diagram for RFArchitectureDialog:
Inheritance graph
Collaboration diagram for RFArchitectureDialog:
Collaboration graph

Public Member Functions

 RFArchitectureDialog (wxWindow *parent, wxWindowID id, HDB::RFArchitecture &arch)
 
virtual ~RFArchitectureDialog ()
 

Private Types

enum  {
  ID_LABEL_SIZE = 10000 , ID_SIZE , ID_LABEL_WIDTH , ID_WIDTH ,
  ID_LABEL_READ_PORTS , ID_READ_PORTS , ID_LABEL_WRITE_PORTS , ID_WRITE_PORTS ,
  ID_LABEL_BIDIR_PORTS , ID_BIDIR_PORTS , ID_LABEL_MAX_READS , ID_MAX_READS ,
  ID_LABEL_MAX_WRITES , ID_MAX_WRITES , ID_PARAM_WIDTH , ID_PARAM_SIZE ,
  ID_GUARD_SUPPORT , ID_LINE , ID_ZERO_REGISTER
}
 Widget IDs. More...
 

Private Member Functions

void onOK (wxCommandEvent &event)
 
wxSizer * createContents (wxWindow *parent, bool call_fit, bool set_sizer)
 
void update ()
 

Private Attributes

HDB::RFArchitecturearch_
 
int size_
 
int width_
 
int readPorts_
 
int writePorts_
 
int bidirPorts_
 
int maxReads_
 
int maxWrites_
 
int latency_
 
bool guardSupport_
 
bool paramWidth_
 
bool paramSize_
 
bool zeroRegister_
 

Detailed Description

Dialog for defining RF architecture paramters to HDB.

Definition at line 46 of file RFArchitectureDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Widget IDs.

Enumerator
ID_LABEL_SIZE 
ID_SIZE 
ID_LABEL_WIDTH 
ID_WIDTH 
ID_LABEL_READ_PORTS 
ID_READ_PORTS 
ID_LABEL_WRITE_PORTS 
ID_WRITE_PORTS 
ID_LABEL_BIDIR_PORTS 
ID_BIDIR_PORTS 
ID_LABEL_MAX_READS 
ID_MAX_READS 
ID_LABEL_MAX_WRITES 
ID_MAX_WRITES 
ID_PARAM_WIDTH 
ID_PARAM_SIZE 
ID_GUARD_SUPPORT 
ID_LINE 
ID_ZERO_REGISTER 

Definition at line 58 of file RFArchitectureDialog.hh.

58 {
59 ID_LABEL_SIZE = 10000,
60 ID_SIZE,
76 ID_LINE,
78 };

Constructor & Destructor Documentation

◆ RFArchitectureDialog()

RFArchitectureDialog::RFArchitectureDialog ( wxWindow *  parent,
wxWindowID  id,
HDB::RFArchitecture arch 
)

The Constructor.

Parameters
parentParent window of the dialog.
idWindow identifier for the dialog.
archRegister file architecture to modify.

Definition at line 51 of file RFArchitectureDialog.cc.

52 :
53 wxDialog(parent, id, _T("Register file architecture.")),
54 arch_(arch), size_(0), width_(0) {
55
57 size_ = arch_.size();
58 }
59
61 width_ = arch_.width();
62 }
63
71
72
76 createContents(this, true, true);
77
78 FindWindow(ID_SIZE)->SetValidator(wxGenericValidator(&size_));
79 FindWindow(ID_WIDTH)->SetValidator(wxGenericValidator(&width_));
80 FindWindow(ID_MAX_READS)->SetValidator(wxGenericValidator(&maxReads_));
81 FindWindow(ID_MAX_WRITES)->SetValidator(wxGenericValidator(&maxWrites_));
82 FindWindow(ID_READ_PORTS)->SetValidator(wxGenericValidator(&readPorts_));
83 FindWindow(ID_WRITE_PORTS)->SetValidator(wxGenericValidator(&writePorts_));
84 FindWindow(ID_BIDIR_PORTS)->SetValidator(wxGenericValidator(&bidirPorts_));
85 FindWindow(ID_ZERO_REGISTER)->SetValidator(
86 wxGenericValidator(&zeroRegister_));
87
88
89 FindWindow(ID_PARAM_SIZE)->SetValidator(wxGenericValidator(&paramSize_));
90 FindWindow(ID_PARAM_WIDTH)->SetValidator(wxGenericValidator(&paramWidth_));
91 FindWindow(ID_GUARD_SUPPORT)->SetValidator(
92 wxGenericValidator(&guardSupport_));
93
94}
bool hasGuardSupport() const
bool hasParameterizedWidth() const
bool zeroRegister() const
bool hasParameterizedSize() const
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
HDB::RFArchitecture & arch_

◆ ~RFArchitectureDialog()

RFArchitectureDialog::~RFArchitectureDialog ( )
virtual

The Destructor.

Definition at line 99 of file RFArchitectureDialog.cc.

99 {
100}

Member Function Documentation

◆ createContents()

wxSizer * RFArchitectureDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the dialog contents.

Definition at line 134 of file RFArchitectureDialog.cc.

135 {
136
137 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
138
139 wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL );
140
141 wxFlexGridSizer *item2 = new wxFlexGridSizer( 2, 0, 0 );
142
143 wxStaticText *item3 = new wxStaticText( parent, ID_LABEL_SIZE, wxT("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
144 item2->Add( item3, 0, wxALL, 5 );
145
146 wxSpinCtrl *item4 = new wxSpinCtrl( parent, ID_SIZE, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 10000, 0 );
147 item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
148
149 wxStaticText *item5 = new wxStaticText( parent, ID_LABEL_WIDTH, wxT("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
150 item2->Add( item5, 0, wxALL, 5 );
151
152 wxSpinCtrl *item6 = new wxSpinCtrl( parent, ID_WIDTH, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 10000, 0 );
153 item2->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
154
155 // Modifying latency disabled for now!
156 //wxStaticText *item7 = new wxStaticText( parent, ID_LABEL_LATENCY, wxT("Latency:"), wxDefaultPosition, wxDefaultSize, 0 );
157 //item2->Add( item7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
158
159 //wxSpinCtrl *item8 = new wxSpinCtrl( parent, ID_LATENCY, wxT("0"), wxDefaultPosition, wxSize(100,-1), 0, 0, 100, 0 );
160 //item2->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
161
162 wxStaticText *item9 = new wxStaticText( parent, ID_LABEL_MAX_READS, wxT("Max reads:"), wxDefaultPosition, wxDefaultSize, 0 );
163 item2->Add( item9, 0, wxALL, 5 );
164
165 wxSpinCtrl *item10 = new wxSpinCtrl( parent, ID_MAX_READS, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 10000, 0 );
166 item2->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
167
168 wxStaticText *item11 = new wxStaticText( parent, ID_LABEL_MAX_WRITES, wxT("Max writes:"), wxDefaultPosition, wxDefaultSize, 0 );
169 item2->Add( item11, 0, wxALL, 5 );
170
171 wxSpinCtrl *item12 = new wxSpinCtrl( parent, ID_MAX_WRITES, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 100, 0 );
172 item2->Add( item12, 0, wxALIGN_CENTER|wxALL, 5 );
173
174 wxStaticText *item13 = new wxStaticText( parent, ID_LABEL_READ_PORTS, wxT("Read ports:"), wxDefaultPosition, wxDefaultSize, 0 );
175 item2->Add( item13, 0, wxALL, 5 );
176
177 wxSpinCtrl *item14 = new wxSpinCtrl( parent, ID_READ_PORTS, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 100, 0 );
178 item2->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
179
180 wxStaticText *item15 = new wxStaticText( parent, ID_LABEL_WRITE_PORTS, wxT("Write ports:"), wxDefaultPosition, wxDefaultSize, 0 );
181 item2->Add( item15, 0, wxALL, 5 );
182
183 wxSpinCtrl *item16 = new wxSpinCtrl( parent, ID_WRITE_PORTS, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 100, 0 );
184 item2->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
185
186 wxStaticText *item17 = new wxStaticText( parent, ID_LABEL_BIDIR_PORTS, wxT("Bidirectional ports:"), wxDefaultPosition, wxDefaultSize, 0 );
187 item2->Add( item17, 0, wxALL, 5 );
188
189 wxSpinCtrl *item18 = new wxSpinCtrl( parent, ID_BIDIR_PORTS, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 100, 0 );
190 item2->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
191
192 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
193
194 wxBoxSizer *item19 = new wxBoxSizer( wxVERTICAL );
195
196 wxCheckBox *item20 = new wxCheckBox( parent, ID_PARAM_WIDTH, wxT("Parametrized width"), wxDefaultPosition, wxDefaultSize, 0 );
197 item19->Add( item20, 0, wxALL, 5 );
198
199 wxCheckBox *item21 = new wxCheckBox( parent, ID_PARAM_SIZE, wxT("Parametrized size"), wxDefaultPosition, wxDefaultSize, 0 );
200 item19->Add( item21, 0, wxALL, 5 );
201
202 wxCheckBox *item22 = new wxCheckBox( parent, ID_GUARD_SUPPORT, wxT("Guard support"), wxDefaultPosition, wxDefaultSize, 0 );
203 item19->Add( item22, 0, wxALL, 5 );
204
205 item1->Add( item19, 0, wxALL, 5 );
206
207 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
208
209 wxStaticLine *item23 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
210 item0->Add( item23, 0, wxGROW|wxALL, 5 );
211
212 wxBoxSizer *item24 = new wxBoxSizer( wxHORIZONTAL );
213
214 wxButton *item25 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
215 item24->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
216
217 wxButton *item26 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
218 item24->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
219
220 item0->Add( item24, 0, wxALL, 5 );
221
222 wxCheckBox *item27 = new wxCheckBox( parent, ID_ZERO_REGISTER, wxT("Zero register"), wxDefaultPosition, wxDefaultSize, 0 );
223 item19->Add( item27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
224
225 if (set_sizer)
226 {
227 parent->SetSizer( item0 );
228 if (call_fit)
229 item0->SetSizeHints( parent );
230 }
231
232 return item0;
233}

References ID_BIDIR_PORTS, ID_GUARD_SUPPORT, ID_LABEL_BIDIR_PORTS, ID_LABEL_MAX_READS, ID_LABEL_MAX_WRITES, ID_LABEL_READ_PORTS, ID_LABEL_SIZE, ID_LABEL_WIDTH, ID_LABEL_WRITE_PORTS, ID_LINE, ID_MAX_READS, ID_MAX_WRITES, ID_PARAM_SIZE, ID_PARAM_WIDTH, ID_READ_PORTS, ID_SIZE, ID_WIDTH, ID_WRITE_PORTS, and ID_ZERO_REGISTER.

◆ onOK()

void RFArchitectureDialog::onOK ( wxCommandEvent &  event)
private

Event handler for the dialog OK-button.

Definition at line 107 of file RFArchitectureDialog.cc.

107 {
108
109 TransferDataFromWindow();
110
111 if (!paramSize_) {
113 }
114 if (!paramWidth_) {
116 }
117
126
127 EndModal(wxID_OK);
128}
void setGuardSupport(bool supported)
void setZeroRegister(bool zeroRegister)
void setWritePortCount(int portCount)
void setBidirPortCount(int portCount)
void setSize(int size)
void setReadPortCount(int portCount)
void setWidth(int width)
void setMaxWrites(int maxWrites)
void setMaxReads(int maxReads)
void setLatency(int latency)

References arch_, bidirPorts_, guardSupport_, latency_, maxReads_, maxWrites_, paramSize_, paramWidth_, readPorts_, HDB::RFArchitecture::setBidirPortCount(), HDB::RFArchitecture::setGuardSupport(), HDB::RFArchitecture::setLatency(), HDB::RFArchitecture::setMaxReads(), HDB::RFArchitecture::setMaxWrites(), HDB::RFArchitecture::setReadPortCount(), HDB::RFArchitecture::setSize(), HDB::RFArchitecture::setWidth(), HDB::RFArchitecture::setWritePortCount(), HDB::RFArchitecture::setZeroRegister(), size_, width_, writePorts_, and zeroRegister_.

Here is the call graph for this function:

◆ update()

void RFArchitectureDialog::update ( )
private

Member Data Documentation

◆ arch_

HDB::RFArchitecture& RFArchitectureDialog::arch_
private

Definition at line 80 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ bidirPorts_

int RFArchitectureDialog::bidirPorts_
private

Definition at line 86 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ guardSupport_

bool RFArchitectureDialog::guardSupport_
private

Definition at line 90 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ latency_

int RFArchitectureDialog::latency_
private

Definition at line 89 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ maxReads_

int RFArchitectureDialog::maxReads_
private

Definition at line 87 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ maxWrites_

int RFArchitectureDialog::maxWrites_
private

Definition at line 88 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ paramSize_

bool RFArchitectureDialog::paramSize_
private

Definition at line 92 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ paramWidth_

bool RFArchitectureDialog::paramWidth_
private

Definition at line 91 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ readPorts_

int RFArchitectureDialog::readPorts_
private

Definition at line 84 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ size_

int RFArchitectureDialog::size_
private

Definition at line 82 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ width_

int RFArchitectureDialog::width_
private

Definition at line 83 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ writePorts_

int RFArchitectureDialog::writePorts_
private

Definition at line 85 of file RFArchitectureDialog.hh.

Referenced by onOK().

◆ zeroRegister_

bool RFArchitectureDialog::zeroRegister_
private

Definition at line 93 of file RFArchitectureDialog.hh.

Referenced by onOK().


The documentation for this class was generated from the following files: