aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-11-26 18:56:10 +0000
committerDavid Shah <dave@ds0.me>2018-11-26 18:56:10 +0000
commit0adc0d75297fa81034aa3f325cf2758314ca1336 (patch)
tree4b83768a45e3a0bc6d82a649f3409da313c4a714
parent86108bfd395352af2342177eba6453cd8a58bdfa (diff)
downloadnextpnr-0adc0d75297fa81034aa3f325cf2758314ca1336.tar.gz
nextpnr-0adc0d75297fa81034aa3f325cf2758314ca1336.tar.bz2
nextpnr-0adc0d75297fa81034aa3f325cf2758314ca1336.zip
timing: Improve clock constraint log output
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--common/nextpnr.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index be3bfe14..bb941d3d 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -409,12 +409,16 @@ void Context::check() const
void BaseCtx::addClock(IdString net, float freq)
{
- log_info("constraining clock net '%s' to %.02f MHz\n", net.c_str(this), freq);
std::unique_ptr<ClockConstraint> cc(new ClockConstraint());
cc->period = getCtx()->getDelayFromNS(1000 / freq);
cc->high = getCtx()->getDelayFromNS(500 / freq);
cc->low = getCtx()->getDelayFromNS(500 / freq);
- nets.at(net)->clkconstr = std::move(cc);
+ if (!nets.count(net)) {
+ log_warning("net '%s' does not exist in design, ignoring clock constraint\n", net.c_str(this));
+ } else {
+ nets.at(net)->clkconstr = std::move(cc);
+ log_info("constraining clock net '%s' to %.02f MHz\n", net.c_str(this), freq);
+ }
}
NEXTPNR_NAMESPACE_END