2007-10-13 06:18:44 +00:00
|
|
|
/****************************************************/
|
|
|
|
/* AUTOROUT.H */
|
|
|
|
/****************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifndef AUTOROUT_H
|
|
|
|
#define AUTOROUT_H
|
|
|
|
|
|
|
|
|
2007-10-13 06:18:44 +00:00
|
|
|
#define TOP 0
|
2007-06-05 12:10:51 +00:00
|
|
|
#define BOTTOM 1
|
2007-10-13 06:18:44 +00:00
|
|
|
#define EMPTY 0
|
2007-06-05 12:10:51 +00:00
|
|
|
#define ILLEGAL -1
|
|
|
|
|
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
/* Autorouter commands. */
|
2007-10-13 06:18:44 +00:00
|
|
|
enum CommandOpt {
|
|
|
|
PLACE_ALL,
|
|
|
|
PLACE_OUT_OF_BOARD,
|
|
|
|
PLACE_INCREMENTAL,
|
|
|
|
PLACE_1_MODULE,
|
|
|
|
|
|
|
|
ROUTE_ALL,
|
|
|
|
ROUTE_NET,
|
|
|
|
ROUTE_MODULE,
|
|
|
|
ROUTE_PAD
|
|
|
|
};
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
extern int E_scale; /* Scaling factor of distance tables. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-10-13 06:18:44 +00:00
|
|
|
#define ONE_SIDE 0
|
2007-06-05 12:10:51 +00:00
|
|
|
#define TWO_SIDES 1
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2011-03-09 14:30:39 +00:00
|
|
|
#define MAX_SIDES_COUNT 2
|
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
extern int Nb_Sides; /* Number of layers for autorouting (0 or 1) */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
#define FORCE_PADS 1 /* Force placement of pads for any Netcode */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/* board dimensions */
|
2009-04-05 20:49:15 +00:00
|
|
|
extern int Nrows;
|
|
|
|
extern int Ncols;
|
|
|
|
extern int Ntotal;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/* search statistics */
|
2009-04-05 20:49:15 +00:00
|
|
|
extern int OpenNodes; /* total number of nodes opened */
|
|
|
|
extern int ClosNodes; /* total number of nodes closed */
|
|
|
|
extern int MoveNodes; /* total number of nodes moved */
|
|
|
|
extern int MaxNodes; /* maximum number of nodes opened at one time */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-03-09 14:30:39 +00:00
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
/* Structures useful to the generation of board as bitmap. */
|
2011-03-09 14:30:39 +00:00
|
|
|
typedef char MATRIX_CELL;
|
|
|
|
typedef int DIST_CELL;
|
|
|
|
typedef char DIR_CELL;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-03-09 14:30:39 +00:00
|
|
|
class MATRIX_ROUTING_HEAD /* header of blocks of MATRIX_CELL */
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-03-09 14:30:39 +00:00
|
|
|
MATRIX_CELL* m_BoardSide[MAX_SIDES_COUNT]; /* ptr to block of memory: 2-sided board */
|
|
|
|
DIST_CELL* m_DistSide[MAX_SIDES_COUNT]; /* ptr to block of memory: path distance to
|
|
|
|
* cells */
|
|
|
|
DIR_CELL* m_DirSide[MAX_SIDES_COUNT]; /* header of blocks of chars:pointers back to
|
|
|
|
* source */
|
2007-10-13 06:18:44 +00:00
|
|
|
bool m_InitBoardDone;
|
|
|
|
int m_Layers;
|
2011-03-09 14:30:39 +00:00
|
|
|
int m_GridRouting; // Size of grid for autoplace/autoroute
|
2011-03-29 19:33:07 +00:00
|
|
|
EDA_RECT m_BrdBox; // Actual board bouding box
|
2007-10-13 06:18:44 +00:00
|
|
|
int m_Nrows, m_Ncols;
|
|
|
|
int m_MemSize;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2011-03-09 14:30:39 +00:00
|
|
|
MATRIX_ROUTING_HEAD();
|
|
|
|
~MATRIX_ROUTING_HEAD();
|
2011-03-09 20:09:11 +00:00
|
|
|
bool ComputeMatrixSize( BOARD* aPcb );
|
2007-10-13 06:18:44 +00:00
|
|
|
int InitBoard();
|
|
|
|
void UnInitBoard();
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2011-03-09 14:30:39 +00:00
|
|
|
extern MATRIX_ROUTING_HEAD Board; /* 2-sided board */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-11-12 15:43:38 +00:00
|
|
|
/* Constants used to trace the cells on the BOARD */
|
2007-10-13 06:18:44 +00:00
|
|
|
#define WRITE_CELL 0
|
|
|
|
#define WRITE_OR_CELL 1
|
2007-06-05 12:10:51 +00:00
|
|
|
#define WRITE_XOR_CELL 2
|
|
|
|
#define WRITE_AND_CELL 3
|
|
|
|
#define WRITE_ADD_CELL 4
|
|
|
|
|
|
|
|
|
|
|
|
#include "ar_protos.h"
|
|
|
|
|
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
#endif // AUTOROUT_H
|
|
|
|
|