KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_dp_meander_placer.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 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_DP_MEANDER_PLACER_H
24#define __PNS_DP_MEANDER_PLACER_H
25
26#include <math/vector2d.h>
27
28#include <geometry/shape.h>
30
31#include "pns_node.h"
32#include "pns_via.h"
33#include "pns_line.h"
34#include "pns_placement_algo.h"
35#include "pns_meander.h"
37#include "pns_diff_pair.h"
38#include "pns_debug_decorator.h"
39
40namespace PNS {
41
42class ROUTER;
43
49{
50public:
51 DP_MEANDER_PLACER( ROUTER* aRouter );
53
58 bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
59
64 bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
65
74 bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
75
77 bool CommitPlacement() override;
78
80 bool AbortPlacement() override;
81
83 bool HasPlacedAnything() const override;
84
85 const LINE Trace() const;
86
87 const DIFF_PAIR& GetOriginPair();
88
92 NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
93
94 const ITEM_SET Traces() override;
95
96 const ITEM_SET TunedPath() override;
97
99 const VECTOR2I& CurrentStart() const override;
100
102 const VECTOR2I& CurrentEnd() const override;
103
105 const std::vector<NET_HANDLE> CurrentNets() const override;
106
107 int CurrentLayer() const override;
108
109 long long int totalLength();
110
111 long long int TuningLengthResult() const override;
112
114 int64_t TuningDelayResult() const override;
115
116 TUNING_STATUS TuningStatus() const override;
117
118 bool CheckFit( MEANDER_SHAPE* aShape ) override;
119
120
121private:
122 friend class MEANDER_SHAPE;
123
124 void meanderSegment( const SEG& aBase );
125
126// void addMeander ( PNS_MEANDER *aM );
127// void addCorner ( const VECTOR2I& aP );
128
129 const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
130 bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
131
132 void setWorld( NODE* aWorld );
133 void release();
134
135 long long int origPathLength() const;
136
137 int64_t origPathDelay() const;
138
140
143
146
149
152
156
157 long long int m_lastLength;
158 int64_t m_lastDelay;
164
166};
167
168}
169
170#endif // __PNS_DP_MEANDER_PLACER_H
A collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:45
Basic class for a differential pair.
std::vector< COUPLED_SEGMENTS > COUPLED_SEGMENTS_VEC
Differential Pair length-matching/meandering tool.
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
void meanderSegment(const SEG &aBase)
const ITEM_SET Traces() override
Function Traces()
bool pairOrientation(const DIFF_PAIR::COUPLED_SEGMENTS &aPair)
void setWorld(NODE *aWorld)
void calculateTimeDomainTargets()
Current routing start point (end of tail, beginning of head).
VECTOR2I m_currentStart
Current world state.
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Commit the currently routed track to the parent node, taking aP as the final end point and aEndItem a...
long long int totalLength()
int CurrentLayer() const override
Function CurrentLayer()
TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
long long int TuningLengthResult() const override
Return the resultant length or skew of the tuned traces.
const SEG baselineSegment(const DIFF_PAIR::COUPLED_SEGMENTS &aCoupledSegs)
const DIFF_PAIR & GetOriginPair()
const ITEM_SET TunedPath() override
bool HasPlacedAnything() const override
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Move the end of the currently routed trace to the point aP, taking aEndItem as anchor (if not NULL).
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments
const VECTOR2I & CurrentStart() const override
Function CurrentStart()
int64_t TuningDelayResult() const override
Return the resultant delay or skew of the tuned traces.
long long int origPathLength() const
const std::vector< NET_HANDLE > CurrentNets() const override
Function CurrentNets()
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
Base class for PNS router board items.
Definition: pns_item.h:98
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:62
Represent a set of meanders fitted over a single or two lines.
Definition: pns_meander.h:447
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
TUNING_STATUS
< Result of the length tuning operation
The geometry of a single meander.
Definition: pns_meander.h:150
Keep the router "world" - i.e.
Definition: pns_node.h:232
Definition: seg.h:42
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Push and Shove diff pair dimensions (gap) settings dialog.