Index: boxsym-rnd/generator.awk =================================================================== --- boxsym-rnd/generator.awk (revision 2800) +++ boxsym-rnd/generator.awk (revision 2801) @@ -2,13 +2,26 @@ refdes="U?" } -function count_pins(slot, loc, expand_slot, n,cnt, pin, cinc, TMP) +function count_pin_txtbrd(loc, pin, TXTBRD, pname,len) { + pname = pin + sub(".*::", "", pname) + len = length(pname) + if (PIN[pin, "dir"] != "") + len++; + len = int(len / 4 + 0.5) +# dbg("name=" pname " " len) + if (len > TXTBRD[loc]) + TXTBRD[loc] = len +} + +function count_pins(slot, loc, expand_slot, TXTBRD, n,cnt, pin, cinc, TMP) +{ cnt = 0 if (slot == "") { # all slots for(n = 0; n < nslots; n++) - cnt += count_pins(SLOTS[n], loc, expand_slot) + cnt += count_pins(SLOTS[n], loc, expand_slot, TXTBRD) return cnt; } @@ -20,6 +33,7 @@ else cinc = 1 cnt += cinc + count_pin_txtbrd(loc, pin, TXTBRD) } } return cnt @@ -111,16 +125,20 @@ dbg("align_calc: loc=" loc " boxloc=" boxloc " how=" how " res=" ALIGN[loc, target_field] " boxloc=" ALIGN["box",boxloc] " count=" ALIGN[loc,"count"] ) } -function align_pins(sn, ALIGN) +function align_pins(sn, ALIGN, TXTBRD) { - ALIGN["top","count"] = count_pins(sn, "top", ALIGN["cfg", "expand_slot"]) - ALIGN["bottom","count"] =count_pins(sn, "bottom", ALIGN["cfg", "expand_slot"]) - ALIGN["left","count"] = count_pins(sn, "left", ALIGN["cfg", "expand_slot"]) - ALIGN["right","count"] = count_pins(sn, "right", ALIGN["cfg", "expand_slot"]) + ALIGN["top","count"] = count_pins(sn, "top", ALIGN["cfg", "expand_slot"], TXTBRD) + ALIGN["bottom","count"] =count_pins(sn, "bottom", ALIGN["cfg", "expand_slot"], TXTBRD) + ALIGN["left","count"] = count_pins(sn, "left", ALIGN["cfg", "expand_slot"], TXTBRD) + ALIGN["right","count"] = count_pins(sn, "right", ALIGN["cfg", "expand_slot"], TXTBRD) ALIGN["box","width"] = max(max(ALIGN["top","count"], ALIGN["bottom","count"]), 1) ALIGN["box","height"] = max(max(ALIGN["left","count"], ALIGN["right","count"]), 1) +# dbg("TXTBRD: " ALIGN["box","width"] " " TXTBRD["left"] " " TXTBRD["right"]) + delta = TXTBRD["left"] + TXTBRD["right"] + ALIGN["box","width"] += delta + align_calc(ALIGN, "left", "height", "y0", SLOT[sn, "pinalign", "left"]) align_calc(ALIGN, "right", "height", "y0", SLOT[sn, "pinalign", "right"]) align_calc(ALIGN, "top", "width", "x0", SLOT[sn, "pinalign", "top"])