pcb 4.1.1
An interactive printed circuit board layout editor.

autoroute.c File Reference

Functions used to autoroute nets. More...

#include "global.h"
#include <assert.h>
#include <setjmp.h>
#include "data.h"
#include "macro.h"
#include "autoroute.h"
#include "box.h"
#include "create.h"
#include "draw.h"
#include "error.h"
#include "find.h"
#include "heap.h"
#include "rtree.h"
#include "misc.h"
#include "mtspace.h"
#include "mymem.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
#include "thermal.h"
#include "undo.h"
#include "vector.h"
#include "pcb-printf.h"
#include "hid_draw.h"
Include dependency graph for autoroute.c:

Go to the source code of this file.

Data Structures

struct  routebox_list
struct  routebox
struct  routedata
struct  edge_struct
struct  routeone_state
struct  rb_info
struct  mincost_target_closure
 Some routines to find the minimum *cost* from a cost point to a target (any target). More...
struct  broken_boxes
struct  E_result
struct  break_info
struct  foib_info
struct  therm_info
struct  routeone_via_site_state
 Vectors for via site candidates (see mtspace.h). More...
struct  routeone_status
struct  routeall_status
struct  fpin_info

Defines

#define NET_HEAP   1
#define EXPENSIVE   3e28
#define HALF_THICK(x)   (((x)+1)/2)
#define BLOAT(style)   ((style)->Keepaway + HALF_THICK((style)->Thick))
#define CONFLICT_LEVEL(rb)
#define CONFLICT_PENALTY(rb)
#define _NORTH   1
#define _EAST   2
#define _SOUTH   4
#define _WEST   8
#define LIST_LOOP(init, which, x)
#define FOREACH_SUBNET(net, p)
#define END_FOREACH(net, p)
#define SWAP(t, f, s)   do { t a=s; s=f; f=a; } while (0)

Typedefs

typedef struct routebox_list routebox_list
typedef enum etype etype
typedef struct routebox routebox_t
typedef struct routedata routedata_t
typedef struct edge_struct edge_t

Enumerations

enum  conflict_t { NO_CONFLICT = 0, LO_CONFLICT = 1, HI_CONFLICT = 2 }
enum  etype {
  PAD, PIN, VIA, VIA_SHADOW,
  LINE, OTHER, EXPANSION_AREA, PLANE,
  THERMAL
}
enum  boxlist { NET, SUBNET, ORIGINAL, DIFFERENT_NET }

Functions

static direction_t directionIncrement (direction_t dir)
static routebox_tCreateExpansionArea (const BoxType *area, Cardinal group, routebox_t *parent, bool relax_edge_requirements, edge_t *src_edge)
 Area is the expansion area, on layer group 'group'.
static cost_t edge_cost (const edge_t *e, const cost_t too_big)
 Cost function for an edge.
static void best_path_candidate (struct routeone_state *s, edge_t *e, routebox_t *best_target)
static BoxType edge_to_box (const routebox_t *rb, direction_t expand_dir)
 Given an edge of a box, return a box containing exactly the points on that edge.
static void add_or_destroy_edge (struct routeone_state *s, edge_t *e)
static void RD_DrawThermal (routedata_t *rd, Coord X, Coord Y, Cardinal group, Cardinal layer, routebox_t *subnet, bool is_bad)
 Route-tracing code: once we've got a path of expansion boxes, trace a line through them to actually create the connection.
static void ResetSubnet (routebox_t *net)
static int __routebox_is_good (routebox_t *rb)
static int __edge_is_good (edge_t *e)
int no_planes (const BoxType *b, void *cl)
static struct routebox_list__select_list (routebox_t *r, enum boxlist which)
static void InitLists (routebox_t *r)
static void MergeNets (routebox_t *a, routebox_t *b, enum boxlist which)
static void RemoveFromNet (routebox_t *a, enum boxlist which)
static void init_const_box (routebox_t *rb, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord keepaway)
static BoxType shrink_routebox (const routebox_t *rb)
static cost_t box_area (const BoxType b)
static CheapPointType closest_point_in_routebox (const CheapPointType *from, const routebox_t *rb)
static bool point_in_shrunk_box (const routebox_t *box, Coord X, Coord Y)
static routebox_tAddPin (PointerListType layergroupboxes[], PinType *pin, bool is_via, RouteStyleType *style)
static routebox_tAddPad (PointerListType layergroupboxes[], ElementType *element, PadType *pad, RouteStyleType *style)
static routebox_tAddLine (PointerListType layergroupboxes[], int layergroup, LineType *line, LineType *ptr, RouteStyleType *style)
static routebox_tAddIrregularObstacle (PointerListType layergroupboxes[], Coord X1, Coord Y1, Coord X2, Coord Y2, Cardinal layergroup, void *parent, RouteStyleType *style)
static routebox_tAddPolygon (PointerListType layergroupboxes[], Cardinal layer, PolygonType *polygon, RouteStyleType *style)
static void AddText (PointerListType layergroupboxes[], Cardinal layergroup, TextType *text, RouteStyleType *style)
static routebox_tAddArc (PointerListType layergroupboxes[], Cardinal layergroup, ArcType *arc, RouteStyleType *style)
static int __found_one_on_lg (const BoxType *box, void *cl)
static routebox_tFindRouteBoxOnLayerGroup (routedata_t *rd, Coord X, Coord Y, Cardinal layergroup)
static routedata_tCreateRouteData ()
void DestroyRouteData (routedata_t **rd)
static void RB_up_count (routebox_t *rb)
 Increment the reference count on a routebox.
static void RB_down_count (routebox_t *rb)
 Decrement the reference count on a routebox, freeing if this box becomes unused.
static cost_t cost_to_point_on_layer (const CheapPointType *p1, const CheapPointType *p2, Cardinal point_layer)
static cost_t cost_to_point (const CheapPointType *p1, Cardinal point_layer1, const CheapPointType *p2, Cardinal point_layer2)
static cost_t cost_to_layerless_box (const CheapPointType *p, Cardinal point_layer, const BoxType *b)
 Return the minimum *cost* from a point to a box on any layer.
bool TargetPoint (CheapPointType *nextpoint, const routebox_t *target)
 Get to actual pins/pad target coordinates.
static cost_t cost_to_routebox (const CheapPointType *p, Cardinal point_layer, const routebox_t *rb)
 Return the *minimum cost* from a point to a route box, including possible via costs if the route box is on a different layer.
static BoxType bloat_routebox (routebox_t *rb)
static routebox_troute_parent (routebox_t *rb)
 Return a "parent" of this edge which immediately precedes it in the route.
