Merge branch 'master' into magic-8.2

This commit is contained in:
Tim Edwards 2019-11-21 03:00:05 -05:00
commit 6fe5cee4be
4 changed files with 60 additions and 9 deletions

View File

@ -1790,7 +1790,7 @@ cifSlotsFillArea(op, cellDef, plane)
{ {
Tile *tile, *t, *tp; Tile *tile, *t, *tp;
Rect bbox, area, square, cut, llcut; Rect bbox, area, square, cut, llcut;
int nAcross, nUp, left, spitch, lpitch, ssize, lsize; int nAcross, nUp, left, spitch, lpitch, ssize, lsize, offset;
int diff, right; int diff, right;
int xpitch, ypitch, xborder, yborder, xdiff, ydiff; int xpitch, ypitch, xborder, yborder, xdiff, ydiff;
int i, j, k, savecount; int i, j, k, savecount;
@ -2011,16 +2011,17 @@ cifSlotsFillArea(op, cellDef, plane)
cifSlotFunc(&bbox, op, &nUp, &nAcross, &llcut, vertical); cifSlotFunc(&bbox, op, &nUp, &nAcross, &llcut, vertical);
cut.r_ybot = llcut.r_ybot; cut.r_ybot = llcut.r_ybot + slots->sl_start;
cut.r_ytop = llcut.r_ytop; cut.r_ytop = llcut.r_ytop + slots->sl_start;
/* For each contact cut area, check that there is */ /* For each contact cut area, check that there is */
/* no whitespace */ /* no whitespace */
offset = slots->sl_start;
for (i = 0; i < nUp; i++) for (i = 0; i < nUp; i++)
{ {
cut.r_xbot = llcut.r_xbot; cut.r_xbot = llcut.r_xbot + offset;
cut.r_xtop = llcut.r_xtop; cut.r_xtop = llcut.r_xtop + offset;
square.r_ybot = cut.r_ybot - yborder; square.r_ybot = cut.r_ybot - yborder;
square.r_ytop = cut.r_ytop + yborder; square.r_ytop = cut.r_ytop + yborder;
@ -2047,6 +2048,8 @@ cifSlotsFillArea(op, cellDef, plane)
} }
cut.r_ybot += ypitch; cut.r_ybot += ypitch;
cut.r_ytop += ypitch; cut.r_ytop += ypitch;
offset += slots->sl_offset;
if (offset >= xpitch) offset -= xpitch;
} }
if (savecount != CIFTileOps) break; if (savecount != CIFTileOps) break;

View File

@ -69,6 +69,7 @@ typedef struct slots_data
int sl_lsize; int sl_lsize;
int sl_lsep; int sl_lsep;
int sl_offset; int sl_offset;
int sl_start;
} SlotsData; } SlotsData;
typedef struct cifop typedef struct cifop

View File

