KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::MEANDER_PLACER_BASE Class Referenceabstract

Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code. More...

#include <pns_meander_placer_base.h>

Inheritance diagram for PNS::MEANDER_PLACER_BASE:
PNS::PLACEMENT_ALGO PNS::ALGO_BASE PNS::DP_MEANDER_PLACER PNS::MEANDER_PLACER PNS::MEANDER_SKEW_PLACER

Public Types

enum  TUNING_STATUS { TOO_SHORT = 0 , TOO_LONG , TUNED }
 < Result of the length tuning operation More...
 

Public Member Functions

 MEANDER_PLACER_BASE (ROUTER *aRouter)
 
virtual ~MEANDER_PLACER_BASE ()
 
virtual long long int TuningResult () const =0
 Return the resultant length or skew of the tuned traces.
 
virtual TUNING_STATUS TuningStatus () const =0
 Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
 
virtual void AmplitudeStep (int aSign)
 Increase/decreases the current meandering amplitude by one step.
 
virtual void SpacingStep (int aSign)
 Increase/decrease the current meandering spacing by one step.
 
virtual int Clearance ()
 Return the clearance of the track(s) being length tuned.
 
virtual const MEANDER_SETTINGSMeanderSettings () const
 Return the current meandering configuration.
 
virtual void UpdateSettings (const MEANDER_SETTINGS &aSettings)
 
virtual bool CheckFit (MEANDER_SHAPE *aShape)
 Checks if it's OK to place the shape aShape (i.e.
 
int GetTotalPadToDieLength (const LINE &aLine) const
 
virtual const ITEM_SET TunedPath ()=0
 
virtual bool Start (const VECTOR2I &aP, ITEM *aStartItem)=0
 Function Start()
 
virtual bool Move (const VECTOR2I &aP, ITEM *aEndItem)=0
 Function Move()
 
virtual bool FixRoute (const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
 Function FixRoute()
 
virtual std::optional< VECTOR2IUnfixRoute ()
 
virtual bool CommitPlacement ()
 
virtual bool AbortPlacement ()
 
virtual bool HasPlacedAnything () const
 
virtual bool ToggleVia (bool aEnabled)
 Function ToggleVia()
 
virtual bool IsPlacingVia () const
 Function IsPlacingVia()
 
virtual bool SetLayer (int aLayer)
 Function SetLayer()
 
virtual const ITEM_SET Traces ()=0
 Function Traces()
 
virtual const VECTOR2ICurrentStart () const =0
 Function CurrentStart()
 
virtual const VECTOR2ICurrentEnd () const =0
 Function CurrentEnd()
 
virtual const std::vector< NET_HANDLECurrentNets () const =0
 Function CurrentNets()
 
virtual int CurrentLayer () const =0
 Function CurrentLayer()
 
virtual NODECurrentNode (bool aLoopsRemoved=false) const =0
 Function CurrentNode()
 
virtual void FlipPosture ()
 Function FlipPosture()
 
virtual void UpdateSizes (const SIZES_SETTINGS &aSizes)
 Function UpdateSizes()
 
virtual void SetOrthoMode (bool aOrthoMode)
 Function SetOrthoMode()
 
virtual void GetModifiedNets (std::vector< NET_HANDLE > &aNets) const
 Function GetModifiedNets.
 
ROUTERRouter () const
 Return current router settings.
 
ROUTING_SETTINGSSettings () const
 Return the logger object, allowing to dump geometry to a file.
 
virtual LOGGERLogger ()
 
void SetLogger (LOGGER *aLogger)
 
void SetDebugDecorator (DEBUG_DECORATOR *aDecorator)
 Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
 
DEBUG_DECORATORDbg () const
 
const BOX2IVisibleViewArea () const
 

Protected Member Functions

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 aElongation.
 
VECTOR2I getSnappedStartPoint (LINKED_ITEM *aStartItem, VECTOR2I aStartPoint)
 
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)
 

Protected Attributes

NODEm_world
 Width of the meandered trace(s).
 
int m_currentWidth
 Meander settings.
 
MEANDER_SETTINGS m_settings
 The current end point.
 
VECTOR2I m_currentEnd
 
SOLIDm_startPad_p
 
SOLIDm_endPad_p
 
SOLIDm_startPad_n
 
