diff options
Diffstat (limited to 'common/nextpnr.cc')
-rw-r--r-- | common/nextpnr.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 3621217b..8e8a8d19 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -381,4 +381,13 @@ void Context::check() const } } +void BaseCtx::addClock(IdString net, float 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); +} + NEXTPNR_NAMESPACE_END |