33 #include <wx/statline.h>
34 #include <wx/valgen.h>
35 #include <wx/spinctrl.h>
52 wxWindow* parent, wxWindowID
id,
HDB::RFArchitecture& arch) :
53 wxDialog(parent,
id, _T("Register file architecture.")),
54 arch_(arch), size_(0), width_(0) {
56 if (!arch_.hasParameterizedSize()) {
60 if (!arch_.hasParameterizedWidth()) {
61 width_ = arch_.width();
64 readPorts_ = arch_.readPortCount();
65 writePorts_ = arch_.writePortCount();
66 bidirPorts_ = arch_.bidirPortCount();
67 maxReads_ = arch_.maxReads();
68 maxWrites_ = arch_.maxWrites();
69 latency_ = arch_.latency();
70 zeroRegister_ = arch.zeroRegister();
73 paramWidth_ = arch_.hasParameterizedWidth();
74 paramSize_ = arch_.hasParameterizedSize();
75 guardSupport_ = arch_.hasGuardSupport();
76 createContents(
this,
true,
true);
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_));
86 wxGenericValidator(&zeroRegister_));
89 FindWindow(ID_PARAM_SIZE)->SetValidator(wxGenericValidator(¶mSize_));
90 FindWindow(ID_PARAM_WIDTH)->SetValidator(wxGenericValidator(¶mWidth_));
92 wxGenericValidator(&guardSupport_));
109 TransferDataFromWindow();
135 wxWindow *parent,
bool call_fit,
bool set_sizer) {
137 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
139 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
141 wxFlexGridSizer *item2 =
new wxFlexGridSizer( 2, 0, 0 );
143 wxStaticText *item3 =
new wxStaticText( parent,
ID_LABEL_SIZE, wxT(
"Size:"), wxDefaultPosition, wxDefaultSize, 0 );
144 item2->Add( item3, 0, wxALL, 5 );
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 );
149 wxStaticText *item5 =
new wxStaticText( parent,
ID_LABEL_WIDTH, wxT(
"Width:"), wxDefaultPosition, wxDefaultSize, 0 );
150 item2->Add( item5, 0, wxALL, 5 );
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 );
162 wxStaticText *item9 =
new wxStaticText( parent,
ID_LABEL_MAX_READS, wxT(
"Max reads:"), wxDefaultPosition, wxDefaultSize, 0 );
163 item2->Add( item9, 0, wxALL, 5 );
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 );
168 wxStaticText *item11 =
new wxStaticText( parent,
ID_LABEL_MAX_WRITES, wxT(
"Max writes:"), wxDefaultPosition, wxDefaultSize, 0 );
169 item2->Add( item11, 0, wxALL, 5 );
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 );
174 wxStaticText *item13 =
new wxStaticText( parent,
ID_LABEL_READ_PORTS, wxT(
"Read ports:"), wxDefaultPosition, wxDefaultSize, 0 );
175 item2->Add( item13, 0, wxALL, 5 );
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 );
180 wxStaticText *item15 =
new wxStaticText( parent,
ID_LABEL_WRITE_PORTS, wxT(
"Write ports:"), wxDefaultPosition, wxDefaultSize, 0 );
181 item2->Add( item15, 0, wxALL, 5 );
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 );
186 wxStaticText *item17 =
new wxStaticText( parent,
ID_LABEL_BIDIR_PORTS, wxT(
"Bidirectional ports:"), wxDefaultPosition, wxDefaultSize, 0 );
187 item2->Add( item17, 0, wxALL, 5 );
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 );
192 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
194 wxBoxSizer *item19 =
new wxBoxSizer( wxVERTICAL );
196 wxCheckBox *item20 =
new wxCheckBox( parent,
ID_PARAM_WIDTH, wxT(
"Parametrized width"), wxDefaultPosition, wxDefaultSize, 0 );
197 item19->Add( item20, 0, wxALL, 5 );
199 wxCheckBox *item21 =
new wxCheckBox( parent,
ID_PARAM_SIZE, wxT(
"Parametrized size"), wxDefaultPosition, wxDefaultSize, 0 );
200 item19->Add( item21, 0, wxALL, 5 );
202 wxCheckBox *item22 =
new wxCheckBox( parent,
ID_GUARD_SUPPORT, wxT(
"Guard support"), wxDefaultPosition, wxDefaultSize, 0 );
203 item19->Add( item22, 0, wxALL, 5 );
205 item1->Add( item19, 0, wxALL, 5 );
207 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
209 wxStaticLine *item23 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
210 item0->Add( item23, 0, wxGROW|wxALL, 5 );
212 wxBoxSizer *item24 =
new wxBoxSizer( wxHORIZONTAL );
214 wxButton *item25 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
215 item24->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
217 wxButton *item26 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
218 item24->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
220 item0->Add( item24, 0, wxALL, 5 );
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 );
227 parent->SetSizer( item0 );
229 item0->SetSizeHints( parent );