KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_meander_placer_base.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2015 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef __PNS_MEANDER_PLACER_BASE_H
24#define __PNS_MEANDER_PLACER_BASE_H
25
26#include <math/vector2d.h>
27
29
30#include "pns_node.h"
31#include "pns_line.h"
32#include "pns_placement_algo.h"
33#include "pns_meander.h"
34
35namespace PNS {
36
37class ROUTER;
38class SHOVE;
39class OPTIMIZER;
40
46{
47public:
54
55 MEANDER_PLACER_BASE( ROUTER* aRouter );
56 virtual ~MEANDER_PLACER_BASE();
57
61 virtual long long int TuningLengthResult() const = 0;
62
66 virtual int64_t TuningDelayResult() const { return 0; };
67
68 bool HasBaseline() const { return m_hasBaseline; }
69
73 bool HasMeanders() const { return m_hasMeanders; }
74
75 long long int TuningLengthDelta() const { return TuningLengthResult() - m_baselineLength; }
76 int64_t TuningDelayDelta() const { return TuningDelayResult() - m_baselineDelay; }
77
81 virtual TUNING_STATUS TuningStatus() const = 0;
82
88 virtual void AmplitudeStep( int aSign );
89
95 virtual void SpacingStep( int aSign );
96
102 virtual int Clearance();
103
109 virtual const MEANDER_SETTINGS& MeanderSettings() const;
110
111 /*
112 * Set the current meandering configuration.
113 *
114 * @param aSettings the settings.
115 */
116 virtual void UpdateSettings( const MEANDER_SETTINGS& aSettings);
117
125 virtual bool CheckFit( MEANDER_SHAPE* aShape )
126 {
127 return false;
128 }
129
130 virtual const ITEM_SET TunedPath() = 0;
131
132protected:
137 void tuneLineLength( MEANDERED_LINE& aTuned, long long int aElongation );
138
148 long long int lineLength( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
149
159 int64_t lineDelay( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
160
165 void initChainExtras();
166
176 long long int chainNarrowingOffset() const;
177
179 long long int m_baselineLength = 0;
180 int64_t m_baselineDelay = 0;
181 bool m_hasBaseline = false;
182
183 bool m_hasMeanders = false;
184
186 long long int m_startPathLength = 0;
187
191 long long int m_chainExtrasLength = 0;
192 long long int m_chainExtrasDelay = 0;
193 bool m_chainExtrasValid = false;
194
197
200
203
206
211};
212
213}
214
215#endif // __PNS_MEANDER_PLACER_BASE_H
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 ...
virtual void UpdateSettings(const MEANDER_SETTINGS &aSettings)
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...
bool HasMeanders() const
Return true if the last Move() emitted at least one meander into the tuned path.
TUNING_STATUS
Result of the length tuning operation.
virtual void SpacingStep(int aSign)
Increase/decrease the current meandering spacing by one step.
int m_currentWidth
Width of the meandered trace(s).
long long int m_startPathLength
Active path length at Start().
VECTOR2I m_currentEnd
The current end point.
virtual bool CheckFit(MEANDER_SHAPE *aShape)
Checks if it's OK to place the shape aShape (i.e.
virtual int64_t TuningDelayResult() const
Return the resultant delay or skew of the tuned traces.
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)
virtual int Clearance()
Return the clearance of the track(s) being length tuned.
long long int TuningLengthDelta() const
virtual const ITEM_SET TunedPath()=0
virtual TUNING_STATUS TuningStatus() const =0
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
virtual const MEANDER_SETTINGS & MeanderSettings() const
Return the current meandering configuration.
long long int m_chainExtrasLength
Aggregate length/delay of other nets in the same chain, cached at Start().
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)
virtual void AmplitudeStep(int aSign)
Increase/decreases the current meandering amplitude by one step.
long long int m_baselineLength
The tuning results as they were at Start(). The deltas measure change from these.
virtual long long int TuningLengthResult() const =0
Return the resultant length or skew of the tuned traces.
Dimensions for the meandering algorithm.
Definition pns_meander.h:70
The geometry of a single meander.
Keep the router "world" - i.e.
Definition pns_node.h:244
Perform various optimizations of the lines being routed, attempting to make the lines shorter and les...
PLACEMENT_ALGO(ROUTER *aRouter)
The actual Push and Shove algorithm.
Definition pns_shove.h:47
Push and Shove diff pair dimensions (gap) settings dialog.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708