| 1 | |
| 2 | |
| 3 | <HTML> |
| 4 | <HEAD> |
| 5 | <STYLE type="text/css"> |
| 6 | H1 {color: black } |
| 7 | H2 {color: maroon } |
| 8 | H3 {color: #007090 } |
| 9 | A.head:link {color: #0060a0 } |
| 10 | A.head:visited {color: #3040c0 } |
| 11 | A.head:active {color: white } |
| 12 | A.head:hover {color: yellow } |
| 13 | A.red:link {color: red } |
| 14 | A.red:visited {color: maroon } |
| 15 | A.red:active {color: yellow } |
| 16 | </STYLE> |
| 17 | </HEAD> |
| 18 | <TITLE>Magic-7.3 Command Reference</TITLE> |
| 19 | <BODY BACKGROUND=graphics/blpaper.gif> |
| 20 | <H1> <IMG SRC=graphics/magic_title2.gif ALT="Magic VLSI Layout Tool Version 7.3"> |
| 21 | <IMG SRC=graphics/magic_OGL_sm.gif ALIGN="top" ALT="*"> </H1> |
| 22 | |
| 23 | <H2>element</H2> |
| 24 | <HR> |
| 25 | Handle generic drawing elements (line, box, text) in the layout. |
| 26 | <HR> |
| 27 | |
| 28 | <H3>Usage:</H3> |
| 29 | <BLOCKQUOTE> |
| 30 | <B>element</B> <I>option</I> <BR><BR> |
| 31 | <BLOCKQUOTE> |
| 32 | where <I>option</I> is one of the following: |
| 33 | <DL> |
| 34 | <DT> <B>add</B> <I>type</I> <I>name</I> <I>parameters</I> |
| 35 | <DD> Create a new element. The <I>name</I> is a unique name |
| 36 | to be assigned to the new element. The <I>parameters</I> |
| 37 | depend on the <I>type</I>, and are as follows: |
| 38 | <DL> |
| 39 | <DT> <B>line</B> <I>name style x1 y1 x2 y2</I> |
| 40 | <DD> Create a new line element, with position starting |
| 41 | at coordinate <I>x1 y1</I> and ending at <I>x2 y2</I>. |
| 42 | The line does not need to be on a Manhattan grid. |
| 43 | Initial coordinates must be on internal magic grid |
| 44 | points (that is, must be integer). However, half-grid |
| 45 | units can be generated with the <B>configure</B> |
| 46 | option (see below). |
| 47 | <DT> <B>rectangle</B> <I>name style llx lly urx ury</I> |
| 48 | <DD> Create a new box element, with lower left corner |
| 49 | at coordinate <I>llx lly</I> and upper right corner |
| 50 | at coordinate <I>urx ury</I>. |
| 51 | <DT> <B>text</B> <I>name style cx cy label_text</I> |
| 52 | <DD> Create a new text label at coordinate position |
| 53 | <I>cx cy</I> with text string "<I>label_text</I>". |
| 54 | </DL> |
| 55 | For an explanation of the <I>style</I> parameter, see |
| 56 | the <B>configure</B> option, below. |
| 57 | <DT> <B>delete</B> <I>name</I> |
| 58 | <DD> Delete an existing element by name. |
| 59 | <DT> <B>configure</B> <I>name</I> <I>config_option</I> |
| 60 | <DD> Configure or query an existing element named <I>name</I>. |
| 61 | <I>config_option</I> may be one of the following: |
| 62 | <DL> |
| 63 | <DT> <B>text</B> [<I>new_label_text</I>] |
| 64 | <DD> |
| 65 | <DT> <B>style</B> [<B>add</B>|<B>remove</B> [<I>style_type</I>]] |
| 66 | <DD> With no arguments, return the list of styles used |
| 67 | to draw the element. With option <B>add</B> or |
| 68 | <B>remove</B>, add or remove, respectively, a |
| 69 | style from the list of styles for |
| 70 | an element. Styles are the same as styles for |
| 71 | tile types in magic, and are defined in the |
| 72 | "dstyle" file in the <B>magic</B> install directory. |
| 73 | The "dstyle" file declares a "long name" for each |
| 74 | style type. This "long name" is what is expected |
| 75 | for parameter <I>style_type</I>. The most useful |
| 76 | values are the colors defined in the "dstyle" file, |
| 77 | such as <B>black</B>, <B>white</B>, <B>red</B>, |
| 78 | etc. <P> |
| 79 | |
| 80 | Like tile types, elements may be drawn in multiple |
| 81 | styles. So, styles are maintained as a list and |
| 82 | the <B>element configure style</B> option takes |
| 83 | the keyword <B>add</B> or <B>remove</B> to add |
| 84 | or remove specific styles from the list. |
| 85 | Removing the last remaining style for an element |
| 86 | is prohibited. Changing styles requires first |
| 87 | adding the new style type, then removing the |
| 88 | original. |
| 89 | <DT> <B>position</B> [<I>x y</I> [<I>x2 y2</I>]] |
| 90 | <DD> With no arguments, returns the position of the |
| 91 | element. For text elements, this is the label |
| 92 | position (a single coordinate). For lines, both |
| 93 | endpoint coordinates are returned, and for |
| 94 | rectangles, the lower-left and upper-right |
| 95 | coordinates are returned. With one or two coordinate |
| 96 | specified, the position of the element is changed. |
| 97 | For text, a single coordinate indicates the new |
| 98 | position of the text. For lines and rectangles, |
| 99 | the two coordinates completely describe the line |
| 100 | or box. |
| 101 | <DT> <B>flags</B> <I>flag_type</I> |
| 102 | <DD> Add or change flags of an element. The specific flag |
| 103 | indicated is set. Valid flags are as follows. |
| 104 | All elements have these flags: |
| 105 | <BLOCKQUOTE> |
| 106 | <DL> |
| 107 | <DT> <B>temporary</B> |
| 108 | <DD> Indicates an element that is not saved to the |
| 109 | database with a <B>save</B> or <B>writeall</B> |
| 110 | command (the default flag). |
| 111 | <DT> <B>persistant</B> |
| 112 | <DD> Indicates an element that is saved to the |
| 113 | database with a <B>save</B> or <B>writeall</B> |
| 114 | command, and can be recovered with a <B>load</B> |
| 115 | command. |
| 116 | </DL> |
| 117 | </BLOCKQUOTE> |
| 118 | Text elements have the following additional flags: |
| 119 | <BLOCKQUOTE> |
| 120 | <DL> |
| 121 | <DT> <B>small</B>, <B>medium</B>, <B>large</B>, |
| 122 | <B>xlarge</B> |
| 123 | <DD> One of four text sizes. |
| 124 | <DT> <A HREF=direction.html><I>direction</I></A> |
| 125 | <DD> Any valid <I>direction</I> specification in |
| 126 | <B>magic</B> will be translated to a text |
| 127 | justification; that is, the text will be |
| 128 | printed relative to its position in the |
| 129 | indicated direction. |
| 130 | </DL> |
| 131 | </BLOCKQUOTE> |
| 132 | Line elements have the following additional flags: |
| 133 | <BLOCKQUOTE> |
| 134 | <DL> |
| 135 | <DT> <B>halfx</B>, <B>halfy</B> |
| 136 | <DD> Adjust the position of the line endpoints |
| 137 | by one-half unit (postive, that is, right |
| 138 | or up). This allows lines to be drawn on, |
| 139 | for example, wire centerlines. There is |
| 140 | no allowance for having only one endpoint |
| 141 | on the half-integer grid. |
| 142 | <DT> <B>exactx</B>, <B>exacty</B> |
| 143 | <DD> Set line endpoints on the exact coordinates |
| 144 | of the line position (the default flag). |
| 145 | <DT> <B>arrowleft</B>, <B>arrowbottom</B> |
| 146 | <B>arrowtop</B>, <B>arrowright</B> |
| 147 | <DD> Add arrows to the line endpoints at the |
| 148 | indicated end. Note that four possible |
| 149 | positions are allowed, although only two |
| 150 | will be relevant for any given line. |
| 151 | Arrowheads are of fixed size and may not |
| 152 | be visible at large zoom factors. |
| 153 | <DT> <B>plainleft</B>, <B>plainbottom</B> |
| 154 | <B>plaintop</B>, <B>plaintright</B> |
| 155 | <DD> Draw plain lines, with no arrowheads |
| 156 | (the default flags). |
| 157 | </DL> |
| 158 | </BLOCKQUOTE> |
| 159 | Rectangle elements have no additional flags. |
| 160 | </DL> |
| 161 | <DT> <B>names</B> |
| 162 | <DD> Print names of all elements |
| 163 | <DT> <B>inbox</B> |
| 164 | <DD> Print name of element in (or nearest) the box |
| 165 | <DT> <B>help</B> |
| 166 | <DD> Print help information |
| 167 | </DL> |
| 168 | </BLOCKQUOTE> |
| 169 | </BLOCKQUOTE> |
| 170 | |
| 171 | <H3>Summary:</H3> |
| 172 | <BLOCKQUOTE> |
| 173 | The <B>element</B> command creates and manipulates |
| 174 | general-purpose "elements", which are lines, rectangles, |
| 175 | and text that have no inherent meaning to the database. |
| 176 | They are positioned in units of the layout and so scale |
| 177 | and move with zooms and pans. They are intended to be |
| 178 | used for layout annotation, measurement rulers, user-defined |
| 179 | feedback, flylines, wire paths, and so forth. |
| 180 | </BLOCKQUOTE> |
| 181 | |
| 182 | <H3>Implementation Notes:</H3> |
| 183 | <BLOCKQUOTE> |
| 184 | <B>element</B> is implemented as a built-in <B>magic</B> command. |
| 185 | The syntax is complicated and is expected to be driven by Tcl |
| 186 | scripts with simpler syntax for specific purposes such as |
| 187 | annotation or measurement rulers. |
| 188 | </BLOCKQUOTE> |
| 189 | |
| 190 | <P><IMG SRC=graphics/line1.gif><P> |
| 191 | <TABLE BORDER=0> |
| 192 | <TR> |
| 193 | <TD> <A HREF=commands.html>Return to command index</A> |
| 194 | </TR> |
| 195 | </TABLE> |
| 196 | <P><I>Last updated:</I> October 5, 2004 at 6:32am <P> |
| 197 | </BODY> |
| 198 | </HTML> |