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 along
20 * with this program. If not, see <http://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_baselineLength != 0 || m_baselineDelay != 0; }
69
70 long long int TuningLengthDelta() const { return TuningLengthResult() - m_baselineLength; }
71 int64_t TuningDelayDelta() const { return TuningDelayResult() - m_baselineDelay; }
72
76 virtual TUNING_STATUS TuningStatus() const = 0;
77
83 virtual void AmplitudeStep( int aSign );
84
90 virtual void SpacingStep( int aSign );
91
97 virtual int Clearance();
98
104 virtual const MEANDER_SETTINGS& MeanderSettings() const;
105
106 /*
107 * Set the current meandering configuration.
108 *
109 * @param aSettings the settings.
110 */
111 virtual void UpdateSettings( const MEANDER_SETTINGS& aSettings);
112
120 virtual bool CheckFit( MEANDER_SHAPE* aShape )
121 {
122 return false;
123 }
124
125 virtual const ITEM_SET TunedPath() = 0;
126
127protected:
132 void tuneLineLength( MEANDERED_LINE& aTuned, long long int aElongation );
133
134 VECTOR2I getSnappedStartPoint( LINKED_ITEM* aStartItem, VECTOR2I aStartPoint );
135
141 long long int lineLength( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
142
148 int64_t lineDelay( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
149
154 void initChainExtras();
155
165 long long int chainNarrowingOffset() const;
166
168 long long int m_baselineLength = 0;
169 int64_t m_baselineDelay = 0;
170
174 long long int m_chainExtrasLength = 0;
175 long long int m_chainExtrasDelay = 0;
176 bool m_chainExtrasValid = false;
177
180
183
186
189
194};
195
196}
197
198#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...
int64_t m_baselineDelay
Aggregate length/delay of other nets in the same chain, cached at Start().
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
Meander settings.
bool m_chainExtrasValid
Pointer to world to search colliding items.
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
The current end point.
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.
NODE * m_world
Width of the meandered trace(s).
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)
virtual void AmplitudeStep(int aSign)
Increase/decreases the current meandering amplitude by one step.
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:240
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:46
Push and Shove diff pair dimensions (gap) settings dialog.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687