142 wxDialog(parent,
id, _T("Function
Unit Implementation")),
144 opcodeWarningShowed_(
false) {
146 createContents(
this,
true,
true);
149 archPortList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_ARCH_PORT_LIST));
151 dynamic_cast<wxListCtrl*
>(
FindWindow(ID_EXTERNAL_PORT_LIST));
152 parameterList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_PARAMETER_LIST));
153 sourceList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_SOURCE_LIST));
154 opcodeList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_OPCODE_LIST));
157 archPortList_->InsertColumn(0, _T(
"name"), wxLIST_FORMAT_LEFT, 130);
159 archPortList_->InsertColumn(
160 1, _T(
"architecture port"), wxLIST_FORMAT_LEFT, 130);
162 externalPortList_->InsertColumn(0, _T(
"name"), wxLIST_FORMAT_LEFT, 260);
164 parameterList_->InsertColumn(
165 0, _T(
"parameter"), wxLIST_FORMAT_LEFT, 180);
167 parameterList_->InsertColumn(
168 1, _T(
"value"), wxLIST_FORMAT_LEFT, 80);
170 opcodeList_->InsertColumn(
171 0, _T(
"operation"), wxLIST_FORMAT_LEFT, 180);
173 opcodeList_->InsertColumn(
174 1, _T(
"opcode"), wxLIST_FORMAT_LEFT, 80);
176 sourceList_->InsertColumn(
177 0, _T(
"source file"), wxLIST_FORMAT_LEFT, 260);
183 if (implementation_.clkPort().empty()) {
188 if (implementation_.rstPort().empty()) {
193 if (implementation_.glockPort().empty()) {
203 wxTextValidator(wxFILTER_ASCII, &name_));
205 wxTextValidator(wxFILTER_ASCII, &opcodePort_));
207 wxTextValidator(wxFILTER_ASCII, &clkPort_));
209 wxTextValidator(wxFILTER_ASCII, &rstPort_));
211 wxTextValidator(wxFILTER_ASCII, &gLockPort_));
213 wxTextValidator(wxFILTER_ASCII, &gLockReqPort_));
219 FindWindow(ID_DELETE_EXTERNAL_PORT)->Disable();
222#ifdef ALLOW_OPCODE_EDITING
1065 wxWindow *parent,
bool call_fit,
bool set_sizer) {
1066 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
1068 wxFlexGridSizer *item1 =
new wxFlexGridSizer( 2, 0, 0 );
1070 wxFlexGridSizer *item2 =
new wxFlexGridSizer( 2, 0, 0 );
1072 wxStaticText *item3 =
new wxStaticText( parent,
ID_LABEL_NAME, wxT(
"Name:"), wxDefaultPosition, wxDefaultSize, 0 );
1073 item2->Add( item3, 0, wxALIGN_RIGHT|wxALL, 5 );
1075 wxTextCtrl *item4 =
new wxTextCtrl( parent,
ID_NAME, wxT(
""), wxDefaultPosition, wxSize(160,-1), 0 );
1076 item2->Add( item4, 0, wxGROW|wxALL, 5 );
1078 wxStaticText *item5 =
new wxStaticText( parent,
ID_LABEL_OPCODE_PORT_NAME, wxT(
"Opcode port:"), wxDefaultPosition, wxDefaultSize, 0 );
1079 item2->Add( item5, 0, wxALIGN_RIGHT|wxALL, 5 );
1081 wxTextCtrl *item6 =
new wxTextCtrl( parent,
ID_OPCODE_PORT, wxT(
""), wxDefaultPosition, wxSize(160,-1), 0 );
1082 item2->Add( item6, 0, wxGROW|wxALL, 5 );
1084 wxStaticText *item7 =
new wxStaticText( parent,
ID_LABEL_CLK_PORT, wxT(
"Clock port:"), wxDefaultPosition, wxDefaultSize, 0 );
1085 item2->Add( item7, 0, wxALIGN_RIGHT|wxALL, 5 );
1087 wxTextCtrl *item8 =
new wxTextCtrl( parent,
ID_CLK_PORT, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
1088 item2->Add( item8, 0, wxGROW|wxALL, 5 );
1090 wxStaticText *item9 =
new wxStaticText( parent,
ID_LABEL_GLOCK_PORT, wxT(
"Global lock port:"), wxDefaultPosition, wxDefaultSize, 0 );
1091 item2->Add( item9, 0, wxALIGN_RIGHT|wxALL, 5 );
1093 wxTextCtrl *item10 =
new wxTextCtrl( parent,
ID_GLOCK_PORT, wxT(
""), wxDefaultPosition, wxSize(150,-1), 0 );
1094 item2->Add( item10, 0, wxGROW|wxALL, 5 );
1096 wxStaticText *item11 =
new wxStaticText( parent,
ID_LABEL_RST_PORT, wxT(
"Reset port:"), wxDefaultPosition, wxDefaultSize, 0 );
1097 item2->Add( item11, 0, wxALIGN_RIGHT|wxALL, 5 );
1099 wxTextCtrl *item12 =
new wxTextCtrl( parent,
ID_RST_PORT, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
1100 item2->Add( item12, 0, wxGROW|wxALL, 5 );
1102 wxStaticText *item13 =
new wxStaticText( parent,
ID_LABEL_GLOCK_REQ_PORT, wxT(
"Global lock req. port:"), wxDefaultPosition, wxDefaultSize, 0 );
1103 item2->Add( item13, 0, wxALIGN_RIGHT|wxALL, 5 );
1105 wxTextCtrl *item14 =
new wxTextCtrl( parent,
ID_GLOCK_REQ_PORT, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
1106 item2->Add( item14, 0, wxGROW|wxALL, 5 );
1108 item1->Add( item2, 0, wxALL, 5 );
1110 wxStaticBox *item16 =
new wxStaticBox( parent, -1, wxT(
"Source files:") );
1112 wxStaticBoxSizer *item15 =
new wxStaticBoxSizer( item16, wxVERTICAL );
1114 wxFlexGridSizer *item17_1 =
new wxFlexGridSizer( 2, 0, 0 );
1116 wxListCtrl *item17 =
new wxListCtrl( parent,
ID_SOURCE_LIST, wxDefaultPosition, wxSize(300,150), wxLC_REPORT|wxSUNKEN_BORDER );
1117 item17_1->Add( item17, 0, wxGROW|wxALL, 5 );
1119 wxBoxSizer *item17_3 =
new wxBoxSizer( wxVERTICAL );
1121 wxButton *item60 =
new wxButton( parent,
ID_MOVE_SOURCE_UP, wxT(
"▴"), wxDefaultPosition, wxSize(20, 20), 0 );
1122 item17_3->Add( item60, 0, wxALIGN_CENTER|wxALL, 5 );
1124 wxButton *item61 =
new wxButton( parent,
ID_MOVE_SOURCE_DOWN, wxT(
"▾"), wxDefaultPosition, wxSize(20, 20), 0 );
1125 item17_3->Add( item61, 0, wxALIGN_CENTER|wxALL, 5 );
1127 item17_1->Add( item17_3, 0, wxALIGN_RIGHT|wxALIGN_CENTER, 5 );
1129 item15->Add( item17_1, 0, wxGROW|wxALL, 5 );
1131 wxBoxSizer *item18 =
new wxBoxSizer( wxHORIZONTAL );
1133 wxButton *item19 =
new wxButton( parent,
ID_ADD_SOURCE, wxT(
"Add..."), wxDefaultPosition, wxDefaultSize, 0 );
1134 item18->Add( item19, 0, wxALL, 5 );
1136 wxButton *item20 =
new wxButton( parent,
ID_DELETE_SOURCE, wxT(
"Delete"), wxDefaultPosition, wxDefaultSize, 0 );
1137 item18->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
1139 item15->Add( item18, 0, 0, 5 );
1141 item1->Add( item15, 0, wxGROW|wxALL, 5 );
1143 wxStaticBox *item22 =
new wxStaticBox( parent, -1, wxT(
"Architecture ports:") );
1144 wxStaticBoxSizer *item21 =
new wxStaticBoxSizer( item22, wxVERTICAL );
1146 wxListCtrl *item23 =
new wxListCtrl( parent,
ID_ARCH_PORT_LIST, wxDefaultPosition, wxSize(200,120), wxLC_REPORT|wxSUNKEN_BORDER );
1147 item21->Add( item23, 0, wxGROW|wxALL, 5 );
1149 wxBoxSizer *item24 =
new wxBoxSizer( wxHORIZONTAL );
1151 wxButton *item25 =
new wxButton( parent,
ID_EDIT_ARCH_PORT, wxT(
"Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
1152 item24->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
1154 item21->Add( item24, 0, 0, 5 );
1156 item1->Add( item21, 0, wxGROW|wxALL, 5 );
1158 wxStaticBox *item27 =
new wxStaticBox( parent, -1, wxT(
"Opcodes:") );
1159 wxStaticBoxSizer *item26 =
new wxStaticBoxSizer( item27, wxVERTICAL );
1161 wxListCtrl *item28 =
new wxListCtrl( parent,
ID_OPCODE_LIST, wxDefaultPosition, wxSize(260,120), wxLC_REPORT|wxSUNKEN_BORDER );
1162 item26->Add( item28, 0, wxGROW|wxALL, 5 );
1164 wxBoxSizer *item29 =
new wxBoxSizer( wxHORIZONTAL );
1165#ifdef ALLOW_OPCODE_EDITING
1166 wxSpinCtrl *item30 =
new wxSpinCtrl( parent,
ID_OPCODE, wxT(
"0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 100, 0 );
1167 item29->Add( item30, 0, wxALIGN_CENTER|wxALL, 5 );
1169 wxButton *item31 =
new wxButton( parent,
ID_SET_OPCODE, wxT(
"Set"), wxDefaultPosition, wxDefaultSize, 0 );
1170 item29->Add( item31, 0, wxALIGN_CENTER|wxALL, 5 );
1172 wxButton *item32 =
new wxButton( parent,
ID_CLEAR_OPCODE, wxT(
"Clear"), wxDefaultPosition, wxDefaultSize, 0 );
1173 item29->Add( item32, 0, wxALIGN_CENTER|wxALL, 5 );
1175 item26->Add( item29, 0, 0, 5 );
1177 item1->Add( item26, 0, wxGROW|wxALL, 5 );
1179 wxStaticBox *item34 =
new wxStaticBox( parent, -1, wxT(
"External ports:") );
1180 wxStaticBoxSizer *item33 =
new wxStaticBoxSizer( item34, wxVERTICAL );
1182 wxListCtrl *item35 =
new wxListCtrl( parent,
ID_EXTERNAL_PORT_LIST, wxDefaultPosition, wxSize(200,120), wxLC_REPORT|wxSUNKEN_BORDER );
1183 item33->Add( item35, 0, wxGROW|wxALL, 5 );
1185 wxBoxSizer *item36 =
new wxBoxSizer( wxHORIZONTAL );
1187 wxButton *item37 =
new wxButton( parent,
ID_ADD_EXTERNAL_PORT, wxT(
"Add..."), wxDefaultPosition, wxDefaultSize, 0 );
1188 item36->Add( item37, 0, wxALL, 5 );
1190 wxButton *item38 =
new wxButton( parent,
ID_EDIT_EXTERNAL_PORT, wxT(
"Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
1191 item36->Add( item38, 0, wxALIGN_CENTER|wxALL, 5 );
1193 wxButton *item39 =
new wxButton( parent,
ID_DELETE_EXTERNAL_PORT, wxT(
"Delete"), wxDefaultPosition, wxDefaultSize, 0 );
1194 item36->Add( item39, 0, wxALIGN_CENTER|wxALL, 5 );
1196 item33->Add( item36, 0, wxALIGN_CENTER, 5 );
1198 item1->Add( item33, 0, wxGROW|wxALL, 5 );
1200 wxStaticBox *item41 =
new wxStaticBox( parent, -1, wxT(
"Parameters:") );
1201 wxStaticBoxSizer *item40 =
new wxStaticBoxSizer( item41, wxVERTICAL );
1203 wxListCtrl *item42 =
new wxListCtrl( parent,
ID_PARAMETER_LIST, wxDefaultPosition, wxSize(260,120), wxLC_REPORT|wxSUNKEN_BORDER );
1204 item40->Add( item42, 0, wxGROW|wxALL, 5 );
1206 wxBoxSizer *item43 =
new wxBoxSizer( wxHORIZONTAL );
1208 wxButton *item44 =
new wxButton( parent,
ID_ADD_PARAMETER, wxT(
"Add..."), wxDefaultPosition, wxDefaultSize, 0 );
1209 item43->Add( item44, 0, wxALIGN_CENTER|wxALL, 5 );
1211 wxButton *item45 =
new wxButton( parent,
ID_EDIT_PARAMETER, wxT(
"Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
1212 item43->Add( item45, 0, wxALIGN_CENTER|wxALL, 5 );
1214 wxButton *item46 =
new wxButton( parent,
ID_DELETE_PARAMETER, wxT(
"Delete"), wxDefaultPosition, wxDefaultSize, 0 );
1215 item43->Add( item46, 0, wxALIGN_CENTER|wxALL, 5 );
1217 item40->Add( item43, 0, 0, 5 );
1219 item1->Add( item40, 0, wxGROW|wxALL, 5 );
1221 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
1223 wxStaticLine *item47 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
1224 item0->Add( item47, 0, wxGROW|wxALL, 5 );
1226 wxBoxSizer *item48 =
new wxBoxSizer( wxHORIZONTAL );
1228 wxButton *item49 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
1229 item48->Add( item49, 0, wxALIGN_CENTER|wxALL, 5 );
1231 wxButton *item50 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
1232 item48->Add( item50, 0, wxALIGN_CENTER|wxALL, 5 );
1234 item0->Add( item48, 0, wxALL, 5 );
1238 parent->SetSizer( item0 );
1240 item0->SetSizeHints( parent );