aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pcf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/pcf.cc')
-rw-r--r--ice40/pcf.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/ice40/pcf.cc b/ice40/pcf.cc
index 1003c037..d03820da 100644
--- a/ice40/pcf.cc
+++ b/ice40/pcf.cc
@@ -57,9 +57,9 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
if (setting == "-pullup") {
const auto &value = words.at(++args_end);
if (value == "yes" || value == "1")
- extra_attrs.emplace_back(std::make_pair(ctx->id("PULLUP"), Property::State::S1));
+ extra_attrs.emplace_back(std::make_pair(id_PULLUP, Property::State::S1));
else if (value == "no" || value == "0")
- extra_attrs.emplace_back(std::make_pair(ctx->id("PULLUP"), Property::State::S0));
+ extra_attrs.emplace_back(std::make_pair(id_PULLUP, Property::State::S0));
else
log_error("Invalid value '%s' for -pullup (on line %d)\n", value.c_str(), lineno);
} else if (setting == "-pullup_resistor") {
@@ -68,7 +68,7 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
log_error("Pullup resistance can only be set on UP5K/UP3K (on line %d)\n", lineno);
if (value != "3P3K" && value != "6P8K" && value != "10K" && value != "100K")
log_error("Invalid value '%s' for -pullup_resistor (on line %d)\n", value.c_str(), lineno);
- extra_attrs.emplace_back(std::make_pair(ctx->id("PULLUP_RESISTOR"), value));
+ extra_attrs.emplace_back(std::make_pair(id_PULLUP_RESISTOR, value));
} else if (setting == "-nowarn") {
nowarn = true;
} else if (setting == "--warn-no-port") {
@@ -92,11 +92,11 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
BelId pin_bel = ctx->get_package_pin_bel(pin);
if (pin_bel == BelId())
log_error("package does not have a pin named '%s' (on line %d)\n", pin.c_str(), lineno);
- if (fnd_cell->second->attrs.count(ctx->id("BEL")))
+ if (fnd_cell->second->attrs.count(id_BEL))
log_error("duplicate pin constraint on '%s' (on line %d)\n", cell.c_str(), lineno);
- fnd_cell->second->attrs[ctx->id("BEL")] = ctx->getBelName(pin_bel).str(ctx);
+ fnd_cell->second->attrs[id_BEL] = ctx->getBelName(pin_bel).str(ctx);
log_info("constrained '%s' to bel '%s'\n", cell.c_str(),
- fnd_cell->second->attrs[ctx->id("BEL")].as_string().c_str());
+ fnd_cell->second->attrs[id_BEL].as_string().c_str());
for (const auto &attr : extra_attrs)
fnd_cell->second->attrs[attr.first] = attr.second;
}
@@ -112,8 +112,8 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
CellInfo *ci = cell.second.get();
if (ci->type == ctx->id("$nextpnr_ibuf") || ci->type == ctx->id("$nextpnr_obuf") ||
ci->type == ctx->id("$nextpnr_iobuf")) {
- if (!ci->attrs.count(ctx->id("BEL"))) {
- if (bool_or_default(ctx->settings, ctx->id("pcf_allow_unconstrained")))
+ if (!ci->attrs.count(id_BEL)) {
+ if (bool_or_default(ctx->settings, id_pcf_allow_unconstrained))
log_warning("IO '%s' is unconstrained in PCF and will be automatically placed\n",
cell.first.c_str(ctx));
else