SOLIDm_endPad_n
 
DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Detailed Description

Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code.

Definition at line 45 of file pns_meander_placer_base.h.

Member Enumeration Documentation

◆ TUNING_STATUS

< Result of the length tuning operation

Enumerator
TOO_SHORT 
TOO_LONG 
TUNED 

Definition at line 49 of file pns_meander_placer_base.h.

Constructor & Destructor Documentation

◆ MEANDER_PLACER_BASE()

PNS::MEANDER_PLACER_BASE::MEANDER_PLACER_BASE ( ROUTER aRouter)

◆ ~MEANDER_PLACER_BASE()

PNS::MEANDER_PLACER_BASE::~MEANDER_PLACER_BASE ( )
virtual

Definition at line 44 of file pns_meander_placer_base.cpp.

Member Function Documentation

◆ AbortPlacement()

virtual bool PNS::PLACEMENT_ALGO::AbortPlacement ( )
inlinevirtualinherited

◆ AmplitudeStep()

void PNS::MEANDER_PLACER_BASE::AmplitudeStep ( int  aSign)
virtual

Increase/decreases the current meandering amplitude by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 49 of file pns_meander_placer_base.cpp.

References PNS::MEANDER_SETTINGS::m_maxAmplitude, PNS::MEANDER_SETTINGS::m_minAmplitude, m_settings, and PNS::MEANDER_SETTINGS::m_step.

Referenced by DRAWING_TOOL::PlaceTuningPattern().

◆ CheckFit()

virtual bool PNS::MEANDER_PLACER_BASE::CheckFit ( MEANDER_SHAPE aShape)
inlinevirtual

Checks if it's OK to place the shape aShape (i.e.

if it doesn't cause DRC violations or collide with other meanders).

Parameters
aShapethe shape to check.
Returns
true if the shape fits.

Reimplemented in PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 110 of file pns_meander_placer_base.h.

Referenced by PNS::MEANDER_SHAPE::Fit().

◆ Clearance()

int PNS::MEANDER_PLACER_BASE::Clearance ( )
virtual

◆ CommitPlacement()

virtual bool PNS::PLACEMENT_ALGO::CommitPlacement ( )
inlinevirtualinherited

◆ CurrentEnd()

virtual const VECTOR2I & PNS::PLACEMENT_ALGO::CurrentEnd ( ) const
pure virtualinherited

Function CurrentEnd()

Returns the current end of the line(s) being placed/tuned. It may not be equal to the cursor position due to collisions.

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, and PNS::MEANDER_PLACER.

Referenced by PNS::ROUTER::ContinueFromEnd(), PNS::ROUTER::Finish(), and ROUTER_TOOL::performRouting().

◆ CurrentLayer()

virtual int PNS::PLACEMENT_ALGO::CurrentLayer ( ) const
pure virtualinherited

Function CurrentLayer()

Returns the layer of currently routed track.

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, and PNS::MEANDER_PLACER.

Referenced by Clearance(), and PNS::ROUTER::getNearestRatnestAnchor().

◆ CurrentNets()

virtual const std::vector< NET_HANDLE > PNS::PLACEMENT_ALGO::CurrentNets ( ) const
pure virtualinherited

Function CurrentNets()

Returns the net(s) of currently routed track(s).

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, and PNS::MEANDER_PLACER.

Referenced by PNS::ROUTER::getNearestRatnestAnchor().

◆ CurrentNode()

virtual NODE * PNS::PLACEMENT_ALGO::CurrentNode ( bool  aLoopsRemoved = false) const
pure virtualinherited

Function CurrentNode()

Returns the most recent board state.

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, and PNS::MEANDER_PLACER.

Referenced by PNS::ROUTER::getNearestRatnestAnchor().

◆ CurrentStart()

virtual const VECTOR2I & PNS::PLACEMENT_ALGO::CurrentStart ( ) const
pure virtualinherited

Function CurrentStart()

Returns the current start of the line(s) being placed/tuned.

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, and PNS::MEANDER_PLACER.

Referenced by PNS::ROUTER::getNearestRatnestAnchor(), and ROUTER_TOOL::performRouting().

◆ Dbg()

DEBUG_DECORATOR * PNS::ALGO_BASE::Dbg ( ) const
inlineinherited

◆ FixRoute()

