From 3042f9e792985cd204e1239d727541e566ddfcef Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Wed, 2 Feb 2022 09:24:28 +0100 Subject: Fixed correction of Nexus OSCA frequency constraints Signed-off-by: Maciej Kurc --- nexus/pack.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nexus/pack.cc') 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 div{id_DIVA, id_DIVB, id_DIVC, id_DIVD, id_DIVE, id_DIVF}; static const std::array output{id_CLKOP, id_CLKOS, id_CLKOS2, -- cgit v1.2.3