|
|
1.1 root 1: .ds CD \s-2CDL\s0
2: .TH CDM 10.1 UCDS
3: .SH NAME
4: cdm \- expand circuit macros
5: .SH SYNOPSIS
6: .B cdm
7: [
8: .I options
9: ] [
10: .I files
11: ]
12: .SH DESCRIPTION
13: .PP
14: .I Cdm
15: reads a circuit described in
16: \*(CD
17: from the specified files.
18: Macro calls are expanded and
19: pin numbers are substituted for pin names.
20: The expanded
21: \*(CD
22: is printed on the standard output.
23: The error output is used for diagnostics.
24: Note that names in \*(CD are restricted in length
25: so that care should be taken to keep macro names short.
26: The options available are:
27: .TP 7
28: .B -f
29: If any pin has a number and a name then
30: .I cdm
31: will use the number and not consult any library about the name.
32: .TP 7
33: .BI -l file
34: If
35: .I file
36: contains a
37: .BR / ,
38: it is read as a library.
39: Otherwise,
40: .BI /usr/ucds/lib/lib/ file
41: is read.
42: If no library is specified then a standard library
43: is read.
44: .TP 7
45: .B -p
46: List macro calls and definitions on the error output.
47: .TP 7
48: .B -t
49: Use the library (if any) to construct the
50: .B \&.t
51: lines (type to package translation)
52: and the
53: .B \&.tt
54: lines (see
55: .IR wcheck (10.1)).
56: With this option, the "chips" file
57: is no longer needed.
58: .TP 7
59: .B \-v
60: Print pin names as well as pin numbers in the
61: \*(CD
62: output.
63: .SS "Macro Definitions"
64: A macro definition
65: corresponds to a file
66: containing
67: \*(CD.
68: The name of the file for a definition
69: .I d
70: is
71: .IB d .w\fR\|.\fP
72: Such
73: \*(CD
74: files may be produced using
75: .IR draw (10.1).
76: Macros may have signal names as parameters.
77: These parameters are identified by a pin name.
78: The (set of) formal signal names associated with
79: the macro pin is replaced when the macro is called
80: with actual signal names, unless the
81: formal signal name is global.
82: In this latter case the actual and formal signal names
83: must be the same.
84: .SS "Macro calls"
85: A chip of type
86: .I d
87: is a macro call if the file
88: .IB d .w
89: exists.
90: If no such file exists,
91: the chip is assumed
92: to be primitive (as in, say,
93: .BR 74S181 ),
94: and if the type is surrounded by
95: .B <>
96: brackets, the
97: chip is an input output connector.
98: If
99: .IB d .w
100: exists
101: then it is the definition of the macro
102: .I d\|.
103: Signal parameters of the macro
104: are drawn in the same way
105: as signals are connected to a chip.
106: The pin name is the macro parameter name and
107: the signal is the actual signal parameter.
108: The name of the `chip' is the macro call name.
109: A given macro can be called more than once,
110: different instances being generated by different macro call names.
111: Macros may not be called recursively.
112: .SS Names
113: Signal, chip and pin names consist of
114: letters, digits and the characters
115: .BR +-/$ .
116: Names of individual signals in a bundle or of chips in a group
117: may also be generated:
118: .B name[ac-f]
119: generates
120: .BR "namea namec named namee namef" ;
121: .and
122: .B name<i:j>
123: generates
124: .BI name i
125: \&...
126: .BI name j
127: where
128: .I i
129: and
130: .I j
131: are represented in decimal as strings, all the same length.
132: Thus,
133: .B BUS01
134: (and not
135: .BR BUS1 )
136: is in the set BUS<0:15>.
137: .LP
138: The set of generated names can be separated by an amount
139: .B k
140: by writing
141: .B name<i:k:k>
142: and multiple indexing is allowed:
143: .BR name<i:j><p:q> .
144: Mixing the two generation methods is allowed.
145: .BR BEWARE ,
146: the generated names are sorted alphabetically.
147: .PP
148: Signal and chip names have scope local to
149: a macro definition unless the name contains a
150: .BR / .
151: A name containing a
152: .B /
153: is available throughout a circuit.
154: Connector names are also available throughout a circuit.
155: Signal and chip names used as formal parameters in
156: a macro definition are replaced during macro expansion
157: with the sequence of macro call names separated
158: by
159: .B /
160: and ending with the actual parameter signal name.
161: .SS "Name Matching"
162: The names of pins, signals and chips may also be generated
163: from patterns.
164: A pin pattern searches all pin names for the chip type.
165: Signal and chip patterns
166: search all signal or chip names.
167: Patterns have the following form.
168: .nf
169: \fL*\fR matches any sequence of characters
170: \fL[...]\fR matches any of the characters enclosed
171: \fL[x-y]\fR matches any character in the (ASCII) range \fLx\fR to \fLy\fR
172: \fL?\fR matches a single character
173: .fi
174: .SS "Signal Expansion"
175: A signal bundle may be connected
176: to one or more chips (or macro)
177: without having to write each chip or signal
178: explicitly.
179: In general each such array is expanded by generating
180: the specified set of names.
181: These names are then sorted alphabetically.
182: The first signal is connected to the first pin of the first chip.
183: Subsequent signals are connected to successive pins.
184: If no more pins exists then the first pin on the next chip is used.
185: The signal bundle must always end on the last pin of a chip
186: and there must be no signals unattached at the end.
187: .SH SEE ALSO
188: .IR cdmglob (10.1)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.