OpenASIP  2.0
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.

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 
56  if (!arch_.hasParameterizedSize()) {
57  size_ = arch_.size();
58  }
59 
61  width_ = arch_.width();
62  }
63 
70  zeroRegister_ = arch.zeroRegister();
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 }

◆ ~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

◆ 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:
RFArchitectureDialog::ID_LABEL_SIZE
@ ID_LABEL_SIZE
Definition: RFArchitectureDialog.hh:59
RFArchitectureDialog::readPorts_
int readPorts_
Definition: RFArchitectureDialog.hh:84
HDB::RFArchitecture::setReadPortCount
void setReadPortCount(int portCount)
Definition: RFArchitecture.cc:359
RFArchitectureDialog::ID_PARAM_SIZE
@ ID_PARAM_SIZE
Definition: RFArchitectureDialog.hh:74
HDB::RFArchitecture::maxReads
int maxReads() const
Definition: RFArchitecture.cc:447
RFArchitectureDialog::paramWidth_
bool paramWidth_
Definition: RFArchitectureDialog.hh:91
RFArchitectureDialog::maxReads_
int maxReads_
Definition: RFArchitectureDialog.hh:87
HDB::RFArchitecture::setLatency
void setLatency(int latency)
Definition: RFArchitecture.cc:484
RFArchitectureDialog::width_
int width_
Definition: RFArchitectureDialog.hh:83
HDB::RFArchitecture::latency
int latency() const
Definition: RFArchitecture.cc:497
RFArchitectureDialog::ID_LABEL_MAX_READS
@ ID_LABEL_MAX_READS
Definition: RFArchitectureDialog.hh:69
RFArchitectureDialog::size_
int size_
Definition: RFArchitectureDialog.hh:82
HDB::RFArchitecture::zeroRegister
bool zeroRegister() const
Definition: RFArchitecture.cc:541
RFArchitectureDialog::ID_SIZE
@ ID_SIZE
Definition: RFArchitectureDialog.hh:60
RFArchitectureDialog::ID_MAX_WRITES
@ ID_MAX_WRITES
Definition: RFArchitectureDialog.hh:72
HDB::RFArchitecture::setMaxWrites
void setMaxWrites(int maxWrites)
Definition: RFArchitecture.cc:459
HDB::RFArchitecture::setZeroRegister
void setZeroRegister(bool zeroRegister)
Definition: RFArchitecture.cc:530
FindWindow
Definition: FindWindow.hh:49
HDB::RFArchitecture::hasParameterizedSize
bool hasParameterizedSize() const
Definition: RFArchitecture.cc:282
RFArchitectureDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: RFArchitectureDialog.cc:134
HDB::RFArchitecture::setBidirPortCount
void setBidirPortCount(int portCount)
Definition: RFArchitecture.cc:409
RFArchitectureDialog::guardSupport_
bool guardSupport_
Definition: RFArchitectureDialog.hh:90
RFArchitectureDialog::ID_GUARD_SUPPORT
@ ID_GUARD_SUPPORT
Definition: RFArchitectureDialog.hh:75
HDB::RFArchitecture::width
int width() const
Definition: RFArchitecture.cc:343
RFArchitectureDialog::ID_LABEL_BIDIR_PORTS
@ ID_LABEL_BIDIR_PORTS
Definition: RFArchitectureDialog.hh:67
HDB::RFArchitecture::maxWrites
int maxWrites() const
Definition: RFArchitecture.cc:472
RFArchitectureDialog::ID_MAX_READS
@ ID_MAX_READS
Definition: RFArchitectureDialog.hh:70
HDB::RFArchitecture::hasParameterizedWidth
bool hasParameterizedWidth() const
Definition: RFArchitecture.cc:271
HDB::RFArchitecture::setWidth
void setWidth(int width)
Definition: RFArchitecture.cc:294
RFArchitectureDialog::bidirPorts_
int bidirPorts_
Definition: RFArchitectureDialog.hh:86
RFArchitectureDialog::ID_LINE
@ ID_LINE
Definition: RFArchitectureDialog.hh:76
RFArchitectureDialog::ID_LABEL_READ_PORTS
@ ID_LABEL_READ_PORTS
Definition: RFArchitectureDialog.hh:63
RFArchitectureDialog::ID_LABEL_WRITE_PORTS
@ ID_LABEL_WRITE_PORTS
Definition: RFArchitectureDialog.hh:65
RFArchitectureDialog::paramSize_
bool paramSize_
Definition: RFArchitectureDialog.hh:92
RFArchitectureDialog::arch_
HDB::RFArchitecture & arch_
Definition: RFArchitectureDialog.hh:80
RFArchitectureDialog::ID_WIDTH
@ ID_WIDTH
Definition: RFArchitectureDialog.hh:62
RFArchitectureDialog::ID_ZERO_REGISTER
@ ID_ZERO_REGISTER
Definition: RFArchitectureDialog.hh:77
HDB::RFArchitecture::hasGuardSupport
bool hasGuardSupport() const
Definition: RFArchitecture.cc:519
RFArchitectureDialog::ID_LABEL_WIDTH
@ ID_LABEL_WIDTH
Definition: RFArchitectureDialog.hh:61
RFArchitectureDialog::ID_BIDIR_PORTS
@ ID_BIDIR_PORTS
Definition: RFArchitectureDialog.hh:68
HDB::RFArchitecture::readPortCount
int readPortCount() const
Definition: RFArchitecture.cc:372
RFArchitectureDialog::maxWrites_
int maxWrites_
Definition: RFArchitectureDialog.hh:88
RFArchitectureDialog::ID_LABEL_MAX_WRITES
@ ID_LABEL_MAX_WRITES
Definition: RFArchitectureDialog.hh:71
HDB::RFArchitecture::size
int size() const
Definition: RFArchitecture.cc:326
RFArchitectureDialog::ID_PARAM_WIDTH
@ ID_PARAM_WIDTH
Definition: RFArchitectureDialog.hh:73
RFArchitectureDialog::latency_
int latency_
Definition: RFArchitectureDialog.hh:89
HDB::RFArchitecture::bidirPortCount
int bidirPortCount() const
Definition: RFArchitecture.cc:422
RFArchitectureDialog::ID_READ_PORTS
@ ID_READ_PORTS
Definition: RFArchitectureDialog.hh:64
RFArchitectureDialog::writePorts_
int writePorts_
Definition: RFArchitectureDialog.hh:85
HDB::RFArchitecture::setMaxReads
void setMaxReads(int maxReads)
Definition: RFArchitecture.cc:434
RFArchitectureDialog::zeroRegister_
bool zeroRegister_
Definition: RFArchitectureDialog.hh:93
HDB::RFArchitecture::setSize
void setSize(int size)
Definition: RFArchitecture.cc:310
RFArchitectureDialog::ID_WRITE_PORTS
@ ID_WRITE_PORTS
Definition: RFArchitectureDialog.hh:66
HDB::RFArchitecture::writePortCount
int writePortCount() const
Definition: RFArchitecture.cc:397
HDB::RFArchitecture::setGuardSupport
void setGuardSupport(bool supported)
Definition: RFArchitecture.cc:508
HDB::RFArchitecture::setWritePortCount
void setWritePortCount(int portCount)
Definition: RFArchitecture.cc:384