static vector_tpath_conflicts (routebox_t *rb, routebox_t *conflictor, bool branch)
static void touch_conflicts (vector_t *conflicts, int touch)
 Touch everything (except fixed) on each net found in the conflicts vector. If the vector is different from the last one touched, untouch the last batch and touch the new one. Always call with touch=1 (except for recursive call). Call with NULL, 1 to clear the last batch touched.
static routebox_tnonhomeless_parent (routebox_t *rb)
 Return a "parent" of this edge which resides in a r-tree somewhere.
static int __region_within_guess (const BoxType *region, void *cl)
static int __found_new_guess (const BoxType *box, void *cl)
static routebox_tmincost_target_to_point (const CheapPointType *CostPoint, Cardinal CostPointLayer, rtree_t *targets, routebox_t *target_guess)
 
static edge_tCreateEdge (routebox_t *rb, Coord CostPointX, Coord CostPointY, cost_t cost_to_point, routebox_t *mincost_target_guess, direction_t expand_dir, rtree_t *targets)
 Create edge from field values.
static edge_tCreateEdge2 (routebox_t *rb, direction_t expand_dir, edge_t *previous_edge, rtree_t *targets, routebox_t *guess)
 Create edge, using previous edge to fill in defaults.
static edge_tCreateViaEdge (const BoxType *area, Cardinal group, routebox_t *parent, edge_t *previous_edge, conflict_t to_site_conflict, conflict_t through_site_conflict, rtree_t *targets)
 Create via edge, using previous edge to fill in defaults.
static edge_tCreateEdgeWithConflicts (const BoxType *interior_edge, routebox_t *container, edge_t *previous_edge, cost_t cost_penalty_to_box, rtree_t *targets)
 Create "interior" edge for routing with conflicts.
static void KillEdge (void *edge)
static void DestroyEdge (edge_t **e)
static struct broken_boxes break_box_edge (const BoxType *original, direction_t which_edge, routebox_t *breaker)
static int share_edge (const BoxType *child, const BoxType *parent)
static int edge_intersect (const BoxType *child, const BoxType *parent)
static int __Expand_this_rect (const BoxType *box, void *cl)
 Test method for Expand().
static bool boink_box (routebox_t *rb, struct E_result *res, direction_t dir)
struct E_resultExpand (rtree_t *rtree, edge_t *e, const BoxType *box)
 Main Expand routine.
static int blocker_to_heap (heap_t *heap, routebox_t *rb, BoxType *box, direction_t dir)
 blocker_to_heap puts the blockers into a heap so they can be retrieved in clockwise order. If a blocker is also a target, it gets put into the vector too. It returns 1 for any fixed blocker that is not part of this net and zero otherwise.
static routebox_tCreateBridge (const BoxType *area, routebox_t *parent, direction_t dir)
 This creates an EXPANSION_AREA to bridge small gaps or, (more commonly) create a supper-thin box to provide a home for an expansion edge.
void moveable_edge (vector_t *result, const BoxType *box, direction_t dir, routebox_t *rb, routebox_t *blocker, edge_t *e, rtree_t *targets, struct routeone_state *s, rtree_t *tree, vector_t *area_vec)
 moveable_edge prepares the new search edges based on the starting box, direction and blocker if any.
static int __GatherBlockers (const BoxType *box, void *cl)
static BoxType previous_edge (Coord last, direction_t i, const BoxType *b)
 Shrink the box to the last limit for the previous direction, i.e. if dir is SOUTH, then this means fixing up an EAST leftover edge, which would be the southern most edge for that example.
vector_tBreakManyEdges (struct routeone_state *s, rtree_t *targets, rtree_t *tree, vector_t *area_vec, struct E_result *ans, routebox_t *rb, edge_t *e)
 Break all the edges of the box that need breaking, handling targets as they are found, and putting any moveable edges in the return vector.
static routebox_trb_source (routebox_t *rb)
static int foib_rect_in_reg (const BoxType *box, void *cl)
static routebox_tFindOneInBox (rtree_t *rtree, routebox_t *rb)
static int ftherm_rect_in_reg (const BoxType *box, void *cl)
routebox_tFindThermable (rtree_t *rtree, routebox_t *rb)
 Check for a pin or via target that a polygon can just use a thermal to connect to.
static void RD_DrawVia (routedata_t *rd, Coord X, Coord Y, Coord radius, routebox_t *subnet, bool is_bad)
static void RD_DrawLine (routedata_t *rd, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord halfthick, Cardinal group, routebox_t *subnet, bool is_bad, bool is_45)
static bool RD_DrawManhattanLine (routedata_t *rd, const BoxType *box1, const BoxType *box2, CheapPointType start, CheapPointType end, Coord halfthick, Cardinal group, routebox_t *subnet, bool is_bad, bool last_was_x)
static void TracePath (routedata_t *rd, routebox_t *path, const routebox_t *target, routebox_t *subnet, bool is_bad)
 This back-traces the expansion boxes along the best path it draws the lines that will make the actual path.
static void CreateSearchEdge (struct routeone_state *s, vetting_t *work, edge_t *parent, routebox_t *rb, conflict_t conflict, rtree_t *targets, bool in_plane)
 Create a fake "edge" used to defer via site searching.
void add_via_sites (struct routeone_state *s, struct routeone_via_site_state *vss, mtspace_t *mtspace, routebox_t *within, conflict_t within_conflict_level, edge_t *parent_edge, rtree_t *targets, Coord shrink, bool in_plane)
void do_via_search (edge_t *search, struct routeone_state *s, struct routeone_via_site_state *vss, mtspace_t *mtspace, rtree_t *targets)
static int __conflict_source (const BoxType *box, void *cl)
static void source_conflicts (rtree_t *tree, routebox_t *rb)
static struct routeone_status RouteOne (routedata_t *rd, routebox_t *from, routebox_t *to, int max_edges)
static void InitAutoRouteParameters (int pass, RouteStyleType *style, bool with_conflicts, bool is_smoothing, bool lastpass)
int bad_boy (const BoxType *b, void *cl)
bool no_expansion_boxes (routedata_t *rd)
static void ripout_livedraw_obj (routebox_t *rb)
static int ripout_livedraw_obj_cb (const BoxType *b, void *cl)
static double calculate_progress (double this_heap_item, double this_heap_size, struct routeall_status *ras)
struct routeall_status RouteAll (routedata_t *rd)
static int fpin_rect (const BoxType *b, void *cl)
static int FindPin (const BoxType *box, PinType **pin)
bool IronDownAllUnfixedPaths (routedata_t *rd)
 Paths go on first 'on' layer in group.
bool AutoRoute (bool selected)

Variables