@ -1327,6 +1327,7 @@ bloatCheck:
slots->sl_lsize = 0; slots->sl_lsize = 0;
slots->sl_lsep = 0; slots->sl_lsep = 0;
slots->sl_offset = 0; slots->sl_offset = 0;
slots->sl_start = 0;
} }
if (argc >= 5) if (argc >= 5)
{ {
@ -1361,7 +1362,7 @@ bloatCheck:
goto errorReturn; goto errorReturn;
} }
} }
if (argc == 8) if (argc >= 8)
{ {
i = atoi(argv[7]); i = atoi(argv[7]);
slots->sl_offset = i; slots->sl_offset = i;
@ -1371,7 +1372,17 @@ bloatCheck:
goto errorReturn; goto errorReturn;
} }
} }
if ((argc < 4) || (argc == 6) || (argc > 8)) if (argc == 9)
{
i = atoi(argv[8]);
slots->sl_start = i;
if (i < 0)
{
TechError("Slot start must be non-negative.\n");
goto errorReturn;
}
}
if ((argc < 4) || (argc == 6) || (argc > 9))
goto wrongNumArgs; goto wrongNumArgs;
break; break;
} }
@ -1685,7 +1696,7 @@ CIFTechFinal()
{ {
slots = (SlotsData *)op->co_client; slots = (SlotsData *)op->co_client;
for (j = 0; j < 7; j++) for (j = 0; j < 8; j++)
{ {
switch (j) { switch (j) {
case 0: bvalue = slots->sl_sborder; break; case 0: bvalue = slots->sl_sborder; break;
@ -1695,6 +1706,7 @@ CIFTechFinal()
case 4: bvalue = slots->sl_lsize; break; case 4: bvalue = slots->sl_lsize; break;
case 5: bvalue = slots->sl_lsep; break; case 5: bvalue = slots->sl_lsep; break;
case 6: bvalue = slots->sl_offset; break; case 6: bvalue = slots->sl_offset; break;
case 7: bvalue = slots->sl_start; break;
} }
if (bvalue != 0) if (bvalue != 0)
{ {
@ -2193,7 +2205,7 @@ CIFTechOutputScale(n, d)
else if (op->co_opcode == CIFOP_SLOTS) else if (op->co_opcode == CIFOP_SLOTS)
{ {
slots = (SlotsData *)op->co_client; slots = (SlotsData *)op->co_client;
for (j = 0; j < 7; j++) for (j = 0; j < 8; j++)
{ {
switch (j) { switch (j) {
case 0: bptr = &slots->sl_sborder; break; case 0: bptr = &slots->sl_sborder; break;
@ -2203,6 +2215,7 @@ CIFTechOutputScale(n, d)
case 4: bptr = &slots->sl_lsize; break; case 4: bptr = &slots->sl_lsize; break;
case 5: bptr = &slots->sl_lsep; break; case 5: bptr = &slots->sl_lsep; break;
case 6: bptr = &slots->sl_offset; break; case 6: bptr = &slots->sl_offset; break;
case 7: bptr = &slots->sl_start; break;
} }
if (*bptr != 0) if (*bptr != 0)
{ {
@ -2319,6 +2332,8 @@ CIFTechOutputScale(n, d)
slots->sl_lsep /= lexpand; slots->sl_lsep /= lexpand;
if (slots->sl_offset != 0) if (slots->sl_offset != 0)
slots->sl_offset /= lexpand; slots->sl_offset /= lexpand;
if (slots->sl_start != 0)
slots->sl_start /= lexpand;
break; break;
case CIFOP_SQUARES_G: case CIFOP_SQUARES_G:
squares = (SquaresData *)op->co_client; squares = (SquaresData *)op->co_client;

View File

@ -628,6 +628,38 @@ proc magic::add_selectlist {pname ptext all_values parameters} {
set magic::${pname}_val $value set magic::${pname}_val $value
} }
#----------------------------------------------------------
# Add a selectable-list parameter to the gencell window
# Unlike the routine above, it returns the index of the
# selection, not the selection itself. This is useful for
# keying the selection to other parameter value lists.
#----------------------------------------------------------
proc magic::add_selectindex {pname ptext all_values parameters} {
if [dict exists $parameters $pname] {
set value [dict get $parameters $pname]
} else {
set value 0
}
set numrows [lindex [grid size .params.edits] 1]
label .params.edits.${pname}_lab -text $ptext
menubutton .params.edits.${pname}_sel -menu .params.edits.${pname}_sel.menu \
-relief groove -text [lindex ${all_values} ${value}]
grid .params.edits.${pname}_lab -row $numrows -column 0 -sticky ens
grid .params.edits.${pname}_sel -row $numrows -column 1 -sticky wns
menu .params.edits.${pname}_sel.menu -tearoff 0
set idx 0
foreach item ${all_values} {
.params.edits.${pname}_sel.menu add radio -label $item \
-variable magic::${pname}_val -value $idx \
-command ".params.edits.${pname}_sel configure -text $item"
incr idx
}
set magic::${pname}_val $value
}
#------------------------------------------------------------- #-------------------------------------------------------------
# gencell_defaults --- # gencell_defaults ---
# #