aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 786bf686..88a900d8 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -241,6 +241,7 @@ IdString Arch::archArgsToId(ArchArgs args) const
BelId Arch::getBelByName(IdString name) const
{
+ boost::lock_guard<boost::shared_mutex> lock(mtx_);
BelId ret;
if (bel_by_name.empty()) {
@@ -276,6 +277,7 @@ BelRange Arch::getBelsAtSameTile(BelId bel) const
WireId Arch::getWireBelPin(BelId bel, PortPin pin) const
{
WireId ret;
+ boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
NPNR_ASSERT(bel != BelId());
@@ -296,6 +298,7 @@ WireId Arch::getWireBelPin(BelId bel, PortPin pin) const
WireId Arch::getWireByName(IdString name) const
{
WireId ret;
+ boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
if (wire_by_name.empty()) {
for (int i = 0; i < chip_info->num_wires; i++)
@@ -314,6 +317,7 @@ WireId Arch::getWireByName(IdString name) const
PipId Arch::getPipByName(IdString name) const
{
PipId ret;
+ boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
if (pip_by_name.empty()) {
for (int i = 0; i < chip_info->num_pips; i++) {
@@ -372,6 +376,8 @@ std::string Arch::getBelPackagePin(BelId bel) const
// -----------------------------------------------------------------------
+// TODO(cliffordvienna): lock all of this
+
GroupId Arch::getGroupByName(IdString name) const
{
for (auto g : getGroups())
@@ -488,6 +494,7 @@ DecalXY Arch::getGroupDecal(GroupId group) const
std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
{
+ boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
std::vector<GraphicElement> ret;
if (decal.type == DecalId::TYPE_FRAME) {