struct {
   RouteStyleType *   style
   Coord   bloat
   cost_t   ViaCost
   cost_t   LastConflictPenalty
   cost_t   ConflictPenalty
   cost_t   JogPenalty
   cost_t   CongestionPenalty
   cost_t   NewLayerPenalty
   cost_t   MinPenalty
   int   hi_conflict
   bool   use_vias
   bool   is_odd
   bool   with_conflicts
   bool   is_smoothing
   bool   rip_always
   bool   last_smooth
   unsigned char   pass
AutoRouteParameters
static Cardinal front
static Cardinal back
static bool usedGroup [MAX_GROUP]
static int x_cost [MAX_GROUP]
static int y_cost [MAX_GROUP]
static bool is_layer_group_active [MAX_GROUP]
static int ro = 0
static int smoothes = 1
static int passes = 12
static int routing_layers = 0
static float total_wire_length = 0
static int total_via_count = 0
vector_tarea_vec

Detailed Description

Functions used to autoroute nets.

this file, autoroute.c, was written and is

Copyright (c) 2001 C. Scott Ananian

Copyright (c) 2006 harry eaton

Copyright (c) 2009 harry eaton

This file implements a rectangle-expansion router, based on "A Method for Gridless Routing of Printed Circuit Boards" by A. C. Finch, K. J. Mackenzie, G. J. Balsdon, and G. Symonds in the 1985 Proceedings of the 22nd ACM/IEEE Design Automation Conference.

This reference is available from the ACM Digital Library at http://www.acm.org/dl for those with institutional or personal access to it. It's also available from your local engineering library.

The code is much closer to what is described in the paper now, in that expansion areas can grow from corners and in all directions at once. Previously, these were emulated with discrete boxes moving in the cardinal directions. With the new method, there are fewer but larger expansion boxes that one might do a better job of routing in.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996 Thomas Nau

Copyright (C) 1998,1999,2000,2001 harry eaton

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email: harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA haceaton@aplcomm.jhuapl.edu

Definition in file autoroute.c.


Define Documentation

#define _EAST   2

Definition at line 172 of file autoroute.c.

Referenced by __Expand_this_rect(), and Expand().

#define _NORTH   1

Definition at line 171 of file autoroute.c.

Referenced by __Expand_this_rect(), and Expand().

#define _SOUTH   4

Definition at line 173 of file autoroute.c.

Referenced by __Expand_this_rect(), and Expand().

#define _WEST   8

Definition at line 174 of file autoroute.c.

Referenced by __Expand_this_rect(), and Expand().

#define BLOAT (   style)    ((style)->Keepaway + HALF_THICK((style)->Thick))

Definition at line 158 of file autoroute.c.

Referenced by CreateRouteData().

#define CONFLICT_LEVEL (   rb)
Value:
(((rb)->flags.is_odd==AutoRouteParameters.is_odd) ?\
         HI_CONFLICT : LO_CONFLICT )

Definition at line 162 of file autoroute.c.

#define CONFLICT_PENALTY (   rb)
Value:
((CONFLICT_LEVEL(rb)==HI_CONFLICT ? \
         AutoRouteParameters.ConflictPenalty : \
         CONFLICT_LEVEL(rb)==LO_CONFLICT ? \
         AutoRouteParameters.LastConflictPenalty : 1) * (rb)->pass)

Definition at line 165 of file autoroute.c.

Referenced by moveable_edge().

#define END_FOREACH (   net,
 
)
Value:
}; \
  END_LOOP;\
  /* reset subnet_processed flags */\
  LIST_LOOP(net, same_net, p); \
  p->flags.subnet_processed=0;\
  END_LOOP;\
} while (0)

Definition at line 198 of file autoroute.c.

Referenced by AutoRoute(), and RouteAll().

