aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.h
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-07-14 19:01:33 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-07-14 19:01:33 +0100
commitd327a0afbb6a92553647444c0baaeb4971a0847b (patch)
treea29db53cafaa68157ae41a7a2586be435e97eb10 /ice40/arch.h
parent57f75385b0960d6e1e30112a395a89ee4df07056 (diff)
downloadnextpnr-d327a0afbb6a92553647444c0baaeb4971a0847b.tar.gz
nextpnr-d327a0afbb6a92553647444c0baaeb4971a0847b.tar.bz2
nextpnr-d327a0afbb6a92553647444c0baaeb4971a0847b.zip
Revert "Make ice40::Arch thread-safe"
This reverts commit 0816f447b768ebe0632f419e9b696714dda4e860.
Diffstat (limited to 'ice40/arch.h')
-rw-r--r--ice40/arch.h38
1 files changed, 6 insertions, 32 deletions
diff --git a/ice40/arch.h b/ice40/arch.h
index a7af3269..e42da422 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -21,9 +21,6 @@
#error Include "arch.h" via "nextpnr.h" only.
#endif
-#include <boost/thread/shared_lock_guard.hpp>
-#include <boost/thread/shared_mutex.hpp>
-
NEXTPNR_NAMESPACE_BEGIN
/**** Everything in this section must be kept in sync with chipdb.py ****/
@@ -327,17 +324,8 @@ struct ArchArgs
std::string package;
};
-class Arch : public BaseCtx
+struct Arch : BaseCtx
{
-private:
- // All of the following...
- std::vector<IdString> bel_to_cell;
- std::vector<IdString> wire_to_net;
- std::vector<IdString> pip_to_net;
- std::vector<IdString> switches_locked;
- // ... are guarded by the following lock:
- mutable boost::shared_mutex mtx_;
-public:
const ChipInfoPOD *chip_info;
const PackageInfoPOD *package_info;
@@ -345,6 +333,11 @@ public:
mutable std::unordered_map<IdString, int> wire_by_name;
mutable std::unordered_map<IdString, int> pip_by_name;
+ std::vector<IdString> bel_to_cell;
+ std::vector<IdString> wire_to_net;
+ std::vector<IdString> pip_to_net;
+ std::vector<IdString> switches_locked;
+
ArchArgs args;
Arch(ArchArgs args);
@@ -375,7 +368,6 @@ public:
{
NPNR_ASSERT(bel != BelId());
NPNR_ASSERT(bel_to_cell[bel.index] == IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
bel_to_cell[bel.index] = cell;
cells[cell]->bel = bel;
cells[cell]->belStrength = strength;
@@ -385,7 +377,6 @@ public:
{
NPNR_ASSERT(bel != BelId());
NPNR_ASSERT(bel_to_cell[bel.index] != IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
cells[bel_to_cell[bel.index]]->bel = BelId();
cells[bel_to_cell[bel.index]]->belStrength = STRENGTH_NONE;
bel_to_cell[bel.index] = IdString();
@@ -394,21 +385,18 @@ public:
bool checkBelAvail(BelId bel) const
{
NPNR_ASSERT(bel != BelId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return bel_to_cell[bel.index] == IdString();
}
IdString getBoundBelCell(BelId bel) const
{
NPNR_ASSERT(bel != BelId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return bel_to_cell[bel.index];
}
IdString getConflictingBelCell(BelId bel) const
{
NPNR_ASSERT(bel != BelId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return bel_to_cell[bel.index];
}
@@ -482,8 +470,6 @@ public:
{
NPNR_ASSERT(wire != WireId());
NPNR_ASSERT(wire_to_net[wire.index] == IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
-
wire_to_net[wire.index] = net;
nets[net]->wires[wire].pip = PipId();
nets[net]->wires[wire].strength = strength;
@@ -493,7 +479,6 @@ public:
{
NPNR_ASSERT(wire != WireId());
NPNR_ASSERT(wire_to_net[wire.index] != IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
auto &net_wires = nets[wire_to_net[wire.index]]->wires;
auto it = net_wires.find(wire);
@@ -512,24 +497,18 @@ public:
bool checkWireAvail(WireId wire) const
{
NPNR_ASSERT(wire != WireId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
-
return wire_to_net[wire.index] == IdString();
}
IdString getBoundWireNet(WireId wire) const
{
NPNR_ASSERT(wire != WireId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
-
return wire_to_net[wire.index];
}
IdString getConflictingWireNet(WireId wire) const
{
NPNR_ASSERT(wire != WireId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
-
return wire_to_net[wire.index];
}
@@ -553,7 +532,6 @@ public:
NPNR_ASSERT(pip != PipId());
NPNR_ASSERT(pip_to_net[pip.index] == IdString());
NPNR_ASSERT(switches_locked[chip_info->pip_data[pip.index].switch_index] == IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
pip_to_net[pip.index] = net;
switches_locked[chip_info->pip_data[pip.index].switch_index] = net;
@@ -571,7 +549,6 @@ public:
NPNR_ASSERT(pip != PipId());
NPNR_ASSERT(pip_to_net[pip.index] != IdString());
NPNR_ASSERT(switches_locked[chip_info->pip_data[pip.index].switch_index] != IdString());
- boost::lock_guard<boost::shared_mutex> lock(mtx_);
WireId dst;
dst.index = chip_info->pip_data[pip.index].dst;
@@ -586,21 +563,18 @@ public:
bool checkPipAvail(PipId pip) const
{
NPNR_ASSERT(pip != PipId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return switches_locked[chip_info->pip_data[pip.index].switch_index] == IdString();
}
IdString getBoundPipNet(PipId pip) const
{
NPNR_ASSERT(pip != PipId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return pip_to_net[pip.index];
}
IdString getConflictingPipNet(PipId pip) const
{
NPNR_ASSERT(pip != PipId());
- boost::shared_lock_guard<boost::shared_mutex> lock(mtx_);
return switches_locked[chip_info->pip_data[pip.index].switch_index];
}