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 /machxo2 | |
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 'machxo2')
-rw-r--r-- | machxo2/arch.h | 18 | ||||
-rw-r--r-- | machxo2/archdefs.h | 21 |
2 files changed, 3 insertions, 36 deletions
diff --git a/machxo2/arch.h b/machxo2/arch.h index adc6e25c..7a22dd91 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -509,7 +509,7 @@ struct Arch : BaseArch<ArchRanges> return IdStringList(ids); } - DelayInfo getWireDelay(WireId wire) const override { return DelayInfo(); } + DelayQuad getWireDelay(WireId wire) const override { return DelayQuad(0); } WireRange getWires() const override { @@ -582,14 +582,7 @@ struct Arch : BaseArch<ArchRanges> return wire; } - DelayInfo getPipDelay(PipId pip) const override - { - DelayInfo delay; - - delay.delay = 0.01; - - return delay; - } + DelayQuad getPipDelay(PipId pip) const override { return DelayQuad(0); } PipRange getPipsDownhill(WireId wire) const override { @@ -633,12 +626,7 @@ struct Arch : BaseArch<ArchRanges> delay_t getRipupDelayPenalty() const override { return 0.015; } float getDelayNS(delay_t v) const override { return v; } - DelayInfo getDelayFromNS(float ns) const override - { - DelayInfo del; - del.delay = ns; - return del; - } + delay_t getDelayFromNS(float ns) const override { return ns; } uint32_t getDelayChecksum(delay_t v) const override { return v; } diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index 844a87b6..f822b907 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -26,27 +26,6 @@ NEXTPNR_NAMESPACE_BEGIN typedef float delay_t; -struct DelayInfo -{ - delay_t delay = 0; - - delay_t minRaiseDelay() const { return delay; } - delay_t maxRaiseDelay() const { return delay; } - - delay_t minFallDelay() const { return delay; } - delay_t maxFallDelay() const { return delay; } - - delay_t minDelay() const { return delay; } - delay_t maxDelay() const { return delay; } - - DelayInfo operator+(const DelayInfo &other) const - { - DelayInfo ret; - ret.delay = this->delay + other.delay; - return ret; - } -}; - enum ConstIds { ID_NONE |