BEGIN
c1, c2, d1, d2: Route.Pin;
c1cd, c2cd, d1cd, d2cd: CD.Instance;
result: Route.RoutingResult;
design: CD.Design;
object: CD.Object;
technology: CD.Technology ← CD.FetchTechnology[$cmos];
metal: Route.Layer ← CD.FetchLayer[technology, $met];
metal2: Route.Layer ← CD.FetchLayer[technology, $met2];
rules: Route.DesignRules ← Route.CreateDesignRules[$cmos, metal, metal2, vertical];
routingArea: Route.RoutingArea ← Route.CreateRoutingArea["RouteTestD", rules];
Route.IncludeRoutingAreaSide[routingArea, left, [26, 0]];
Route.IncludeRoutingAreaSide[routingArea, right, [0, 0]];
c1cd ← RouteUtil.CreateCDPin["c1", [26, 90, 22, 110], metal];
c1 ← Route.CreatePin[c1cd, left];
c2cd ← RouteUtil.CreateCDPin["c2", [0, 134, 4, 138], metal];
c2 ← Route.CreatePin[c2cd, right];
Route.IncludeNet[routingArea, "c", LIST[c1, c2]];
d1cd ← RouteUtil.CreateCDPin["d1", [26, 134, 22, 138], metal];
d1 ← Route.CreatePin[d1cd, left];
d2cd ← RouteUtil.CreateCDPin["d2", [0, 100, 4, 104], metal];
d2 ← Route.CreatePin[d2cd, right];
Route.IncludeNet[routingArea, "d", LIST[d1, d2]];
result ← Route.ChannelRoute[routingArea, [[0, 0], [40, 0], [0, 200], [0, 0]], [0, 0, 40, 150], full];
design ← CDOps.CreateDesign[technology];
object ← Route.RetrieveRouting[result, result.routingArea.name, NIL, NIL].object;
[ ] ← CDCells.IncludeOb[design: design,
cell: NIL, ob: object, position: [0, 0], orientation: 0,
cellCSystem: interrestCoords, obCSystem: interrestCoords, mode: dontPropagate];
IF
CDIO.WriteDesign[design, result.routingArea.name]
THEN
BEGIN
newCellName: Rope.ROPE ← CDDirectory.Name[object];
IF ~Rope.Equal[result.routingArea.name, newCellName]
THEN
TerminalIO.WriteRope[Rope.Cat["cell name changed to: ", newCellName, "\n"]];
END
ELSE
TerminalIO.WriteRope["Error: design not written\n"];
END.