virtual bool PNS::PLACEMENT_ALGO::FixRoute ( const VECTOR2I aP,
ITEM aEndItem,
bool  aForceFinish = false 
)
pure virtualinherited

Function FixRoute()

Commits the currently routed items to the parent node, taking aP as the final end point and aEndItem as the final anchor (if provided).

Returns
true, if route has been committed. May return false if the routing result is violating design rules - in such case, the track is only committed if Settings.CanViolateDRC() is on.

Implemented in PNS::DIFF_PAIR_PLACER, PNS::LINE_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ FlipPosture()

virtual void PNS::PLACEMENT_ALGO::FlipPosture ( )
inlinevirtualinherited

Function FlipPosture()

Toggles the current posture (straight/diagonal) of the trace head.

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 167 of file pns_placement_algo.h.

◆ GetModifiedNets()

virtual void PNS::PLACEMENT_ALGO::GetModifiedNets ( std::vector< NET_HANDLE > &  aNets) const
inlinevirtualinherited

Function GetModifiedNets.

Returns the nets of all currently routed trace(s)

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 198 of file pns_placement_algo.h.

◆ getSnappedStartPoint()

VECTOR2I PNS::MEANDER_PLACER_BASE::getSnappedStartPoint ( LINKED_ITEM aStartItem,
VECTOR2I  aStartPoint 
)
protected

◆ GetTotalPadToDieLength()

int PNS::MEANDER_PLACER_BASE::GetTotalPadToDieLength ( const LINE aLine) const

◆ HasPlacedAnything()

virtual bool PNS::PLACEMENT_ALGO::HasPlacedAnything ( ) const
inlinevirtualinherited

◆ IsPlacingVia()

virtual bool PNS::PLACEMENT_ALGO::IsPlacingVia ( ) const
inlinevirtualinherited

Function IsPlacingVia()

Returns true if the placer is placing a via (or more vias).

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 104 of file pns_placement_algo.h.

◆ lineLength()

long long int PNS::MEANDER_PLACER_BASE::lineLength ( const ITEM_SET aLine,
const SOLID aStartPad,
const SOLID aEndPad 
) const
protected

Calculate the total length of the line represented by an item set (tracks and vias)

Parameters
aLine
Returns
Pointer to world to search colliding items.

If there is a start pad but the pad's layers do not overlap the first track layer, then there must be a fanout via on the line. If there isn't, we still need to have the via back to the pad, so count the distance in the line tuning

Definition at line 322 of file pns_meander_placer_base.cpp.

References PNS::ITEM_SET::Empty(), PNS::ROUTER::GetInterface(), PNS::ITEM::Layer(), PNS::ITEM::LayersOverlap(), PNS::ALGO_BASE::m_router, PNS::ITEM::OfKind(), PNS::ITEM_SET::Size(), PNS::ROUTER_IFACE::StackupHeight(), and PNS::ITEM::VIA_T.

Referenced by PNS::DP_MEANDER_PLACER::origPathLength(), PNS::MEANDER_PLACER::origPathLength(), PNS::MEANDER_SKEW_PLACER::origPathLength(), and PNS::MEANDER_SKEW_PLACER::Start().

◆ Logger()

LOGGER * PNS::ALGO_BASE::Logger ( )
virtualinherited

◆ MeanderSettings()

const MEANDER_SETTINGS & PNS::MEANDER_PLACER_BASE::MeanderSettings ( ) const
virtual

◆ Move()

virtual bool PNS::PLACEMENT_ALGO::Move ( const VECTOR2I aP,
ITEM aEndItem 
)
pure virtualinherited

Function Move()

Moves the end of the currently routed primtive(s) to the point aP, taking aEndItem as the anchor (if not NULL). (unless NULL).

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

◆ Router()

◆ SetDebugDecorator()

void PNS::ALGO_BASE::SetDebugDecorator ( DEBUG_DECORATOR aDecorator)
inlineinherited

Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.

Definition at line 73 of file pns_algo_base.h.

References PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::SHOVE::SHOVE(), and PNS::DRAGGER::tryWalkaround().

◆ SetLayer()

virtual bool PNS::PLACEMENT_ALGO::SetLayer ( int  aLayer)
inlinevirtualinherited

Function SetLayer()

