aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-02-02 08:49:31 +0000
committerGitHub <noreply@github.com>2022-02-02 08:49:31 +0000
commit6fceac95c02b16a208dd17123dba46bc3618c1fb (patch)
tree052b1875ea7b9ebcaf09bb37b94c3d4464a9db3a
parentc306ef12bcb5c5fed8782cbfa05d6534ce6a49dd (diff)
parent3042f9e792985cd204e1239d727541e566ddfcef (diff)
downloadnextpnr-6fceac95c02b16a208dd17123dba46bc3618c1fb.tar.gz
nextpnr-6fceac95c02b16a208dd17123dba46bc3618c1fb.tar.bz2
nextpnr-6fceac95c02b16a208dd17123dba46bc3618c1fb.zip
Merge pull request #902 from antmicro/nexus-osc-tolerance-2
Honor nexus OSCA frequency tolerance (corrected)
-rw-r--r--nexus/pack.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/nexus/pack.cc b/nexus/pack.cc
index 41f9d806..5e9da304 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -1988,8 +1988,8 @@ struct NexusPacker
} else if (ci->type == id_OSC_CORE) {
int div = int_or_default(ci->params, ctx->id("HF_CLK_DIV"), 128);
const float tol = 1.15f; // OSCA has +/-15% frequency tolerance, assume the worst case.
- set_period(ci, id_HFCLKOUT, delay_t(tol * (1.0e6 / 450) * (div + 1)));
- set_period(ci, id_LFCLKOUT, delay_t(tol * (1.0e3 / 10)));
+ set_period(ci, id_HFCLKOUT, delay_t((1.0e6 / 450) * (div + 1) / tol));
+ set_period(ci, id_LFCLKOUT, delay_t((1.0e3 / 10) / tol));
} else if (ci->type == id_PLL_CORE) {
static const std::array<IdString, 6> div{id_DIVA, id_DIVB, id_DIVC, id_DIVD, id_DIVE, id_DIVF};
static const std::array<IdString, 6> output{id_CLKOP, id_CLKOS, id_CLKOS2,