334                            std::map<
int, std::set<int> >& operands, 
 
  337    bool triggerBound = 
false;
 
  338    int triggerWidth = 0;
 
  339    const FUPort* triggerPort = NULL;
 
  344            triggerWidth = triggerPort->
width();
 
  348    while (!operands.empty() && !ports.empty()) {
 
  349        std::map<int, std::set<int> >::iterator j = operands.begin(); 
 
  350        int width = j->first;
 
  351        for (PortMap::iterator k = ports.begin();
 
  353            if (k->first >= width) {
 
  354                std::set<int>& operandsOfSize = j->second;
 
  355                std::set<int>::iterator operandIter = operandsOfSize.begin();
 
  357                    && triggerPort != 
nullptr 
  358                    && width <= triggerWidth
 
  359                    && operandsOfSize.size() == 1) {
 
  360                    std::map<int, std::set<int> >::iterator next = j;
 
  362                    if (next==operands.end() || next->first > triggerWidth) {
 
  363                        operation.
bindPort(*operandIter, *triggerPort);
 
  364                        operands.erase(j->first);
 
  365                        ports.erase(triggerWidth);
 
  366                        needsTrigger = 
false;
 
  371                PortSet& portsOfSize = k->second;
 
  373                PortSet::iterator portIter = portsOfSize.end();
 
  376                operation.
bindPort(*operandIter, *fuPort);
 
  378                    needsTrigger = 
false;
 
  381                operandsOfSize.erase(operandIter);
 
  382                if (operandsOfSize.empty()) {
 
  383                    operands.erase(j->first);
 
  385                portsOfSize.erase(portIter);
 
  386                if (portsOfSize.empty()) {
 
  387                    ports.erase(k->first);
 
 
  425    wxBoxSizer *mainSizer = 
new wxBoxSizer(wxVERTICAL);
 
  427    wxBoxSizer *upperSizer = 
new wxBoxSizer(wxHORIZONTAL);
 
  430    wxBoxSizer *leftSizer = 
new wxBoxSizer(wxVERTICAL);
 
  432    wxListBox *opListBox = 
new wxListBox(parent, 
ID_LIST, wxDefaultPosition,
 
  433        wxSize(210, 150), 0, NULL, wxLB_SINGLE|wxLB_SORT);
 
  434    leftSizer->Add(opListBox, 0, wxEXPAND|wxALL, 5);
 
  437    wxBoxSizer *filterSizer = 
new wxBoxSizer(wxHORIZONTAL);
 
  439    wxStaticText *opNameFilterLabel = 
new wxStaticText(parent,
 
  443    wxTextCtrl *opNameFilter = 
new wxTextCtrl(parent, 
ID_OP_FILTER, wxT(
""),
 
  444        wxDefaultPosition, wxDefaultSize, 0);
 
  445    filterSizer->Add(opNameFilterLabel, 0, 0);
 
  446    filterSizer->Add(opNameFilter, 1, wxEXPAND);
 
  447    leftSizer->Add(filterSizer, 0, wxEXPAND|wxALL, 5);
 
  450    wxBoxSizer *latencySizer = 
new wxBoxSizer(wxHORIZONTAL);
 
  452    wxStaticText *latencyLabel = 
new wxStaticText(parent, 
ID_TEXT,
 
  453        wxT(
"Latency:"), wxDefaultPosition, wxDefaultSize, 0);
 
  455    wxSpinCtrl *latencySpinner = 
new wxSpinCtrl(parent, 
ID_LATENCY, wxT(
"1"),
 
  456        wxDefaultPosition, wxSize(-1,-1), 0, 1, 100, 1);
 
  457    latencySizer->Add(latencyLabel, 1, 0);
 
  458    latencySizer->Add(latencySpinner, 1);
 
  459    leftSizer->Add(latencySizer, 0, wxEXPAND|wxALL, 5);
 
  462    wxStaticBoxSizer *rightSizer = 
new wxStaticBoxSizer(wxVERTICAL, parent,
 
  463        wxT(
"Operation description"));
 
  466        wxT(
""), wxDefaultPosition, wxSize(210, -1),
 
  467        wxTE_MULTILINE|wxTE_READONLY);
 
  470    wxBoxSizer *insOutsSizer = 
new wxBoxSizer(wxHORIZONTAL);
 
  472    wxStaticText *inputsLabel = 
new wxStaticText(parent, 
ID_OP_INPUTS,
 
  473        wxT(
"Inputs:"), wxDefaultPosition, wxDefaultSize, 0);
 
  475    wxStaticText *outputsLabel = 
new wxStaticText(parent, 
ID_OP_OUTPUTS,
 
  476        wxT(
"Outputs: "), wxDefaultPosition, wxDefaultSize, 0);
 
  477    insOutsSizer->Add(inputsLabel, 1);
 
  478    insOutsSizer->Add(outputsLabel, 1);
 
  479    rightSizer->Add(opDescription, 1, wxEXPAND|wxALL, 5);
 
  480    rightSizer->Add(insOutsSizer, 0, wxEXPAND|wxALL, 5);
 
  482    upperSizer->Add(leftSizer, 0, wxALL, 5);
 
  483    upperSizer->Add(rightSizer, 1, wxEXPAND|wxALL, 5);
 
  485    mainSizer->Add(upperSizer, 1, wxEXPAND);
 
  488    wxStaticLine *horisontalLine = 
new wxStaticLine(parent, 
ID_LINE,
 
  489        wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL);
 
  490    mainSizer->Add(horisontalLine, 0, wxEXPAND|wxALL, 5);
 
  493    wxBoxSizer *buttonsSizer = 
new wxBoxSizer(wxHORIZONTAL);
 
  495    wxButton *cancelButton = 
new wxButton(parent, wxID_CANCEL, wxT(
"&Cancel"),
 
  496        wxDefaultPosition, wxDefaultSize, 0);
 
  497    buttonsSizer->Add(cancelButton, 0, wxALIGN_CENTER|wxALL, 5);
 
  499    wxButton *okButton = 
new wxButton(parent, wxID_OK, wxT(
"&OK"),
 
  500        wxDefaultPosition, wxDefaultSize, 0);
 
  501    buttonsSizer->Add(okButton, 0, wxALIGN_CENTER|wxALL, 5);
 
  503    mainSizer->Add(buttonsSizer, 0, 0, 5);
 
  506        parent->SetSizer(mainSizer);
 
  508            mainSizer->SetSizeHints( parent );