Sets the current routing layer.

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 114 of file pns_placement_algo.h.

◆ SetLogger()

void PNS::ALGO_BASE::SetLogger ( LOGGER aLogger)
inlineinherited

◆ SetOrthoMode()

virtual void PNS::PLACEMENT_ALGO::SetOrthoMode ( bool  aOrthoMode)
inlinevirtualinherited

Function SetOrthoMode()

Forces the router to place a straight 90/45 degree trace (with the end as near to the cursor as possible) instead of a standard 135 degree two-segment bend.

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 189 of file pns_placement_algo.h.

◆ Settings()

◆ SpacingStep()

void PNS::MEANDER_PLACER_BASE::SpacingStep ( int  aSign)
virtual

Increase/decrease the current meandering spacing by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 58 of file pns_meander_placer_base.cpp.

References Clearance(), m_currentWidth, m_settings, PNS::MEANDER_SETTINGS::m_spacing, and PNS::MEANDER_SETTINGS::m_step.

Referenced by DRAWING_TOOL::PlaceTuningPattern().

◆ Start()

virtual bool PNS::PLACEMENT_ALGO::Start ( const VECTOR2I aP,
ITEM aStartItem 
)
pure virtualinherited

Function Start()

Starts placement/drag operation at point aP, taking item aStartItem as anchor (unless NULL).

Implemented in PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::LINE_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

◆ ToggleVia()

virtual bool PNS::PLACEMENT_ALGO::ToggleVia ( bool  aEnabled)
inlinevirtualinherited

Function ToggleVia()

Enables/disables a via at the end of currently routed trace.

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 94 of file pns_placement_algo.h.

◆ Traces()

virtual const ITEM_SET PNS::PLACEMENT_ALGO::Traces ( )
pure virtualinherited

◆ TunedPath()

virtual const ITEM_SET PNS::MEANDER_PLACER_BASE::TunedPath ( )
pure virtual

◆ tuneLineLength()

void PNS::MEANDER_PLACER_BASE::tuneLineLength ( MEANDERED_LINE aTuned,
long long int  aElongation 
)
protected

◆ TuningResult()

virtual long long int PNS::MEANDER_PLACER_BASE::TuningResult ( ) const
pure virtual

Return the resultant length or skew of the tuned traces.

Implemented in PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

Referenced by PCB_TUNING_PATTERN::Update().

◆ TuningStatus()

virtual TUNING_STATUS PNS::MEANDER_PLACER_BASE::TuningStatus ( ) const
pure virtual

Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.

Implemented in PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Referenced by PCB_TUNING_PATTERN::Update().

◆ UnfixRoute()

virtual std::optional< VECTOR2I > PNS::PLACEMENT_ALGO::UnfixRoute ( )
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER.

Definition at line 81 of file pns_placement_algo.h.

◆ UpdateSettings()

void PNS::MEANDER_PLACER_BASE::UpdateSettings ( const MEANDER_SETTINGS aSettings)
virtual

◆ UpdateSizes()

virtual void PNS::PLACEMENT_ALGO::UpdateSizes ( const SIZES_SETTINGS aSizes)
inlinevirtualinherited

Function UpdateSizes()

Performs on-the-fly update of the width, via diameter & drill size from a settings class. Used to dynamically change these parameters as the track is routed.

Reimplemented in PNS::DIFF_PAIR_PLACER, and PNS::LINE_PLACER.

Definition at line 178 of file pns_placement_algo.h.

◆ VisibleViewArea()

const BOX2I & PNS::ALGO_BASE::VisibleViewArea ( ) const
inherited

Member Data Documentation

◆ m_currentEnd

◆ m_currentWidth

int PNS::MEANDER_PLACER_BASE::m_currentWidth
protected

◆ m_debugDecorator

DEBUG_DECORATOR* PNS::ALGO_BASE::m_debugDecorator
protectedinherited

Definition at line 86 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().

◆ m_endPad_n

◆ m_endPad_p

◆ m_logger

LOGGER* PNS::ALGO_BASE::m_logger
protectedinherited

Definition at line 88 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Logger(), and PNS::ALGO_BASE::SetLogger().

◆ m_router

◆ m_settings

◆ m_startPad_n

◆ m_startPad_p

◆ m_world


The documentation for this class was generated from the following files: