diff options
author | gatecat <gatecat@ds0.me> | 2021-02-19 10:39:57 +0000 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-02-19 11:31:33 +0000 |
commit | 7922b3bfc4ef93b8f67194c05e1a236b4c83c3da (patch) | |
tree | b2b21259e030edd0adc7cc944322e3e9186d3a71 /common/sdf.cc | |
parent | 8376db94a7519406444988be3628a4dadfb8d742 (diff) | |
download | nextpnr-7922b3bfc4ef93b8f67194c05e1a236b4c83c3da.tar.gz nextpnr-7922b3bfc4ef93b8f67194c05e1a236b4c83c3da.tar.bz2 nextpnr-7922b3bfc4ef93b8f67194c05e1a236b4c83c3da.zip |
Replace DelayInfo with DelayPair/DelayQuad
This replaces the arch-specific DelayInfo structure with new DelayPair
(min/max only) and DelayQuad (min/max for both rise and fall) structures
that form part of common code.
This further reduces the amount of arch-specific code; and also provides
useful data structures for timing analysis which will need to delay
with pairs/quads of delays as it is improved.
While there may be a small performance cost to arches that didn't
separate the rise/fall cases (arches that aren't currently separating
the min/max cases just need to be fixed...) in DelayInfo, my expectation
is that inlining will mean this doesn't make much difference.
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/sdf.cc')
-rw-r--r-- | common/sdf.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/common/sdf.cc b/common/sdf.cc index b9606907..5c3d0a5a 100644 --- a/common/sdf.cc +++ b/common/sdf.cc @@ -231,19 +231,19 @@ void Context::writeSDF(std::ostream &out, bool cvc_mode) const wr.program = "nextpnr"; const double delay_scale = 1000; - // Convert from DelayInfo to SDF-friendly RiseFallDelay - auto convert_delay = [&](const DelayInfo &dly) { + // Convert from DelayQuad to SDF-friendly RiseFallDelay + auto convert_delay = [&](const DelayQuad &dly) { RiseFallDelay rf; - rf.rise.min = getDelayNS(dly.minRaiseDelay()) * delay_scale; - rf.rise.typ = getDelayNS((dly.minRaiseDelay() + dly.maxRaiseDelay()) / 2) * delay_scale; // fixme: typ delays? - rf.rise.max = getDelayNS(dly.maxRaiseDelay()) * delay_scale; + rf.rise.min = getDelayNS(dly.minRiseDelay()) * delay_scale; + rf.rise.typ = getDelayNS((dly.minRiseDelay() + dly.maxRiseDelay()) / 2) * delay_scale; // fixme: typ delays? + rf.rise.max = getDelayNS(dly.maxRiseDelay()) * delay_scale; rf.fall.min = getDelayNS(dly.minFallDelay()) * delay_scale; rf.fall.typ = getDelayNS((dly.minFallDelay() + dly.maxFallDelay()) / 2) * delay_scale; // fixme: typ delays? rf.fall.max = getDelayNS(dly.maxFallDelay()) * delay_scale; return rf; }; - auto convert_setuphold = [&](const DelayInfo &setup, const DelayInfo &hold) { + auto convert_setuphold = [&](const DelayPair &setup, const DelayPair &hold) { RiseFallDelay rf; rf.rise.min = getDelayNS(setup.minDelay()) * delay_scale; rf.rise.typ = getDelayNS((setup.minDelay() + setup.maxDelay()) / 2) * delay_scale; // fixme: typ delays? @@ -273,7 +273,7 @@ void Context::writeSDF(std::ostream &out, bool cvc_mode) const continue; if (other.second.type == PORT_OUT) continue; - DelayInfo dly; + DelayQuad dly; if (!getCellDelay(ci, other.first, port.first, dly)) continue; IOPath iop; @@ -323,12 +323,12 @@ void Context::writeSDF(std::ostream &out, bool cvc_mode) const ic.from.port = ni->driver.port.str(this); ic.to.cell = usr.cell->name.str(this); ic.to.port = usr.port.str(this); - // FIXME: min/max routing delay - or at least constructing DelayInfo here - ic.delay = convert_delay(getDelayFromNS(getDelayNS(getNetinfoRouteDelay(ni, usr)))); + // FIXME: min/max routing delay + ic.delay = convert_delay(DelayQuad(getNetinfoRouteDelay(ni, usr))); wr.conn.push_back(ic); } } wr.write(out); } -NEXTPNR_NAMESPACE_END
\ No newline at end of file +NEXTPNR_NAMESPACE_END |