KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_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
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef __PNS_MEANDER_PLACER_H
24#define __PNS_MEANDER_PLACER_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"
35
36namespace PNS {
37
38class ROUTER;
39class SHOVE;
40class OPTIMIZER;
41
46{
47public:
48
49 MEANDER_PLACER( ROUTER* aRouter );
50 virtual ~MEANDER_PLACER();
51
53 virtual bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
54
56 virtual bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
57
59 virtual bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
60
62 bool CommitPlacement() override;
63
65 bool AbortPlacement() override;
66
68 bool HasPlacedAnything() const override;
69
71 NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
72
74 const ITEM_SET Traces() override;
75
76 const ITEM_SET TunedPath() override;
77
79 const VECTOR2I& CurrentStart() const override;
80
82 const VECTOR2I& CurrentEnd() const override;
83
85 const std::vector<NET_HANDLE> CurrentNets() const override
86 {
87 return std::vector<NET_HANDLE> (1, m_originLine.Net() );
88 }
89
91 int CurrentLayer() const override;
92
94 long long int TuningLengthResult() const override;
95
97 int64_t TuningDelayResult() const override;
98
100 TUNING_STATUS TuningStatus() const override;
101
103 bool CheckFit ( MEANDER_SHAPE* aShape ) override;
104
105protected:
106 bool doMove( const VECTOR2I& aP, ITEM* aEndItem, long long int aTargetLength,
107 long long int aTargetMin, long long int aTargetMax );
108
109 virtual long long int origPathLength() const;
110
111 virtual int64_t origPathDelay() const;
112
113 virtual void calculateTimeDomainTargets();
114
117
120
124
128
131
134
137
138 long long int m_lastLength;
139 int64_t m_lastDelay;
141};
142
143}
144
145#endif // __PNS_MEANDER_PLACER_H
A collection of nets and the parameters used to route or test these nets.
Definition netclass.h:43
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.
TUNING_STATUS
Result of the length tuning operation.
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)
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
const std::vector< NET_HANDLE > CurrentNets() const override
Returns the net(s) of currently routed track(s).
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.
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...
The actual Push and Shove algorithm.
Definition pns_shove.h:47
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.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708