Added indexed selection to the PDK toolkit script (returns an index

from a selection, which can then be used to index into other lists.
This lets one selection be made on a list of arbitrary names, and
then additional parameters can be linked together with the same
index).  Also, implemented (finally!) the "offset" parameters of
the "slots" function (as advertised in the documentation).
This commit is contained in:
Tim Edwards 2019-11-20 13:01:14 -05:00
parent 3aa09725cb
commit adb4d2613d
2 changed files with 38 additions and 3 deletions

View File

@ -1790,7 +1790,7 @@ cifSlotsFillArea(op, cellDef, plane)
{
Tile *tile, *t, *tp;
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 xpitch, ypitch, xborder, yborder, xdiff, ydiff;
int i, j, k, savecount;
@ -2017,10 +2017,11 @@ cifSlotsFillArea(op, cellDef, plane)
/* For each contact cut area, check that there is */
/* no whitespace */
offset = 0;
for (i = 0; i < nUp; i++)
{
cut.r_xbot = llcut.r_xbot;
cut.r_xtop = llcut.r_xtop;
cut.r_xbot = llcut.r_xbot + offset;
cut.r_xtop = llcut.r_xtop + offset;
square.r_ybot = cut.r_ybot - yborder;
square.r_ytop = cut.r_ytop + yborder;
@ -2047,6 +2048,8 @@ cifSlotsFillArea(op, cellDef, plane)
}
cut.r_ybot += ypitch;
cut.r_ytop += ypitch;
offset += slots->sl_offset;
if (offset >= xpitch) offset -= xpitch;
}
if (savecount != CIFTileOps) break;

View File

@ -628,6 +628,38 @@ proc magic::add_selectlist {pname ptext all_values parameters} {
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 ---
#