144 const int64_t curDelayNet = curDelayChain -
m_settings.m_signalExtraDelay;
153 int64_t desiredDelayMin = targetDelaySet.
Min();
154 int64_t desiredDelayOpt = targetDelaySet.
Opt();
155 int64_t desiredDelayMax = targetDelaySet.
Max();
158 if( useSignalTarget )
160 desiredDelayMin = std::max<int64_t>( 0, desiredDelayMin -
m_settings.m_signalExtraDelay );
161 desiredDelayOpt = std::max<int64_t>( 0, desiredDelayOpt -
m_settings.m_signalExtraDelay );
162 desiredDelayMax = std::max<int64_t>( desiredDelayOpt, desiredDelayMax -
m_settings.m_signalExtraDelay );
166 const int64_t curDelay = useSignalTarget ? curDelayNet : curDelayChain;
168 const int64_t delayDifferenceOpt = desiredDelayOpt - curDelay;
171 const int64_t lengthDiffMin =
m_router->GetInterface()->CalculateLengthForDelay(
174 int64_t lengthDiffOpt =
m_router->GetInterface()->CalculateLengthForDelay(
177 const int64_t lengthDiffMax =
m_router->GetInterface()->CalculateLengthForDelay(
181 lengthDiffOpt = delayDifferenceOpt > 0 ? lengthDiffOpt : -lengthDiffOpt;
183 m_settings.m_targetLength.SetMin( curLength + lengthDiffOpt - lengthDiffMin );
184 m_settings.m_targetLength.SetOpt( curLength + lengthDiffOpt );
185 m_settings.m_targetLength.SetMax( curLength + lengthDiffOpt + lengthDiffMax );
205 long long budgetMin = std::max( 0LL,
m_settings.m_targetSignalLength.Min() - otherLen );
206 long long budgetOpt = std::max( 0LL,
m_settings.m_targetSignalLength.Opt() - otherLen );
207 long long budgetMax = std::max( budgetOpt,
m_settings.m_targetSignalLength.Max() - otherLen );
211 m_settings.m_targetLength.SetMin( budgetMin );
212 m_settings.m_targetLength.SetOpt( budgetOpt );
213 m_settings.m_targetLength.SetMax( budgetMax );
231 long long int aTargetMin,
long long int aTargetMax )
253 ssize_t arcIndex = tuned.
ArcIndex( i );
268 side = s.
Side( aP ) < 0;
284 if( lineLen >
m_settings.m_targetLength.Max() )
295 -
m_router->GetInterface()->CalculateDelayForShapeLineChain(
309 m_router->GetInterface()->DisplayPathLine( l->CLine(), 1 );
321 tuned.
Append ( m->CLine( 0 ) );
409 int w = aShape->
Width();
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
ROUTER * Router() const
Return the instance of our router.
DEBUG_DECORATOR * Dbg() const
Base class for PNS router board items.
BOARD_ITEM * GetSourceItem() const
bool OfKind(int aKindMask) const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Represent a set of meanders fitted over a single or two lines.
long long int chainNarrowingOffset() const
Return the length offset to subtract when converting a user-facing total signal length target into a ...
void tuneLineLength(MEANDERED_LINE &aTuned, long long int aElongation)
Take a set of meanders in aTuned and tunes their length to extend the original line length by aElonga...
TUNING_STATUS
Result of the length tuning operation.
int m_currentWidth
Width of the meandered trace(s).
MEANDER_PLACER_BASE(ROUTER *aRouter)
long long int m_startPathLength
Active path length at Start().
long long int m_chainExtrasDelay
VECTOR2I m_currentEnd
The current end point.
void initChainExtras()
Cache the per-session chain-extras length/delay (other nets in the same chain) so per-Move use does n...
MEANDER_SETTINGS m_settings
Meander settings.
int64_t lineDelay(const ITEM_SET &aLine, const SOLID *aStartPad, const SOLID *aEndPad) const
Calculate the total delay of the line represented by an item set (tracks and vias)
NODE * m_world
Pointer to world to search colliding items.
long long int lineLength(const ITEM_SET &aLine, const SOLID *aStartPad, const SOLID *aEndPad) const
Calculate the total length of the line represented by an item set (tracks and vias)
long long int m_baselineLength
The tuning results as they were at Start(). The deltas measure change from these.
NODE * m_currentNode
Current world state.
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Commit the currently routed items to the parent node, taking aP as the final end point and aEndItem a...
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength, long long int aTargetMin, long long int aTargetMax)
TUNING_STATUS m_lastStatus
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Move the end of the currently routed primtive(s) to the point aP, taking aEndItem as the anchor (if n...
virtual long long int origPathLength() const
int CurrentLayer() const override
Return the layer of currently routed track.
virtual void calculateTimeDomainTargets()
int m_padToDieDelay
Total length added by pad to die size.
const VECTOR2I & CurrentEnd() const override
Return the current end of the line(s) being placed/tuned.
const VECTOR2I & CurrentStart() const override
Return the current start of the line(s) being placed/tuned.
long long int TuningLengthResult() const override
Return the resultant length or skew of the tuned traces.
bool AbortPlacement() override
int64_t TuningDelayResult() const override
Return the resultant delay or skew of the tuned traces.
bool HasPlacedAnything() const override
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent board state.
LINKED_ITEM * m_initialSegment
virtual ~MEANDER_PLACER()
SHAPE_LINE_CHAIN m_finalShape
const ITEM_SET TunedPath() override
const ITEM_SET Traces() override
Return all routed/tuned traces.
MEANDER_PLACER(ROUTER *aRouter)
virtual int64_t origPathDelay() const
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
VECTOR2I m_currentStart
current routing start point (end of tail, beginning of head)
TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start placement/drag operation at point aP, taking item aStartItem as anchor (unless NULL).
int m_padToDieLength
Total length added by pad to die size.
bool CommitPlacement() override
NETCLASS * m_netClass
The netclass for the placed segments.
long long int m_lastLength
static const long long int LENGTH_UNCONSTRAINED
static const long long int DELAY_UNCONSTRAINED
The geometry of a single meander.
const SHAPE_LINE_CHAIN & CLine(int aShape) const
Keep the router "world" - i.e.
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
void SetFailureReason(const wxString &aReason)
const ITEM_SET AssembleTuningPath(ROUTER_IFACE *aRouterIface, ITEM *aStart, SOLID **aStartPad=nullptr, SOLID **aEndPad=nullptr)
Like AssembleTrivialPath, but follows the track length algorithm, which discards segments that are fu...
int Side(const VECTOR2I &aP) const
Determine on which side of directed line passing via segment ends point aP lies.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SHAPE_ARC & Arc(size_t aArc) const
ssize_t ArcIndex(size_t aSegment) const
Return the arc index for the given segment index.
void Clear()
Remove all points from the line chain.
void Simplify(int aTolerance=0)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
int NextShape(int aPointIndex) const
Return the vertex index of the next shape in the chain, or -1 if aPointIndex is the last shape.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
bool IsArcSegment(size_t aSegment) const
long long int Length() const
Return length of the line chain in Euclidean metric.
Push and Shove diff pair dimensions (gap) settings dialog.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
#define PNS_DBG(dbg, method,...)
static VECTOR2I GetSnappedStartPoint(LINKED_ITEM *aStartItem, VECTOR2I aStartPoint)
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
VECTOR2< int32_t > VECTOR2I