aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorMaciej Kurc <mkurc@antmicro.com>2022-01-28 13:51:10 +0100
committerMaciej Kurc <mkurc@antmicro.com>2022-01-28 13:51:10 +0100
commite51e82d6a93d2d46ab11601769e736dd5029d70d (patch)
tree73341b364324f477c9113cb930cd94d0618b837d /nexus
parent1301feb4ad607d5bc7341a1d7059c75077b0e8e9 (diff)
downloadnextpnr-e51e82d6a93d2d46ab11601769e736dd5029d70d.tar.gz
nextpnr-e51e82d6a93d2d46ab11601769e736dd5029d70d.tar.bz2
nextpnr-e51e82d6a93d2d46ab11601769e736dd5029d70d.zip
Added honoring OSCA output frequency tolerance during constraints generation
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/pack.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/nexus/pack.cc b/nexus/pack.cc
index e89dc9c0..41f9d806 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -1987,8 +1987,9 @@ struct NexusPacker
copy_constraint(ci, id_CLKI, id_CLKO, 1);
} else if (ci->type == id_OSC_CORE) {
int div = int_or_default(ci->params, ctx->id("HF_CLK_DIV"), 128);
- set_period(ci, id_HFCLKOUT, delay_t((1.0e6 / 450) * (div + 1)));
- set_period(ci, id_LFCLKOUT, delay_t((1.0e3 / 10)));
+ 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)));
} 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,