aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pcf.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-18 14:15:41 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-18 14:15:41 +0200
commitf30d477c8129c3c189866a4bc862724d4e8d4398 (patch)
tree552fe4a537e6776ce9fbc360ceb9e5d62677385c /ice40/pcf.cc
parent2f5e9542c2d9132b2c01d4dbc8c4d2dff97c60cf (diff)
parentcbcd2ea3acaf257bf39b25a38d9f591e82a66f37 (diff)
downloadnextpnr-f30d477c8129c3c189866a4bc862724d4e8d4398.tar.gz
nextpnr-f30d477c8129c3c189866a4bc862724d4e8d4398.tar.bz2
nextpnr-f30d477c8129c3c189866a4bc862724d4e8d4398.zip
Merge branch 'refactor'
Diffstat (limited to 'ice40/pcf.cc')
-rw-r--r--ice40/pcf.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/ice40/pcf.cc b/ice40/pcf.cc
index 3bef962f..756aba4a 100644
--- a/ice40/pcf.cc
+++ b/ice40/pcf.cc
@@ -27,7 +27,7 @@ NEXTPNR_NAMESPACE_BEGIN
// Read a w
// Apply PCF constraints to a pre-packing design
-void apply_pcf(Design *design, std::istream &in)
+void apply_pcf(Context *ctx, std::istream &in)
{
if (!in)
log_error("failed to open PCF file");
@@ -50,16 +50,15 @@ void apply_pcf(Design *design, std::istream &in)
args_end++;
std::string cell = words.at(args_end);
std::string pin = words.at(args_end + 1);
- auto fnd_cell = design->cells.find(cell);
- if (fnd_cell == design->cells.end()) {
+ auto fnd_cell = ctx->cells.find(cell);
+ if (fnd_cell == ctx->cells.end()) {
log_warning("unmatched pcf constraint %s\n", cell.c_str());
} else {
- BelId pin_bel = design->chip.getPackagePinBel(pin);
+ BelId pin_bel = ctx->getPackagePinBel(pin);
if (pin_bel == BelId())
log_error("package does not have a pin named %s\n",
pin.c_str());
- fnd_cell->second->attrs["BEL"] =
- design->chip.getBelName(pin_bel).str();
+ fnd_cell->second->attrs["BEL"] = ctx->getBelName(pin_bel).str();
log_info("constrained '%s' to bel '%s'\n", cell.c_str(),
fnd_cell->second->attrs["BEL"].c_str());
}