WIGenerator.mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Gasbarro August 22, 1986 5:30:26 pm PDT
DIRECTORY
CD, CDCells, CDCommandOps, CDSequencer, TerminalIO, WireIcons;
WIGenerator: CEDAR PROGRAM
IMPORTS CDCells, CDCommandOps, TerminalIO, WireIcons
= BEGIN
ExtractorGenerator: PROC [comm: CDSequencer.Command] = {
index, increment, count, size: INT;
deltaX: INT ← comm.pos.x-comm.sPos.x;
deltaY: INT ← comm.pos.y-comm.sPos.y;
index ← TerminalIO.RequestInt["Starting index of the extracted wire? "];
increment ← TerminalIO.RequestInt["Index increment? "];
count ← TerminalIO.RequestInt["Number of repititions? "];
size ← TerminalIO.RequestInt["Size of the structured wire? "];
FOR i: INT IN [0..count) DO
[] ← CDCells.IncludeOb[
design: comm.design,
ob: WireIcons.MakeExtractor[comm.design, index+i*increment, size].obj,
trans: [off: [comm.sPos.x+i*deltaX, comm.sPos.y+i*deltaY]]
];
ENDLOOP;
};
RangeExtractorGenerator: PROC [comm: CDSequencer.Command] = {
index, increment, count, subSize, size: INT;
deltaX: INT ← comm.pos.x-comm.sPos.x;
deltaY: INT ← comm.pos.y-comm.sPos.y;
index ← TerminalIO.RequestInt["Starting index of the extracted wire? "];
increment ← TerminalIO.RequestInt["Index increment? "];
subSize ← TerminalIO.RequestInt["Size of the extracted wire? "];
count ← TerminalIO.RequestInt["Number of repititions? "];
size ← TerminalIO.RequestInt["Size of the structured wire? "];
FOR i: INT IN [0..count) DO
[] ← CDCells.IncludeOb[
design: comm.design,
ob: WireIcons.MakeRangeExtractor[comm.design, index+i*increment, subSize, size].obj,
trans: [off: [comm.sPos.x+i*deltaX, comm.sPos.y+i*deltaY]]
];
ENDLOOP;
};
CDCommandOps.RegisterWithMenu[
menu: $ProgramMenu,
entry: "Range Extractor Generator",
doc: "",
proc: RangeExtractorGenerator
];
CDCommandOps.RegisterWithMenu[
menu: $ProgramMenu,
entry: "Extractor Generator",
doc: "",
proc: ExtractorGenerator
];
END.