This commit is contained in:
Eddie Hung 2018-07-08 16:35:16 -07:00
commit 1457a6453c
3 changed files with 11 additions and 10 deletions

View File

@ -13,6 +13,7 @@ Prequisites
- Modern C++11 compiler (`clang-format` required for development) - Modern C++11 compiler (`clang-format` required for development)
- Qt5 or later (`qt5-default` for Ubuntu 16.04) - Qt5 or later (`qt5-default` for Ubuntu 16.04)
- Python 3.5 or later, including development libraries (`python3-dev` for Ubuntu) - Python 3.5 or later, including development libraries (`python3-dev` for Ubuntu)
- on Windows make sure to install same version as supported by [vcpkg](https://github.com/Microsoft/vcpkg/blob/master/ports/python3/CONTROL)
- Boost libraries (`libboost-dev` or `libboost-all-dev` for Ubuntu) - Boost libraries (`libboost-dev` or `libboost-all-dev` for Ubuntu)
- Icestorm, with chipdbs installed in `/usr/local/share/icebox` - Icestorm, with chipdbs installed in `/usr/local/share/icebox`
- Latest git Yosys is required to synthesise the demo design - Latest git Yosys is required to synthesise the demo design

View File

@ -266,19 +266,19 @@ void DesignWidget::clearProperties()
idToProperty.clear(); idToProperty.clear();
} }
void DesignWidget::onItemClicked(QTreeWidgetItem *item, int pos) void DesignWidget::onItemClicked(QTreeWidgetItem *clickItem, int pos)
{ {
if (!item->parent()) if (!clickItem->parent())
return; return;
ElementType type = static_cast<ElementTreeItem *>(item)->getType(); ElementType type = static_cast<ElementTreeItem *>(clickItem)->getType();
if (type == ElementType::NONE) { if (type == ElementType::NONE) {
return; return;
} }
clearProperties(); clearProperties();
if (type == ElementType::BEL) { if (type == ElementType::BEL) {
IdString c = static_cast<IdStringTreeItem *>(item)->getData(); IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
BelId bel = ctx->getBelByName(c); BelId bel = ctx->getBelByName(c);
QtProperty *topItem = groupManager->addProperty("Bel"); QtProperty *topItem = groupManager->addProperty("Bel");
@ -305,7 +305,7 @@ void DesignWidget::onItemClicked(QTreeWidgetItem *item, int pos)
topItem->addSubProperty(conflictItem); topItem->addSubProperty(conflictItem);
} else if (type == ElementType::WIRE) { } else if (type == ElementType::WIRE) {
IdString c = static_cast<IdStringTreeItem *>(item)->getData(); IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
WireId wire = ctx->getWireByName(c); WireId wire = ctx->getWireByName(c);
QtProperty *topItem = groupManager->addProperty("Wire"); QtProperty *topItem = groupManager->addProperty("Wire");
@ -379,7 +379,7 @@ void DesignWidget::onItemClicked(QTreeWidgetItem *item, int pos)
} }
} else if (type == ElementType::PIP) { } else if (type == ElementType::PIP) {
IdString c = static_cast<IdStringTreeItem *>(item)->getData(); IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
PipId pip = ctx->getPipByName(c); PipId pip = ctx->getPipByName(c);
QtProperty *topItem = groupManager->addProperty("Pip"); QtProperty *topItem = groupManager->addProperty("Pip");
@ -426,7 +426,7 @@ void DesignWidget::onItemClicked(QTreeWidgetItem *item, int pos)
delayItem->addSubProperty(avgDelayItem); delayItem->addSubProperty(avgDelayItem);
} else if (type == ElementType::NET) { } else if (type == ElementType::NET) {
IdString c = static_cast<IdStringTreeItem *>(item)->getData(); IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
NetInfo *net = ctx->nets.at(c).get(); NetInfo *net = ctx->nets.at(c).get();
QtProperty *topItem = groupManager->addProperty("Net"); QtProperty *topItem = groupManager->addProperty("Net");
@ -511,7 +511,7 @@ void DesignWidget::onItemClicked(QTreeWidgetItem *item, int pos)
} }
} else if (type == ElementType::CELL) { } else if (type == ElementType::CELL) {
IdString c = static_cast<IdStringTreeItem *>(item)->getData(); IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
CellInfo *cell = ctx->cells.at(c).get(); CellInfo *cell = ctx->cells.at(c).get();
QtProperty *topItem = groupManager->addProperty("Cell"); QtProperty *topItem = groupManager->addProperty("Cell");

View File

@ -22,7 +22,7 @@ if (MSVC)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.bin) set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.bin)
set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc) set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc)
add_custom_command(OUTPUT ${DEV_CC_DB} add_custom_command(OUTPUT ${DEV_CC_DB}
COMMAND python3 ${DB_PY} -b -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB} COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -b -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}
DEPENDS ${DEV_TXT_DB} ${DB_PY} DEPENDS ${DEV_TXT_DB} ${DB_PY}
) )
target_sources(ice40_chipdb PRIVATE ${DEV_CC_DB}) target_sources(ice40_chipdb PRIVATE ${DEV_CC_DB})
@ -38,7 +38,7 @@ else()
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.cc) set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.cc)
set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc) set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc)
add_custom_command(OUTPUT ${DEV_CC_DB} add_custom_command(OUTPUT ${DEV_CC_DB}
COMMAND python3 ${DB_PY} -c -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}.new COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -c -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB} COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
DEPENDS ${DEV_TXT_DB} ${DB_PY} DEPENDS ${DEV_TXT_DB} ${DB_PY}
) )