Skip to content

Commit 5941a99

Browse files
committed
fixed missing enable pin and segfault it caused in GUI gatelib manager
1 parent df32c21 commit 5941a99

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

plugins/gate_libraries/definitions/ice40ultra.hgl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,21 @@
13911391
}
13921392
]
13931393
},
1394+
{
1395+
"name": "E",
1396+
"direction": "input",
1397+
"type": "enable",
1398+
"ascending": false,
1399+
"start_index": 0,
1400+
"ordered": false,
1401+
"pins": [
1402+
{
1403+
"name": "E",
1404+
"direction": "input",
1405+
"type": "enable"
1406+
}
1407+
]
1408+
},
13941409
{
13951410
"name": "R",
13961411
"direction": "input",

plugins/gate_libraries/definitions/ice40ultra_hal.hgl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3686,6 +3686,21 @@
36863686
}
36873687
]
36883688
},
3689+
{
3690+
"name": "E",
3691+
"direction": "input",
3692+
"type": "enable",
3693+
"ascending": false,
3694+
"start_index": 0,
3695+
"ordered": false,
3696+
"pins": [
3697+
{
3698+
"name": "E",
3699+
"direction": "input",
3700+
"type": "enable"
3701+
}
3702+
]
3703+
},
36893704
{
36903705
"name": "R",
36913706
"direction": "input",

plugins/gui/src/gatelibrary_management/gatelibrary_tab_widgets/gatelibrary_tab_truth_table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ namespace hal
210210
for (int nsiCol = 0; nsiCol < nextStateInputs.size(); nsiCol++)
211211
{
212212
int icol = inputColHash.value(nextStateInputs.at(nsiCol),-1);
213-
Q_ASSERT(icol >= 0);
213+
if (icol < 0) return false;
214214
QString cellVal(irow & (1<<nsiCol) ? "H" : "L");
215215
mTableWidget->setItem(irow, icol, new QTableWidgetItem(cellVal));
216216
}
@@ -231,7 +231,7 @@ namespace hal
231231
for (int nsiCol = 0; nsiCol < nextStateInputs.size(); nsiCol++)
232232
{
233233
int icol = inputColHash.value(nextStateInputs.at(nsiCol),-1);
234-
Q_ASSERT(icol >= 0);
234+
if (icol < 0) return false;
235235
mTableWidget->setItem(irow, icol, new QTableWidgetItem("X"));
236236
}
237237
if (icolClock >= 0)

0 commit comments

Comments
 (0)