#define EXPENSIVE   3e28
#define FOREACH_SUBNET (   net,
 
)
Value:
do {\
  routebox_t *_pp_;\
  /* fail-fast: check subnet_processed flags */\
  LIST_LOOP(net, same_net, p); \
  assert(!p->flags.subnet_processed);\
  END_LOOP;\
  /* iterate through *distinct* subnets */\
  LIST_LOOP(net, same_net, p); \
  if (!p->flags.subnet_processed) {\
    LIST_LOOP(p, same_subnet, _pp_);\
    _pp_->flags.subnet_processed=1;\
    END_LOOP

Definition at line 186 of file autoroute.c.

Referenced by AutoRoute(), and RouteAll().

#define HALF_THICK (   x)    (((x)+1)/2)
#define LIST_LOOP (   init,
  which,
  x 
)
Value:
do {\
     routebox_t *__next_one__ = (init);\
   x = NULL;\
   if (!__next_one__)\
     assert(__next_one__);\
   else\
   while (!x  || __next_one__ != (init)) {\
     x = __next_one__;\
     /* save next one first in case the command modifies or frees it */\
     __next_one__ = x->which.next

Definition at line 176 of file autoroute.c.

Referenced by AutoRoute(), CreateRouteData(), IronDownAllUnfixedPaths(), ResetSubnet(), RouteAll(), RouteOne(), and touch_conflicts().

#define NET_HEAP   1

Definition at line 60 of file autoroute.c.

#define SWAP (   t,
  f,
  s 
)    do { t a=s; s=f; f=a; } while (0)

Definition at line 206 of file autoroute.c.


Typedef Documentation

typedef struct edge_struct edge_t
typedef enum etype etype
typedef struct routebox_list routebox_list
typedef struct routebox routebox_t
typedef struct routedata routedata_t

Enumeration Type Documentation

enum boxlist
Enumerator:
NET 
SUBNET 
ORIGINAL 
DIFFERENT_NET 

Definition at line 521 of file autoroute.c.

enum conflict_t
Enumerator:
NO_CONFLICT 
LO_CONFLICT 
HI_CONFLICT 

Definition at line 225 of file autoroute.c.

enum etype
Enumerator:
PAD 
PIN 
VIA 
VIA_SHADOW 
LINE 
OTHER 
EXPANSION_AREA 
PLANE 
THERMAL 

Definition at line 234 of file autoroute.c.


Function Documentation

static int __conflict_source ( const BoxType box,
void *  cl 
) [static]

Definition at line 4037 of file autoroute.c.

References routebox::conflicts_with, routebox::fixed, routebox::flags, path_conflicts(), touch_conflicts(), and routebox::touched.

Referenced by source_conflicts().

Here is the call graph for this function:

static int __Expand_this_rect ( const BoxType box,
void *  cl 
) [static]

Test method for Expand().

This routebox potentially is a blocker limiting expansion if this is so, we limit the inflate box so another exactly like it wouldn't be seen. We do this while keep the inflated box as large as possible.

Definition at line 2144 of file autoroute.c.

References _EAST, _NORTH, _SOUTH, _WEST, E_result::bloat, bloat, bloat_box(), E_result::done, E_result::e, EXPANSION_AREA, routebox::expansion_area, routebox::flags, E_result::inflated, routebox::is_via, E_result::keep, RouteStyleType::Keepaway, E_result::n, routebox::nobloat, E_result::orig, routebox::parent, E_result::parent, PLANE, E_result::s, routebox::sbox, routebox::source, routebox::style, routebox::touched, routebox::type, E_result::w, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by Expand().

Here is the call graph for this function:

static int __found_new_guess ( const BoxType box,
void *  cl 
) [static]
static int __found_one_on_lg ( const BoxType box,
void *  cl 
) [static]
static int __region_within_guess ( const BoxType region,
void *  cl 
) [static]

Definition at line 1681 of file autoroute.c.

References cost_to_layerless_box(), mincost_target_closure::CostPoint, mincost_target_closure::CostPointLayer, and mincost_target_closure::nearest.

Referenced by mincost_target_to_point().

Here is the call graph for this function:

static struct routebox_list* __select_list ( routebox_t r,
enum boxlist  which 
) [static, read]
static void add_or_destroy_edge ( struct routeone_state s,
edge_t e 
) [static]
void add_via_sites ( struct routeone_state s,
struct routeone_via_site_state vss,
mtspace_t mtspace,
routebox_t within,
conflict_t  within_conflict_level,
edge_t parent_edge,
rtree_t targets,
Coord  shrink,
bool  in_plane 
)
static routebox_t* AddArc ( PointerListType  layergroupboxes[],
Cardinal  layergroup,
ArcType arc,
RouteStyleType style 
) [static]

Definition at line 850 of file autoroute.c.

References AddIrregularObstacle().

Referenced by CreateRouteData().

Here is the call graph for this function:

static routebox_t* AddIrregularObstacle ( PointerListType  layergroupboxes[],
Coord  X1,
Coord  Y1,
Coord  X2,
Coord  Y2,
Cardinal  layergroup,
void *  parent,
RouteStyleType style 
) [static]

Definition at line 777 of file autoroute.c.

References GetPointerMemory(), init_const_box(), InitLists(), RouteStyleType::Keepaway, PCBType::LayerGroups, malloc(), max_group, LayerGroupType::Number, OTHER, routebox::parent, PCB, and style.

Referenced by AddArc(), AddPolygon(), and AddText().

Here is the call graph for this function:

static routebox_t* AddLine ( PointerListType  layergroupboxes[],
int  layergroup,
LineType line,
LineType ptr,
RouteStyleType style 
) [static]

Definition at line 733 of file autoroute.c.

References ALL, GetPointerMemory(), HALF_THICK, init_const_box(), InitLists(), RouteStyleType::Keepaway, PCBType::LayerGroups, LINE, malloc(), MAX, max_group, MIN, LayerGroupType::Number, PCB, ptr, and style.

Referenced by CreateRouteData().

Here is the call graph for this function:

static routebox_t* AddPad ( PointerListType  layergroupboxes[],
ElementType element,
PadType pad,
RouteStyleType style 
) [static]
static routebox_t* AddPin ( PointerListType  layergroupboxes[],
PinType pin,
bool  is_via,
RouteStyleType style 
) [static]
static void AddText ( PointerListType  layergroupboxes[],
Cardinal  layergroup,
TextType text,
RouteStyleType style 
) [static]

Definition at line 841 of file autoroute.c.

References AddIrregularObstacle().

Referenced by CreateRouteData().

Here is the call graph for this function:

int bad_boy ( const BoxType b,
void *  cl 
)

Definition at line 4652 of file autoroute.c.

References box, EXPANSION_AREA, and routebox::type.

Referenced by no_expansion_boxes().

static void best_path_candidate ( struct routeone_state s,
edge_t e,
routebox_t best_target 
) [static]
static BoxType bloat_routebox ( routebox_t rb) [static]
static int blocker_to_heap ( heap_t heap,
routebox_t rb,
BoxType box,
direction_t  dir 
) [static]

blocker_to_heap puts the blockers into a heap so they can be retrieved in clockwise order. If a blocker is also a target, it gets put into the vector too. It returns 1 for any fixed blocker that is not part of this net and zero otherwise.

Definition at line 2455 of file autoroute.c.

References AutoRouteParameters, bloat_box(), box_is_good(), clip_box(), EAST, routebox::fixed, routebox::flags, heap_insert(), RouteStyleType::Keepaway, NORTH, routebox::sbox, routebox::source, SOUTH, routebox::style, routebox::target, WEST, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by __GatherBlockers(), and BreakManyEdges().

Here is the call graph for this function:

static cost_t box_area ( const BoxType  b) [inline, static]

Definition at line 627 of file autoroute.c.

References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by BreakManyEdges().

static struct broken_boxes break_box_edge ( const BoxType original,
direction_t  which_edge,
routebox_t breaker 
) [static, read]
vector_t* BreakManyEdges ( struct routeone_state s,
rtree_t targets,
rtree_t tree,
vector_t area_vec,
struct E_result ans,
routebox_t rb,
edge_t e 
)
static double calculate_progress ( double  this_heap_item,
double  this_heap_size,
struct routeall_status ras 
) [static]
static CheapPointType closest_point_in_routebox ( const CheapPointType from,
const routebox_t rb 
) [inline, static]

Definition at line 634 of file autoroute.c.

References closest_point_in_box(), and routebox::sbox.

Referenced by cost_to_routebox(), CreateViaEdge(), and TracePath().

Here is the call graph for this function:

static cost_t cost_to_layerless_box ( const CheapPointType p,
Cardinal  point_layer,
const BoxType b 
) [static]

Return the minimum *cost* from a point to a box on any layer.

It's safe to return a smaller than minimum cost.

Definition at line 1376 of file autoroute.c.

References AutoRouteParameters, closest_point_in_box(), cheap_point::X, and cheap_point::Y.

Referenced by __region_within_guess(), and CreateSearchEdge().

Here is the call graph for this function:

static cost_t cost_to_point ( const CheapPointType p1,
Cardinal  point_layer1,
const CheapPointType p2,
Cardinal  point_layer2 
) [static]

Definition at line 1360 of file autoroute.c.

References AutoRouteParameters, and cost_to_point_on_layer().

Referenced by CreateEdge(), and CreateViaEdge().

Here is the call graph for this function:

static cost_t cost_to_point_on_layer ( const CheapPointType p1,
const CheapPointType p2,
Cardinal  point_layer 
) [inline, static]
static cost_t cost_to_routebox ( const CheapPointType p,
Cardinal  point_layer,
const routebox_t rb 
) [static]

Return the *minimum cost* from a point to a route box, including possible via costs if the route box is on a different layer.

Assume routbox is bloated unless it is an expansion area.

Definition at line 1435 of file autoroute.c.

References AutoRouteParameters, closest_point_in_routebox(), routebox::group, max_group, usedGroup, cheap_point::X, and cheap_point::Y.

Referenced by __found_new_guess(), edge_cost(), and mincost_target_to_point().

Here is the call graph for this function:

static routebox_t* CreateBridge ( const BoxType area,
routebox_t parent,
direction_t  dir 
) [static]

This creates an EXPANSION_AREA to bridge small gaps or, (more commonly) create a supper-thin box to provide a home for an expansion edge.

Definition at line 2498 of file autoroute.c.

References closest_point_in_box(), routebox::conflicts_with, routebox::cost, routebox::cost_point, cost_to_point_on_layer(), EXPANSION_AREA, routebox::group, init_const_box(), malloc(), RB_up_count(), route_parent(), routebox::style, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by moveable_edge().

Here is the call graph for this function:

static edge_t* CreateEdge ( routebox_t rb,
Coord  CostPointX,
Coord  CostPointY,
cost_t  cost_to_point,
routebox_t mincost_target_guess,
direction_t  expand_dir,
rtree_t targets 
) [static]
static edge_t* CreateEdge2 ( routebox_t rb,
direction_t  expand_dir,
edge_t previous_edge,
rtree_t targets,
routebox_t guess 
) [static]

Create edge, using previous edge to fill in defaults.

Most of the work here is in determining a new cost point.

Definition at line 1799 of file autoroute.c.

References AutoRouteParameters, closest_point_in_box(), edge_struct::cost_point, edge_struct::cost_to_point, cost_to_point_on_layer(), CreateEdge(), edge_to_box(), edge_struct::expand_dir, routebox::group, edge_struct::mincost_target, cheap_point::X, and cheap_point::Y.

Referenced by RouteOne().

Here is the call graph for this function:

static edge_t* CreateEdgeWithConflicts ( const BoxType interior_edge,
routebox_t container,
edge_t previous_edge,
cost_t  cost_penalty_to_box,
rtree_t targets 
) [static]

Create "interior" edge for routing with conflicts.

Presently once we "jump inside" the conflicting object we consider it a routing highway to travel inside since it will become available if the conflict is elliminated. That is why we ignore the interior_edge argument.

Definition at line 1914 of file autoroute.c.

References __edge_is_good(), ALL, AutoRouteParameters, closest_point_in_box(), edge_struct::cost_point, edge_struct::cost_to_point, cost_to_point_on_layer(), CreateEdge(), CreateExpansionArea(), edge_struct::flags, routebox::flags, routebox::group, routebox::homeless, edge_struct::is_interior, path_conflicts(), edge_struct::rb, routebox::touched, cheap_point::X, and cheap_point::Y.

Referenced by RouteOne().

Here is the call graph for this function:

static routebox_t * CreateExpansionArea ( const BoxType area,
Cardinal  group,
routebox_t parent,
bool  relax_edge_requirements,
edge_t src_edge 
) [static]

Area is the expansion area, on layer group 'group'.

'parent' is the immediately preceding expansion area, for backtracing. 'lastarea' is the last expansion area created, we string these together in a loop so we can remove them all easily at the end.

Definition at line 2087 of file autoroute.c.

References AutoRouteParameters, box_intersect(), closest_point_in_box(), routebox::conflicts_with, cost_to_point_on_layer(), edge_intersect(), edge_struct::expand_dir, EXPANSION_AREA, routebox::group, init_const_box(), malloc(), RB_up_count(), route_parent(), routebox::sbox, share_edge(), BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by CreateEdgeWithConflicts(), CreateViaEdge(), and RouteOne().

Here is the call graph for this function:

static routedata_t* CreateRouteData ( ) [static]

Definition at line 945 of file autoroute.c.

References AddArc(), AddLine(), AddPad(), AddPin(), AddPolygon(), AddText(), ALLPAD_LOOP, ALLPIN_LOOP, ARC_LOOP, AutoRouteParameters, back, BLOAT, BOTTOM_SIDE, routebox::box, CLEAR_FLAG, routebox::clear_poly, CollectSubnets(), connection(), CONNECTION_LOOP, PCBType::Data, routebox::different_net, DIFFERENT_NET, END_LOOP, ENDALL_LOOP, LayerGroupType::Entries, FIXED, routebox::flags, FreeNetListListMemory(), FreePointerListMemory(), front, GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), GetLayerNumber(), routebox::group, GROUP_LOOP, is_layer_group_active, RouteStyleType::Keepaway, SettingType::Keepaway, layer, DataType::Layer, LAYER_PTR, PCBType::LayerGroups, line, LINE_LOOP, SettingType::LineThickness, LIST_LOOP, malloc(), MAX, max_copper_layer, max_group, PCBType::MaxHeight, PCBType::MaxWidth, MergeNets(), mtspace_add(), mtspace_create(), n, NET, NET_LOOP, NETLIST_LOOP, LayerGroupType::Number, LayerType::On, ORIGINAL, routebox::pad, PCB, pin, POINTER_LOOP, POLYGON_LOOP, ptr, PointerListType::Ptr, PointerListType::PtrMax, PointerListType::PtrN, r_create_tree(), ResetSubnet(), PCBType::RouteStyle, routing_layers, SET_FLAG, Settings, routebox::style, style, TEST_FLAG, TEXT_LOOP, TOP_SIDE, usedGroup, routebox::via, VIA_LOOP, SettingType::ViaDrillingHole, PCBType::ViaOn, SettingType::ViaThickness, BoxType::X1, BoxType::X2, x_cost, BoxType::Y1, BoxType::Y2, and y_cost.

Referenced by AutoRoute().

Here is the call graph for this function:

static void CreateSearchEdge ( struct routeone_state s,
vetting_t work,
edge_t parent,
routebox_t rb,
conflict_t  conflict,
rtree_t targets,
bool  in_plane 
) [static]
static void DestroyEdge ( edge_t **  e) [static]

Definition at line 1958 of file autoroute.c.

References KillEdge().

Referenced by add_or_destroy_edge(), moveable_edge(), and RouteOne().

Here is the call graph for this function:

void DestroyRouteData ( routedata_t **  rd)

Definition at line 1288 of file autoroute.c.

References AutoRouteParameters, max_group, mtspace_destroy(), and r_destroy_tree().

Referenced by AutoRoute().

Here is the call graph for this function:

static direction_t directionIncrement ( direction_t  dir) [static]

Definition at line 113 of file autoroute.c.

References ALL, EAST, NE, NORTH, NW, SE, SOUTH, SW, and WEST.

Referenced by BreakManyEdges().

static cost_t edge_cost ( const edge_t e,
const cost_t  too_big 
) [static]
static int edge_intersect ( const BoxType child,
const BoxType parent 
) [static]

Definition at line 2071 of file autoroute.c.

References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by CreateExpansionArea().

static BoxType edge_to_box ( const routebox_t rb,
direction_t  expand_dir 
) [static]

Given an edge of a box, return a box containing exactly the points on that edge.

Note that the return box is treated as closed; that is, the bottom and right "edges" consist of points (just barely) not in the (half-open) box.

Definition at line 1991 of file autoroute.c.

References EAST, NORTH, shrink_routebox(), SOUTH, WEST, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by CreateEdge2().

Here is the call graph for this function:

struct E_result* Expand ( rtree_t rtree,
edge_t e,
const BoxType box 
) [read]

Main Expand routine.

The expansion probe edge includes the keepaway and half thickness as the search is performed in order to see everything relevant. The result is backed off by this amount before being returned. Targets (and other no-bloat routeboxes) go all the way to touching. This is accomplished by backing off the probe edge when checking for touch against such an object. Usually the expanding edge bumps into neighboring pins on the same device that require a keepaway, preventing seeing a target immediately. Rather than await another expansion to actually touch the target, the edge breaker code looks past the keepaway to see these targets even though they weren't actually touched in the expansion.

Definition at line 2307 of file autoroute.c.

References __Expand_this_rect(), _EAST, _NORTH, _SOUTH, _WEST, ALL, AutoRouteParameters, E_result::bloat, boink_box(), box, routebox::came_from, E_result::done, E_result::e, EAST, edge_struct::expand_dir, E_result::inflated, E_result::keep, RouteStyleType::Keepaway, PCBType::MaxHeight, PCBType::MaxWidth, E_result::n, NE, nonhomeless_parent(), NORTH, NW, E_result::orig, E_result::parent, PCB, r_search(), edge_struct::rb, E_result::s, SE, SOUTH, routebox::style, SW, E_result::w, WEST, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by RouteOne().

Here is the call graph for this function:

static routebox_t* FindOneInBox ( rtree_t rtree,
routebox_t rb 
) [static]

Definition at line 3140 of file autoroute.c.

References foib_info::box, foib_info::env, foib_rect_in_reg(), foib_info::intersect, r_search(), and routebox::sbox.

Referenced by RouteOne().

Here is the call graph for this function:

static int FindPin ( const BoxType box,
PinType **  pin 
) [static]

Definition at line 5056 of file autoroute.c.

References PCBType::Data, fpin_info::env, fpin_rect(), PCB, fpin_info::pin, DataType::pin_tree, r_search(), DataType::via_tree, fpin_info::X, BoxType::X1, fpin_info::Y, and BoxType::Y1.

Referenced by IronDownAllUnfixedPaths().

Here is the call graph for this function:

static routebox_t* FindRouteBoxOnLayerGroup ( routedata_t rd,
Coord  X,
Coord  Y,
Cardinal  layergroup 
) [static]

Definition at line 886 of file autoroute.c.

References __found_one_on_lg(), rb_info::env, routedata::layergrouptree, point_box(), rb_info::query, r_search(), and rb_info::winner.

Referenced by AutoRoute().

Here is the call graph for this function:

routebox_t* FindThermable ( rtree_t rtree,
routebox_t rb 
)

Check for a pin or via target that a polygon can just use a thermal to connect to.

Definition at line 3218 of file autoroute.c.

References therm_info::env, ftherm_rect_in_reg(), therm_info::plane, therm_info::query, r_search(), and shrink_routebox().

Referenced by RouteOne().

Here is the call graph for this function:

static int foib_rect_in_reg ( const BoxType box,
void *  cl 
) [static]

Definition at line 3122 of file autoroute.c.

References bloat_routebox(), foib_info::box, box_intersect(), foib_info::env, routebox::flags, foib_info::intersect, and routebox::touched.

Referenced by FindOneInBox().

Here is the call graph for this function:

static int fpin_rect ( const BoxType b,
void *  cl 
) [static]

Definition at line 5043 of file autoroute.c.

References fpin_info::env, fpin_info::pin, pin, fpin_info::X, pin_st::X, fpin_info::Y, and pin_st::Y.

Referenced by FindPin().

static void init_const_box ( routebox_t rb,
Coord  X1,
Coord  Y1,
Coord  X2,
Coord  Y2,
Coord  keepaway 
) [static]
static void InitAutoRouteParameters ( int  pass,
RouteStyleType style,
bool  with_conflicts,
bool  is_smoothing,
bool  lastpass 
) [static]
static void InitLists ( routebox_t r) [static]

Definition at line 542 of file autoroute.c.

References __select_list(), DIFFERENT_NET, NET, routebox_list::next, ORIGINAL, routebox_list::prev, and SUBNET.

Referenced by AddIrregularObstacle(), AddLine(), AddPad(), AddPin(), RD_DrawLine(), RD_DrawThermal(), and RD_DrawVia().

Here is the call graph for this function:

static void KillEdge ( void *  edge) [static]

Definition at line 1946 of file autoroute.c.

References edge_struct::flags, routebox::flags, routebox::homeless, mtsFreeWork(), edge_struct::rb, RB_down_count(), edge_struct::via_search, and edge_struct::work.

Referenced by DestroyEdge(), and RouteOne().

Here is the call graph for this function:

static void MergeNets ( routebox_t a,
routebox_t b,
enum boxlist  which 
) [static]

Definition at line 555 of file autoroute.c.

References __select_list(), EXPANSION_AREA, routebox_list::next, routebox_list::prev, and routebox::type.

Referenced by AddPin(), AutoRoute(), CreateRouteData(), RD_DrawLine(), RD_DrawThermal(), RD_DrawVia(), and RouteOne().

Here is the call graph for this function:

static routebox_t* mincost_target_to_point ( const CheapPointType CostPoint,
Cardinal  CostPointLayer,
rtree_t targets,
routebox_t target_guess 
) [static]

target_guess is our guess at what the nearest target is, or NULL if we just plum don't have a clue.

Definition at line 1721 of file autoroute.c.

References __found_new_guess(), __region_within_guess(), cost_to_routebox(), mincost_target_closure::CostPoint, mincost_target_closure::CostPointLayer, EXPENSIVE, routebox::flags, mincost_target_closure::nearest, mincost_target_closure::nearest_cost, r_search(), and routebox::target.

Referenced by CreateEdge(), CreateSearchEdge(), and CreateViaEdge().

Here is the call graph for this function:

bool no_expansion_boxes ( routedata_t rd)

Definition at line 4661 of file autoroute.c.

References bad_boy(), routedata::layergrouptree, max_group, r_search(), BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by RouteAll().

Here is the call graph for this function:

int no_planes ( const BoxType b,
void *  cl 
)

Definition at line 508 of file autoroute.c.

References PLANE, and routebox::type.

static routebox_t* nonhomeless_parent ( routebox_t rb) [static]

Return a "parent" of this edge which resides in a r-tree somewhere.

Actually, this "parent" *may* be a via box, which doesn't live in a r-tree.

Definition at line 1664 of file autoroute.c.

References route_parent().

Referenced by Expand().

Here is the call graph for this function:

static vector_t* path_conflicts ( routebox_t rb,
routebox_t conflictor,
bool  branch 
) [static]

Definition at line 1599 of file autoroute.c.

References routebox::conflicts_with, vector_append(), vector_create(), and vector_duplicate().

Referenced by __conflict_source(), CreateEdgeWithConflicts(), and moveable_edge().

Here is the call graph for this function:

static bool point_in_shrunk_box ( const routebox_t box,
Coord  X,
Coord  Y 
) [inline, static]

Definition at line 640 of file autoroute.c.

References point_in_box(), and shrink_routebox().

Referenced by CreateViaEdge().

Here is the call graph for this function:

static BoxType previous_edge ( Coord  last,
direction_t  i,
const BoxType b 
) [inline, static]

Shrink the box to the last limit for the previous direction, i.e. if dir is SOUTH, then this means fixing up an EAST leftover edge, which would be the southern most edge for that example.

Definition at line 2770 of file autoroute.c.

References EAST, Message(), SOUTH, WEST, BoxType::X1, BoxType::X2, and BoxType::Y1.

Referenced by BreakManyEdges().

Here is the call graph for this function:

static void RB_down_count ( routebox_t rb) [static]

Decrement the reference count on a routebox, freeing if this box becomes unused.

Definition at line 1318 of file autoroute.c.

References routebox::expansion_area, EXPANSION_AREA, routebox::flags, routebox::homeless, routebox::parent, routebox::refcount, and routebox::type.

Referenced by best_path_candidate(), KillEdge(), and moveable_edge().

static routebox_t* rb_source ( routebox_t rb) [static]
static void RB_up_count ( routebox_t rb) [static]

Increment the reference count on a routebox.

Definition at line 1307 of file autoroute.c.

References routebox::flags, routebox::homeless, and routebox::refcount.

Referenced by best_path_candidate(), CreateBridge(), CreateEdge(), CreateExpansionArea(), and CreateSearchEdge().

static void RD_DrawLine ( routedata_t rd,
Coord  X1,
Coord  Y1,
Coord  X2,
Coord  Y2,
Coord  halfthick,
Cardinal  group,
routebox_t subnet,
bool  is_bad,
bool  is_45 
) [static]
static bool RD_DrawManhattanLine ( routedata_t rd,
const BoxType box1,
const BoxType box2,
CheapPointType  start,
CheapPointType  end,
Coord  halfthick,
Cardinal  group,
routebox_t subnet,
bool  is_bad,
bool  last_was_x 
) [static]

Definition at line 3437 of file autoroute.c.

References AutoRouteParameters, MIN, point_in_box(), point_in_closed_box(), RD_DrawLine(), cheap_point::X, and cheap_point::Y.

Referenced by TracePath().

Here is the call graph for this function:

static void RD_DrawThermal ( routedata_t rd,
Coord  X,
Coord  Y,
Cardinal  group,
Cardinal  layer,
routebox_t subnet,
bool  is_bad 
) [static]

Route-tracing code: once we've got a path of expansion boxes, trace a line through them to actually create the connection.

Definition at line 3238 of file autoroute.c.

References AutoRouteParameters, routebox::group, init_const_box(), InitLists(), routebox::is_bad, layer, routedata::layergrouptree, malloc(), MergeNets(), NET, r_insert_entry(), SUBNET, and THERMAL.

Referenced by TracePath().

Here is the call graph for this function:

static void RD_DrawVia ( routedata_t rd,
Coord  X,
Coord  Y,
Coord  radius,
routebox_t subnet,
bool  is_bad 
) [static]
static void RemoveFromNet ( routebox_t a,
enum boxlist  which 
) [static]

Definition at line 579 of file autoroute.c.

References __select_list(), routebox_list::next, and routebox_list::prev.

Referenced by AutoRoute(), and RouteAll().

Here is the call graph for this function:

static void ResetSubnet ( routebox_t net) [static]
static void ripout_livedraw_obj ( routebox_t rb) [static]
static int ripout_livedraw_obj_cb ( const BoxType b,
void *  cl 
) [static]

Definition at line 4697 of file autoroute.c.

References box, and ripout_livedraw_obj().

Referenced by AutoRoute().

Here is the call graph for this function:

static routebox_t* route_parent ( routebox_t rb) [static]

Return a "parent" of this edge which immediately precedes it in the route.

Definition at line 1587 of file autoroute.c.

References routebox::expansion_area, EXPANSION_AREA, routebox::flags, routebox::homeless, routebox::is_thermal, routebox::is_via, routebox::parent, and routebox::type.

Referenced by CreateBridge(), CreateExpansionArea(), and nonhomeless_parent().

struct routeall_status RouteAll ( routedata_t rd) [read]
static struct routeone_status RouteOne ( routedata_t rd,
routebox_t from,
routebox_t to,
int  max_edges 
) [static, read]

Definition at line 4070 of file autoroute.c.

References __edge_is_good(), add_or_destroy_edge(), add_via_sites(), ALL, AutoRouteParameters, routeone_state::best_cost, routeone_state::best_path, best_path_candidate(), routeone_status::best_route_cost, routeone_state::best_target, bloat_routebox(), routebox::box, box_center(), box_intersect(), box_is_good(), BreakManyEdges(), routebox::came_from, CENTER_X, CENTER_Y, clip_box(), closest_point_in_box(), routebox::conflicts_with, edge_struct::cost, routebox::cost_point, edge_struct::cost_point, CreateEdge(), CreateEdge2(), CreateEdgeWithConflicts(), CreateExpansionArea(), CreateViaEdge(), DestroyEdge(), RouteStyleType::Diameter, do_via_search(), routebox::e, EAST, edge_cost(), END_LOOP, Expand(), edge_struct::expand_dir, routebox::expansion_area, EXPANSION_AREA, EXPENSIVE, FindOneInBox(), FindThermable(), routebox::fixed, edge_struct::flags, routebox::flags, routeone_status::found_route, routeone_via_site_state::free_space_vec, routebox::group, heap_create(), heap_destroy(), heap_free(), heap_insert(), heap_is_empty(), heap_remove_smallest(), routeone_via_site_state::hi_conflict_space_vec, routebox::homeless, E_result::inflated, routebox::is_bad, edge_struct::is_interior, is_layer_group_active, routebox::is_thermal, routebox::is_via, edge_struct::is_via, KillEdge(), routedata::layergrouptree, LIST_LOOP, routeone_via_site_state::lo_conflict_space_vec, malloc(), MAX, MergeNets(), MIN, edge_struct::mincost_target, routedata::mtspace, routeone_status::net_completely_routed, NO_CONFLICT, routebox::nobloat, routebox::nonstraight, NORTH, E_result::orig, routebox::parent, pin, PLANE, r_create_tree(), r_delete_entry(), r_destroy_tree(), r_insert_entry(), edge_struct::rb, routebox::refcount, ro, routeone_status::route_had_conflicts, s, routebox::same_net, routebox::same_subnet, routebox::sbox, shrink_routebox(), routebox::source, source_conflicts(), SOUTH, routebox::style, SUBNET, routebox::target, touch_conflicts(), routebox::touched, TracePath(), routebox::type, vector_append(), vector_create(), vector_destroy(), vector_is_empty(), vector_remove_last(), edge_struct::via_conflict_level, edge_struct::via_search, WEST, routeone_state::workheap, cheap_point::X, BoxType::X1, BoxType::X2, cheap_point::Y, BoxType::Y1, and BoxType::Y2.

Referenced by AutoRoute(), and RouteAll().

Here is the call graph for this function:

static int share_edge ( const BoxType child,
const BoxType parent 
) [static]

Definition at line 2062 of file autoroute.c.

References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by CreateExpansionArea().

static BoxType shrink_routebox ( const routebox_t rb) [inline, static]
static void source_conflicts ( rtree_t tree,
routebox_t rb 
) [static]

Definition at line 4052 of file autoroute.c.

References __conflict_source(), AutoRouteParameters, r_search(), routebox::sbox, and touch_conflicts().

Referenced by RouteOne().

Here is the call graph for this function:

bool TargetPoint ( CheapPointType nextpoint,
const routebox_t target 
)

Get to actual pins/pad target coordinates.

Definition at line 1397 of file autoroute.c.

References abs, CENTER_X, CENTER_Y, routebox::pad, PAD, routebox::parent, routebox::pin, PIN, routebox::sbox, routebox::type, pin_st::X, cheap_point::X, pin_st::Y, and cheap_point::Y.

Referenced by TracePath().

static void touch_conflicts ( vector_t conflicts,
int  touch 
) [static]

Touch everything (except fixed) on each net found in the conflicts vector. If the vector is different from the last one touched, untouch the last batch and touch the new one. Always call with touch=1 (except for recursive call). Call with NULL, 1 to clear the last batch touched.

Touched items become invisible to current path so we don't encounter the same conflictor more than once.

Definition at line 1622 of file autoroute.c.

References END_LOOP, routebox::fixed, routebox::flags, LIST_LOOP, n, routebox::same_net, routebox::touched, vector_element(), and vector_size().

Referenced by __conflict_source(), RouteOne(), and source_conflicts().

Here is the call graph for this function:

static void TracePath ( routedata_t rd,
routebox_t path,
const routebox_t target,
routebox_t subnet,
bool  is_bad 
) [static]

This back-traces the expansion boxes along the best path it draws the lines that will make the actual path.

During refinement passes, it should try to maximize the area for other tracks so routing completion is easier.

During smoothing passes, it should try to make a better path, possibly using diagonals, etc. The path boxes are larger on average now so there is more possiblity to decide on a nice path. Any combination of lines and arcs is possible, so long as they don't poke more than half thick outside the path box.

Definition at line 3565 of file autoroute.c.

References AutoRouteParameters, routebox::box, box_in_box(), CENTER_X, CENTER_Y, routebox::circular, clip_box(), closest_point_in_box(), closest_point_in_routebox(), Draw(), EXPANSION_AREA, routebox::expansion_area, routebox::flags, hid_st::flush_debug_draw, routebox::group, gui, HALF_THICK, routebox::is_thermal, routebox::is_via, routebox::layer, MIN, routebox::parent, PCB, pcb_printf(), PIN, PLANE, point_in_box(), rb_source(), RD_DrawLine(), RD_DrawManhattanLine(), RD_DrawThermal(), RD_DrawVia(), routebox::sbox, shrink_box(), shrink_routebox(), routebox::source, routebox::style, TargetPoint(), TEST_FLAG, TRUE, routebox::type, cheap_point::X, BoxType::X1, BoxType::X2, cheap_point::Y, BoxType::Y1, and BoxType::Y2.

Referenced by RouteOne().

Here is the call graph for this function:


Variable Documentation

Definition at line 3942 of file autoroute.c.

Definition at line 439 of file autoroute.c.

Referenced by AddPad(), CreateRouteData(), and read_pads().

Definition at line 374 of file autoroute.c.

Definition at line 374 of file autoroute.c.

Cardinal front [static]

Definition at line 439 of file autoroute.c.

Referenced by AddPad(), CreateRouteData(), and read_pads().

Definition at line 382 of file autoroute.c.

bool is_odd

Definition at line 386 of file autoroute.c.

Definition at line 390 of file autoroute.c.

Referenced by InitAutoRouteParameters(), and RouteAll().

Definition at line 374 of file autoroute.c.

Definition at line 393 of file autoroute.c.

Definition at line 374 of file autoroute.c.

Definition at line 374 of file autoroute.c.

Referenced by InitAutoRouteParameters().

Definition at line 374 of file autoroute.c.

unsigned char pass

Definition at line 394 of file autoroute.c.

int passes = 12 [static]

Definition at line 445 of file autoroute.c.

Referenced by calculate_progress(), InitAutoRouteParameters(), and RouteAll().

bool rip_always

Definition at line 392 of file autoroute.c.

int ro = 0 [static]

Definition at line 443 of file autoroute.c.

Referenced by RouteAll(), and RouteOne().

int routing_layers = 0 [static]

Definition at line 446 of file autoroute.c.

Referenced by CreateRouteData(), and RouteAll().

int smoothes = 1 [static]

Definition at line 444 of file autoroute.c.

Referenced by calculate_progress(), and RouteAll().

int total_via_count = 0 [static]

Definition at line 448 of file autoroute.c.

Referenced by AutoRoute(), and IronDownAllUnfixedPaths().

float total_wire_length = 0 [static]

Definition at line 447 of file autoroute.c.

Referenced by AutoRoute(), and IronDownAllUnfixedPaths().

bool use_vias

Definition at line 384 of file autoroute.c.

bool usedGroup[MAX_GROUP] [static]

Definition at line 440 of file autoroute.c.

Referenced by cost_to_routebox(), CreateRouteData(), and RD_DrawLine().

Definition at line 374 of file autoroute.c.

Definition at line 388 of file autoroute.c.

Referenced by InitAutoRouteParameters().

int x_cost[MAX_GROUP] [static]

Definition at line 441 of file autoroute.c.

Referenced by cost_to_point_on_layer(), CreateRouteData(), and InitAutoRouteParameters().

int y_cost[MAX_GROUP]

Definition at line 441 of file autoroute.c.

Referenced by cost_to_point_on_layer(), CreateRouteData(), and InitAutoRouteParameters().