SymX bug.
This commit is contained in:
parent
e09776f58d
commit
a85275586d
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:19 $
|
||||
$Date: 2002/03/20 13:25:50 $
|
||||
$Log: findNPointsPath.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:50 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:19 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -83,7 +86,7 @@
|
|||
#include "ocrAstar.h"
|
||||
|
||||
static char *res_id =
|
||||
"$Id: findNPointsPath.c,v 1.1 2002/03/15 14:37:19 hcl Exp $";
|
||||
"$Id: findNPointsPath.c,v 1.2 2002/03/20 13:25:50 hcl Exp $";
|
||||
|
||||
#define MAX_HT 500
|
||||
|
||||
|
@ -513,6 +516,7 @@ makeExtEquipotentielle(ocrRoutingParameters * i_pParam,
|
|||
return;
|
||||
}
|
||||
// awfull hack... XXX
|
||||
return;
|
||||
if (i_pCon->VIR_CON_LIST) {
|
||||
//i_pCon->CON = i_pCon->VIR_CON_LIST;
|
||||
//i_pCon->VIR_CON_LIST->Z = 2;
|
||||
|
@ -754,6 +758,7 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
ocrSignal * i_pSignal, ocrWindow * i_pWindow)
|
||||
{
|
||||
ocrConnector *l_pCon;
|
||||
ocrConnector *con1, *con2;
|
||||
ocrConnector l_NewCon;
|
||||
ocrNaturalShort l_bOk;
|
||||
ocrNaturalInt l_uLength;
|
||||
|
@ -763,11 +768,34 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
|
||||
l_pCon = i_pSignal->CON_LIST;
|
||||
|
||||
do {
|
||||
con1 = l_pCon;
|
||||
l_pCon = l_pCon->NEXT;
|
||||
if (!l_pCon) {
|
||||
i_pSignal->NICHT_ZU_ROUTIEREN = 1;
|
||||
i_pSignal->ROUTED = 1;
|
||||
return 0;
|
||||
}
|
||||
} while ((con1->INTEXT == EXTERNAL) && (con1->VIR_CON_LIST == NULL));
|
||||
|
||||
do {
|
||||
con2 = l_pCon;
|
||||
if (!con2) {
|
||||
i_pSignal->NICHT_ZU_ROUTIEREN = 1;
|
||||
i_pSignal->ROUTED = 1;
|
||||
return 0;
|
||||
}
|
||||
l_pCon = l_pCon->NEXT;
|
||||
} while ((con2->INTEXT == EXTERNAL) && (con2->VIR_CON_LIST == NULL));
|
||||
|
||||
#if 0
|
||||
// Création des connecteurs externes
|
||||
if (i_pSignal->CON_LIST == NULL)
|
||||
return 0;
|
||||
|
||||
if (i_pSignal->CON_LIST->INTEXT == EXTERNAL)
|
||||
makeExtEquipotentielle(i_pParam, i_pGrid, i_pWindow, l_pCon);
|
||||
|
||||
|
||||
if (i_pSignal->CON_LIST->NEXT == NULL) {
|
||||
display(LEVEL, ERROR, "Sig %s has only one connector\n", i_pSignal->NAME);
|
||||
//return OCRNATURALINT_MAX;
|
||||
|
@ -776,6 +804,8 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
|
||||
if (i_pSignal->CON_LIST->NEXT->INTEXT == EXTERNAL)
|
||||
makeExtEquipotentielle(i_pParam, i_pGrid, i_pWindow, l_pCon->NEXT);
|
||||
#endif
|
||||
|
||||
do {
|
||||
#if 0
|
||||
if (i_pSignal->INDEX == 1) {
|
||||
|
@ -784,7 +814,7 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
#endif
|
||||
|
||||
// Choix des 2 premiers connecteurs
|
||||
l_bOk = chooseInternalConnector(i_pGrid, l_pCon, l_pCon->NEXT, 0);
|
||||
l_bOk = chooseInternalConnector(i_pGrid, con1, con2, 0);
|
||||
|
||||
if (l_bOk != OCR_OK) {
|
||||
display(LEVEL, DEBUG, "%s\n%s%ld\n",
|
||||
|
@ -792,6 +822,7 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
return OCRNATURALINT_MAX;
|
||||
}
|
||||
|
||||
#if 0
|
||||
display(LEVEL, DEBUG, "(%ld,%ld,%d) -> (%ld,%ld,%d)\n",
|
||||
l_pCon->CON->X * 5/* 1 * SCALE_X*/,
|
||||
l_pCon->CON->Y * 5/* 1 * SCALE_X*/,
|
||||
|
@ -799,20 +830,23 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
l_pCon->NEXT->CON->X * 5/* 1 * SCALE_X*/,
|
||||
l_pCon->NEXT->CON->Y * 5/* 1 * SCALE_X*/,
|
||||
l_pCon->NEXT->CON->Z);
|
||||
#endif
|
||||
|
||||
/* routage bipoint */
|
||||
l_uLength = biroute (i_pParam, i_pGrid, l_pCon, l_pCon->NEXT, i_pSignal, AS_K_SEG);
|
||||
l_uLength = biroute (i_pParam, i_pGrid, con1, con2, i_pSignal, AS_K_SEG);
|
||||
|
||||
// l_uLength = FINDPATH (i_pParam, i_pGrid,
|
||||
// l_pCon->CON->X,
|
||||
// l_pCon->CON->Y,
|
||||
// l_pCon->CON->Z,
|
||||
// l_pCon->NEXT->CON->X,
|
||||
// l_pCon->NEXT->CON->Y,
|
||||
// l_pCon->NEXT->CON->Z,
|
||||
// i_pSignal->INDEX, i_pSignal);
|
||||
// if ( ((l_pCon->CON->Z) > 0) || ((l_pCon->NEXT->CON->Z) > 0) )
|
||||
// printf ("routed Z1=%d, Z2=%d for %s\n", l_pCon->CON->Z, l_pCon->NEXT->CON->Z, i_pSignal->NAME);
|
||||
#if 0
|
||||
l_uLength = FINDPATH (i_pParam, i_pGrid,
|
||||
l_pCon->CON->X,
|
||||
l_pCon->CON->Y,
|
||||
l_pCon->CON->Z,
|
||||
l_pCon->NEXT->CON->X,
|
||||
l_pCon->NEXT->CON->Y,
|
||||
l_pCon->NEXT->CON->Z,
|
||||
i_pSignal->INDEX, i_pSignal);
|
||||
if ( ((l_pCon->CON->Z) > 0) || ((l_pCon->NEXT->CON->Z) > 0) )
|
||||
printf ("routed Z1=%d, Z2=%d for %s\n", l_pCon->CON->Z, l_pCon->NEXT->CON->Z, i_pSignal->NAME);
|
||||
#endif
|
||||
|
||||
}
|
||||
while (l_uLength == OCRNATURALINT_MAX);
|
||||
|
@ -820,25 +854,25 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
l_uLengthTotal += l_uLength;
|
||||
|
||||
// ajout de 2 VIAs
|
||||
if (l_pCon->INTEXT == INTERNAL) {
|
||||
if (l_pCon->CON->Z == 0) {
|
||||
l_pVia = createVirtualConnector(l_pCon->CON->X,
|
||||
l_pCon->CON->Y,
|
||||
l_pCon->CON->Z, 0, 0);
|
||||
if (con1->INTEXT == INTERNAL) {
|
||||
if (con1->CON->Z == 0) {
|
||||
l_pVia = createVirtualConnector(con1->CON->X,
|
||||
con1->CON->Y,
|
||||
con1->CON->Z, 0, 0);
|
||||
addVirtualConnector(&l_pViaList, l_pVia);
|
||||
}
|
||||
}
|
||||
|
||||
if (l_pCon->NEXT->INTEXT == INTERNAL) {
|
||||
if (l_pCon->NEXT->CON->Z == 0) {
|
||||
l_pVia = createVirtualConnector(l_pCon->NEXT->CON->X,
|
||||
l_pCon->NEXT->CON->Y,
|
||||
l_pCon->NEXT->CON->Z, 0, 0);
|
||||
if (con2->INTEXT == INTERNAL) {
|
||||
if (con2->CON->Z == 0) {
|
||||
l_pVia = createVirtualConnector(con2->CON->X,
|
||||
con2->CON->Y,
|
||||
con2->CON->Z, 0, 0);
|
||||
addVirtualConnector(&l_pViaList, l_pVia);
|
||||
}
|
||||
}
|
||||
|
||||
l_pCon = l_pCon->NEXT;
|
||||
l_pCon = con2;
|
||||
/*goto findNPointsPath_fin;*/ // XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
|
||||
|
||||
while (l_pCon->NEXT != NULL) {
|
||||
|
@ -854,11 +888,13 @@ findPathNPoints(ocrRoutingParameters * i_pParam,
|
|||
l_NewCon.CON = NULL;
|
||||
|
||||
do {
|
||||
#if 0
|
||||
// Création des connecteurs virtuels externes
|
||||
// si le connecteur est EXTERNE
|
||||
if (l_pCon->NEXT->INTEXT == EXTERNAL)
|
||||
makeExtEquipotentielle(i_pParam, i_pGrid, i_pWindow,
|
||||
l_pCon->NEXT);
|
||||
#endif
|
||||
|
||||
// Recherche d'un point de contact
|
||||
l_bOk = 0;
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:19 $
|
||||
$Date: 2002/03/20 13:25:50 $
|
||||
$Log: ocrAstar.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:50 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:19 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -110,7 +113,7 @@ ocrNaturalInt eval (ocrWSegment *segment_source, ocrWSegment *segment_dest) {
|
|||
)
|
||||
;
|
||||
|
||||
return (dx + dy) + dz * param->VIA_COST;
|
||||
return (dx + dy) + dz /* param->VIA_COST*/;
|
||||
}
|
||||
|
||||
/* Distance between segment and nearest segment of an equi */
|
||||
|
@ -155,10 +158,10 @@ ocrNaturalInt kost (ocrWSegment *segment_source, ocrWSegment *segment_dest) {
|
|||
;
|
||||
res += (
|
||||
(segment_dest->LAYER > segment_source->LAYER) ?
|
||||
1000 + segment_dest->LAYER - segment_source->LAYER :
|
||||
100 + segment_dest->LAYER - segment_source->LAYER :
|
||||
segment_source->LAYER - segment_dest->LAYER
|
||||
)
|
||||
* param->VIA_COST
|
||||
/* param->VIA_COST*/
|
||||
;
|
||||
|
||||
return res;
|
||||
|
@ -178,8 +181,8 @@ ocrNaturalInt kost (ocrWSegment *segment_source, ocrWSegment *segment_dest) {
|
|||
(zs - segment_source->LAYER) :
|
||||
(segment_source->LAYER - zs)
|
||||
)
|
||||
*
|
||||
param->VIA_COST
|
||||
/*
|
||||
param->VIA_COST*/
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -624,7 +627,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
ocrWSegment *seg, *nseg, *root, *aux;
|
||||
ocrNaturalInt xp, yp, xn, yn;
|
||||
ocrNaturalInt p1, p2, pp1, pp2;
|
||||
ocrNaturalInt pi;
|
||||
/*ocrNaturalInt pi;*/
|
||||
ocrNaturalInt distance = 0;
|
||||
ocrNaturalInt nb_segs = 0;
|
||||
|
||||
|
@ -674,7 +677,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
xn = getWSegXCoord (param, root, xp);
|
||||
yn = getWSegYCoord (param, root, yp);
|
||||
display (LEVEL, DEBUG, "p (%ld, %ld, %ld) -> (%ld, %ld, %ld) : d=%ld, c=%ld, h=%ld, hc=%ld\n", xp, yp, seg->LAYER, xn, yn, seg->LAYER, distance, seg->COST, seg->H, seg->HCOST);
|
||||
((getWSegDirection(param, seg) == ocrHorizontal) ? (pi = param->PITCH_H, p1 = xp, p2 = xn) : (pi = param->PITCH_V, p1 = yp, p2 = yn) );
|
||||
((getWSegDirection(param, seg) == ocrHorizontal) ? (p1 = xp, p2 = xn) : (p1 = yp, p2 = yn) );
|
||||
( (p1 < p2) ? (pp1 = p1, pp2 = p2) : (pp1 = p2, pp2 = p1) );
|
||||
nseg = splitWSegment (param, grid, seg,
|
||||
pp1, pp2,
|
||||
|
@ -682,7 +685,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
);
|
||||
nseg->NEXT = aux;
|
||||
aux = nseg;
|
||||
distance += pi * (pp2 - pp1);
|
||||
distance += (pp2 - pp1);
|
||||
nb_segs ++;
|
||||
xp = xn;
|
||||
yp = yn;
|
||||
|
@ -694,7 +697,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
xn = xs;
|
||||
yn = ys;
|
||||
/*root = seg->ROOT;*/
|
||||
((getWSegDirection(param, seg) == ocrHorizontal) ? (pi = param->PITCH_H, p1 = xp, p2 = xn) : (pi = param->PITCH_V, p1 = yp, p2 = yn) );
|
||||
((getWSegDirection(param, seg) == ocrHorizontal) ? (p1 = xp, p2 = xn) : (p1 = yp, p2 = yn) );
|
||||
( (p1 < p2) ? (pp1 = p1, pp2 = p2) : (pp1 = p2, pp2 = p1) );
|
||||
nseg = splitWSegment (param, grid, seg,
|
||||
pp1, pp2,
|
||||
|
@ -703,7 +706,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
nseg->NEXT = aux;
|
||||
i_pSignal->SEGMENT = nseg;
|
||||
|
||||
distance += pi * (pp2 - pp1);
|
||||
distance += (pp2 - pp1);
|
||||
nb_segs ++;
|
||||
display (LEVEL, DEBUG, "p (%ld, %ld, %ld) -> (%ld, %ld, %ld) : %ld\n", xp, yp, seg->LAYER, xn, yn, zs, distance);
|
||||
display (LEVEL, DEBUG, "c source (%ld, %ld, %ld)\n", xs, ys, zs);
|
||||
|
@ -715,7 +718,7 @@ ocrNaturalInt make_segments (ocrWSegment *segment_dest,
|
|||
|
||||
display (LEVEL, DEBUG, "i path length : %ld\n", distance);
|
||||
|
||||
return distance;
|
||||
return distance * 5;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:19 $
|
||||
$Date: 2002/03/20 13:25:50 $
|
||||
$Log: ocrGlobalRouting.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:50 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:19 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -255,10 +258,12 @@ void makeLocalSignals(ocrRoutingDataBase * i_pDataBase)
|
|||
makeSubSignal(i_pDataBase, l_pSignal, l_pCon->WIN);
|
||||
}
|
||||
|
||||
addConnector(i_pDataBase->FSIGNAL[l_pCon->WIN], l_pCon);
|
||||
//addConnector(i_pDataBase->FSIGNAL[l_pCon->WIN], l_pCon);
|
||||
l_pCon = l_pConNext;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// Ajout des connecteurs Faciaux
|
||||
for (l_pSegment = l_pSignal->SEGMENT;
|
||||
l_pSegment; l_pSegment = l_pSegment->NEXT) {
|
||||
|
@ -353,6 +358,7 @@ void makeLocalSignals(ocrRoutingDataBase * i_pDataBase)
|
|||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -417,8 +423,9 @@ ocrNaturalInt globalRouting(ocrRoutingDataBase * i_pDataBase)
|
|||
display(LEVEL, VERBOSE, "o Global routing ...\n");
|
||||
//return;
|
||||
|
||||
makeGlobalSignals(i_pDataBase);
|
||||
//makeGlobalSignals(i_pDataBase);
|
||||
#if 1
|
||||
#if 0
|
||||
initWeightedTree(i_pDataBase);
|
||||
//dumpDensityTable();
|
||||
|
||||
|
@ -431,6 +438,7 @@ ocrNaturalInt globalRouting(ocrRoutingDataBase * i_pDataBase)
|
|||
|
||||
//dumpDensityTable();
|
||||
freeWeightedTree();
|
||||
#endif
|
||||
#else
|
||||
routingGlobalSignals(i_pDataBase);
|
||||
// dumpDataBase (i_pDataBase, stdout);
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:20 $
|
||||
$Date: 2002/03/20 13:25:50 $
|
||||
$Log: ocrRouter.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:50 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:20 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -1156,9 +1159,12 @@ routingWindow(ocrRoutingDataBase * i_pDataBase, phfig_list * i_pPhFig)
|
|||
display(LEVEL, INFO, "o Failures = %ld\n", i_pDataBase->NB_UNROUTED);
|
||||
|
||||
{
|
||||
ocrNaturalInt chk;
|
||||
display (LEVEL, INFO, "o Unrouted signals :\n");
|
||||
chk = 0;
|
||||
for (i = 0; i < i_pDataBase->NB_SIGNAL - 1; i++)
|
||||
if (i_pDataBase->SIGNAL[i]->ROUTED != 1) {
|
||||
chk = 1;
|
||||
if (i_pDataBase->SIGNAL[i]->INTEXT == INTERNAL) {
|
||||
display(LEVEL, INFO,
|
||||
" %s\n",
|
||||
|
@ -1168,6 +1174,8 @@ routingWindow(ocrRoutingDataBase * i_pDataBase, phfig_list * i_pPhFig)
|
|||
" %s\n",
|
||||
i_pDataBase->SIGNAL[i]->NAME);
|
||||
}
|
||||
if (!chk)
|
||||
display (LEVEL, INFO, " none\n");
|
||||
}
|
||||
return wire_len;
|
||||
}
|
||||
|
@ -1415,7 +1423,7 @@ int main(int argc, char **argv)
|
|||
|
||||
// dumpDataBase (l_pDataBase,stdout);
|
||||
routingWindow(l_pDataBase, l_pPhFig);
|
||||
linkWindow(l_pDataBase, i);
|
||||
//linkWindow(l_pDataBase, i);
|
||||
|
||||
deleteWindowArray(l_pDataBase, i);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:23 $
|
||||
$Date: 2002/03/20 13:25:56 $
|
||||
$Log: ocrWRoutingUtil.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:56 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:23 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -217,9 +220,10 @@ void add_phseg_to_grid(ocrRoutingDataBase * i_pDataBase,
|
|||
|
||||
{
|
||||
|
||||
int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
|
||||
int layer, mode;
|
||||
int i;
|
||||
ocrNaturalInt x1 = 0, y1 = 0, x2 = 0, y2 = 0;
|
||||
double fx1, fx2, fy1, fy2;
|
||||
ocrNaturalInt layer, mode;
|
||||
ocrNaturalInt i;
|
||||
ocrWSegment *seg;
|
||||
|
||||
switch (i_pPhSeg->LAYER) {
|
||||
|
@ -361,18 +365,19 @@ void add_phseg_to_grid(ocrRoutingDataBase * i_pDataBase,
|
|||
#ifdef OCR_DEBUG
|
||||
printf("SYM_X\n");
|
||||
#endif
|
||||
x1 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
x1 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
y1 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhSeg->Y1;
|
||||
x2 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
x2 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
y2 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhSeg->Y2;
|
||||
break;
|
||||
case SYMXY:
|
||||
#ifdef OCR_DEBUG
|
||||
printf("SYMXY\n");
|
||||
printf ("XINS = %ld; XAB1 = %ld; XAB2 = %ld; X1 = %ld --> x1 = %ld\n", i_pPhIns->XINS, i_pPhModel->XAB1, i_pPhModel->XAB2, i_pPhSeg->X1, x1);
|
||||
#endif
|
||||
x1 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
x1 = i_pPhIns->XINS + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
y1 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhModel->YAB2 - i_pPhSeg->Y1;
|
||||
x2 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
x2 = i_pPhIns->XINS + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
y2 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhModel->YAB2 - i_pPhSeg->Y2;
|
||||
break;
|
||||
default:
|
||||
|
@ -386,24 +391,18 @@ void add_phseg_to_grid(ocrRoutingDataBase * i_pDataBase,
|
|||
#endif
|
||||
switch (i_pPhSeg->TYPE) {
|
||||
case LEFT:
|
||||
//y1 = y1 - (i_pPhSeg->WIDTH / 2);
|
||||
//y2 = y2 + (i_pPhSeg->WIDTH / 2);
|
||||
//tmp = x1;
|
||||
//x1 = x2 ; x2 = tmp;
|
||||
break;
|
||||
case RIGHT:
|
||||
//y1 = y1 - (i_pPhSeg->WIDTH / 2);
|
||||
//y2 = y1 + (i_pPhSeg->WIDTH / 2);
|
||||
fy1 = y1 - (i_pPhSeg->WIDTH / 2.0);
|
||||
fy2 = y2 + (i_pPhSeg->WIDTH / 2.0);
|
||||
fx1 = x1;
|
||||
fx2 = x2;
|
||||
break;
|
||||
case DOWN:
|
||||
x1 = x1 - (i_pPhSeg->WIDTH / 2);
|
||||
x2 = x2 + (i_pPhSeg->WIDTH / 2);
|
||||
break;
|
||||
case UP:
|
||||
//tmp = y1;
|
||||
//y1 = y2 ; y2 = tmp;
|
||||
x1 = x1 - (i_pPhSeg->WIDTH / 2);
|
||||
x2 = x2 + (i_pPhSeg->WIDTH / 2);
|
||||
fx1 = x1 - (i_pPhSeg->WIDTH / 2.0);
|
||||
fx2 = x2 + (i_pPhSeg->WIDTH / 2.0);
|
||||
fy1 = y1;
|
||||
fy2 = y2;
|
||||
break;
|
||||
default:
|
||||
exit(1);
|
||||
|
@ -415,13 +414,20 @@ void add_phseg_to_grid(ocrRoutingDataBase * i_pDataBase,
|
|||
printf("2/ x1=%d; y1=%d; x2=%d; y2=%d\n", x1, y1, x2, y2);
|
||||
#endif
|
||||
|
||||
x1 = x1 / (5 * SCALE_X);
|
||||
x2 = x2 / (5 * SCALE_X);
|
||||
y1 = y1 / (5 * SCALE_X);
|
||||
y2 = y2 / (5 * SCALE_X);
|
||||
fx1 = 0.5 + fx1 / (5.0 * SCALE_X);
|
||||
fx2 = 0.5 + fx2 / (5.0 * SCALE_X);
|
||||
fy1 = 0.5 + fy1 / (5.0 * SCALE_X);
|
||||
fy2 = 0.5 + fy2 / (5.0 * SCALE_X);
|
||||
|
||||
x1 = fx1;
|
||||
x2 = fx2;
|
||||
y1 = fy1;
|
||||
y2 = fy2;
|
||||
|
||||
|
||||
// controler par rapport a la fenetre
|
||||
#ifdef OCR_DEBUG
|
||||
printf("3/ X1=%ld; Y1=%ld; X2=%ld; Y2=%ld\n", x1, y1, x2, y2);
|
||||
printf("WIN x1=%d; y1=%d; x2=%d; y2=%d\n", i_pWindow->XMIN,
|
||||
i_pWindow->YMIN, i_pWindow->XMAX, i_pWindow->YMAX);
|
||||
#endif
|
||||
|
@ -458,8 +464,8 @@ void add_phseg_to_grid(ocrRoutingDataBase * i_pDataBase,
|
|||
&& (i_pDataBase->PARAM->EVEN_LAYERS_DIRECTION == ocrHorizontal))
|
||||
||
|
||||
((!(layer % 2)
|
||||
&& (i_pDataBase->PARAM->EVEN_LAYERS_DIRECTION ==
|
||||
ocrVertical))))) {
|
||||
&& (i_pDataBase->PARAM->EVEN_LAYERS_DIRECTION == ocrVertical)))))
|
||||
{
|
||||
// Layer Horizontal
|
||||
for (i = y1; i <= y2; i++) {
|
||||
#ifdef OCR_DEBUG
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:26 $
|
||||
$Date: 2002/03/20 13:25:57 $
|
||||
$Log: ocrConnectorUtil.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:57 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:26 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -678,18 +681,18 @@ ocrNaturalInt add_calu_cv(ocrConnector * i_pCon, phfig_list * i_pPhModel,
|
|||
#ifdef OCR_DEBUG
|
||||
printf("SYM_X\n");
|
||||
#endif
|
||||
x1 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
x1 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
y1 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhSeg->Y1;
|
||||
x2 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
x2 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
y2 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhSeg->Y2;
|
||||
break;
|
||||
case SYMXY:
|
||||
#ifdef OCR_DEBUG
|
||||
printf("SYMXY\n");
|
||||
#endif
|
||||
x1 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
x1 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X1;
|
||||
y1 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhModel->YAB2 - i_pPhSeg->Y1;
|
||||
x2 = (i_pPhIns->XINS - i_pPhModel->XAB1) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
x2 = (i_pPhIns->XINS) + i_pPhModel->XAB2 - i_pPhSeg->X2;
|
||||
y2 = (i_pPhIns->YINS - i_pPhModel->YAB1) + i_pPhModel->YAB2 - i_pPhSeg->Y2;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
### -------------------------------------------------- ###
|
||||
$Author: hcl $
|
||||
$Date: 2002/03/15 14:37:27 $
|
||||
$Date: 2002/03/20 13:25:57 $
|
||||
$Log: ocrWindow.c,v $
|
||||
Revision 1.2 2002/03/20 13:25:57 hcl
|
||||
SymX bug.
|
||||
|
||||
Revision 1.1 2002/03/15 14:37:27 hcl
|
||||
Ca roule.
|
||||
|
||||
|
@ -45,7 +48,7 @@
|
|||
#include "ocrConnectorUtil.h"
|
||||
|
||||
static char *res_id =
|
||||
"$Id: ocrWindow.c,v 1.1 2002/03/15 14:37:27 hcl Exp $";
|
||||
"$Id: ocrWindow.c,v 1.2 2002/03/20 13:25:57 hcl Exp $";
|
||||
|
||||
extern ocrOption *g_pOption;
|
||||
|
||||
|
@ -53,7 +56,6 @@ extern ocrOption *g_pOption;
|
|||
|
||||
#define MAX_HT 500
|
||||
#define PITCH 5
|
||||
#define SCALE_X 100
|
||||
|
||||
/**
|
||||
* création d'une nouvelle fenetre
|
||||
|
@ -95,10 +97,12 @@ ocrNaturalInt
|
|||
isVCInWindow(ocrVirtualConnector * i_pVirCon, ocrWindow * i_pWindow)
|
||||
{
|
||||
if ((i_pVirCon->X >= i_pWindow->XMIN) &&
|
||||
(i_pVirCon->X < i_pWindow->XMAX) &&
|
||||
(i_pVirCon->X <= i_pWindow->XMAX) &&
|
||||
(i_pVirCon->Y >= i_pWindow->YMIN)
|
||||
&& (i_pVirCon->Y < i_pWindow->YMAX))
|
||||
&& (i_pVirCon->Y <= i_pWindow->YMAX))
|
||||
return 1;
|
||||
display (LEVEL, INFO, "oulala : x:%ld?>%ld, y:%ld?>%ld, z:%ld\n", i_pVirCon->X, i_pWindow->XMAX, i_pVirCon->Y, i_pWindow->YMAX, i_pVirCon->Z);
|
||||
abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -566,6 +570,7 @@ void initWindow(ocrRoutingDataBase * i_pDataBase)
|
|||
(ocrWindow **) mbkalloc((i_pDataBase->NB_F + 1) *
|
||||
sizeof(ocrWindow *));
|
||||
|
||||
|
||||
// création des fenetres
|
||||
for (i = 0; i <= i_pDataBase->NB_F; i++)
|
||||
i_pDataBase->WINDOWS[i] = newWindow(i);
|
||||
|
@ -574,7 +579,7 @@ void initWindow(ocrRoutingDataBase * i_pDataBase)
|
|||
// l_uRange = nb de rangées
|
||||
// l_uFace = nb de fenetres par faces
|
||||
l_uFace = sqrt(i_pDataBase->NB_F);
|
||||
l_uRange = (i_pDataBase->YAB2 - i_pDataBase->YAB1) / 500 / 10;
|
||||
l_uRange = (i_pDataBase->YAB2 - i_pDataBase->YAB1) / (10 * SCALE_X * PITCH);
|
||||
display(LEVEL, VERBOSE, "o Layout has %ld rows\n", l_uRange);
|
||||
|
||||
for (y = 1; y <= l_uFace; y++) {
|
||||
|
@ -582,10 +587,10 @@ void initWindow(ocrRoutingDataBase * i_pDataBase)
|
|||
i = (y - 1) * l_uFace + x;
|
||||
i_pDataBase->WINDOWS[i]->XMIN =
|
||||
(x - 1) * (i_pDataBase->XAB2 -
|
||||
i_pDataBase->XAB1) / 500.0 / (l_uFace);
|
||||
i_pDataBase->XAB1) / 50.0 / (l_uFace);
|
||||
i_pDataBase->WINDOWS[i]->XMAX =
|
||||
x * (i_pDataBase->XAB2 -
|
||||
i_pDataBase->XAB1) / 500.0 / (l_uFace) - 0;
|
||||
i_pDataBase->XAB1) / 50.0 / (l_uFace) - 0;
|
||||
|
||||
i_pDataBase->WINDOWS[i]->YMIN =
|
||||
10 * (int) ((y - 1) *
|
||||
|
@ -595,6 +600,19 @@ void initWindow(ocrRoutingDataBase * i_pDataBase)
|
|||
0;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
i_pDataBase->WINDOWS[0] = newWindow(0);
|
||||
i_pDataBase->WINDOWS[1] = newWindow(1);
|
||||
i_pDataBase->WINDOWS[0]->XMIN = 0;
|
||||
i_pDataBase->WINDOWS[0]->YMIN = 0;
|
||||
i_pDataBase->WINDOWS[0]->XMAX = (i_pDataBase->XAB2 - i_pDataBase->XAB1) / (PITCH * SCALE_X);
|
||||
i_pDataBase->WINDOWS[0]->YMAX = (i_pDataBase->YAB2 - i_pDataBase->YAB1) / (PITCH * SCALE_X);
|
||||
i_pDataBase->WINDOWS[1]->XMIN = 0;
|
||||
i_pDataBase->WINDOWS[1]->YMIN = 0;
|
||||
i_pDataBase->WINDOWS[1]->XMAX = (i_pDataBase->XAB2 - i_pDataBase->XAB1) / (PITCH * SCALE_X);
|
||||
i_pDataBase->WINDOWS[1]->YMAX = (i_pDataBase->YAB2 - i_pDataBase->YAB1) / (PITCH * SCALE_X);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue