DIRECTORY AbSets, BiRelBasics, BiRels, FS, IntStuff, IO, LichenDataOps, LichenDataStructure, LichenIntBasics, Rope, SetBasics; LichenPads: CEDAR PROGRAM IMPORTS AbSets, BiRels, FS, IO, LichenDataOps, LichenDataStructure = BEGIN OPEN IS:IntStuff, LIB:LichenIntBasics, LIB, LichenDataStructure, LichenDataOps, Sets:AbSets; ReadSteppyNameSet: PROC [fileName: ROPE] RETURNS [found: BOOL, set: Set] ~ { in: IO.STREAM ~ FS.StreamOpen[fileName !FS.Error => GOTO DontExist]; found _ TRUE; set _ Sets.CreateHashSet[steppyNameSpace]; DO [] _ in.SkipWhitespace[]; IF in.EndOf[] THEN EXIT; {asRope: ROPE ~ in.GetRopeLiteral[]; steppy: SteppyName ~ ParseSteppyName[asRope]; [] _ set.AddElt[SnV[steppy]]; }ENDLOOP; in.Close[]; RETURN; EXITS DontExist => {found _ FALSE; set _ nilSet}}; ExtractNamed: PROC [ct: CellType, names: Set] RETURNS [newPorts: Set] ~ { wires: Set ~ ct.fullName[w].Image[names, rightToLeft].CreateHashCopy[]; IF wires.Size # names.Size THEN ERROR; newPorts _ FullySfwdlyExportWires[ct, wires]; RETURN}; ExtractPads: PROC [d: Design] RETURNS [exCells: BiRel, newPorts: Set] ~ { ct: CellType ~ d.root; padTypeNames: Set ~ Sets.RopesMatching[["pad*", FALSE, star]]; padTypes: Set ~ d.ctName.Image[padTypeNames, rightToLeft].CreateHashCopy[]; pads: Set ~ d.ciType.Image[padTypes, rightToLeft].Intersection[ct.Subcells].CreateHashCopy[]; ex: BiRel ~ d.ciType.Intersection[BiRels.CreateProduct[[pads, padTypes]]]; wires: Set ~ d.iwConns.Image[pads].CreateHashCopy[]; exCells _ ct.fullName[i].Invert.Compose[ex.Compose[d.ctName, [TRUE, FALSE]], [FALSE, TRUE]].CreateHashCopy[]; newPorts _ FullySfwdlyExportWires[ct, wires]; DeleteInsts[d, pads, TRUE]; RETURN}; END. VLichenPads.Mesa Last tweaked by Mike Spreitzer on July 1, 1988 10:21:40 am PDT Κη– "cedar" style˜code™Kšœ>™>—K˜KšΟk œœ œG˜~K˜šΟn œœ˜Kšœœœ$˜BK˜—K˜Kš œœœ œœ&žœ˜bK˜š žœœ œœ œ˜LKš œœœœœ œ ˜DKšœœ˜ K˜*š˜K˜Kšœ œœ˜Kšœ œ˜$Kšœ-˜-K˜Kšœœ˜ —K˜ Kšœ˜Kšœœ˜2—K˜šž œœœ˜IK˜GKšœœœ˜&Kšœ-˜-Kšœ˜—K˜šž œœ œ$˜IK˜Kšœ0œ ˜>KšœK˜KKšœ]˜]KšœJ˜JKšœ4˜4Kš œ>œœœœ˜mKšœ-˜-Kšœœ˜Kšœ˜—K˜Kšœ˜—…—ŒΙ