|
|
1.1 root 1: .TH LDE 10.5 UCDS
2: .SH NAME
3: lde \- logic design expression language format
4: .SH DESCRIPTION
5: .I Lde
6: format contains six declaration areas that must appear
7: in the following order:
8: .TP
9: .B .x
10: an optional chip declaration area,
11: .TP
12: .B .tt
13: an optional line for use by
14: .I wcheck and/or
15: .IR smoke ,
16: .TP
17: .B .i
18: an input declaration area,
19: .TP
20: .B .o
21: an output declaration area,
22: .TP
23: .B .f
24: an optional field declaration area,
25: .TP
26: .B .e
27: and an expression area.
28: .PP
29: The
30: .I lde
31: language is much like C.
32: Identifiers may include
33: .BR +-. .
34: .I Lde
35: does not
36: use ';' to end a statement.
37: Symbols must be declared before used.
38: Declaration is by appearance in the
39: .B .i
40: or
41: .B .o
42: areas or appearance on the left of an
43: .B =
44: in the
45: .B .f
46: or
47: .B .e
48: areas.
49: Since
50: .I lde
51: is an expression language, no flow control (such as
52: .B if
53: or
54: .BR switch )
55: is allowed.
56: An expression selector is available;
57: .I
58: expra{[[exprb]:]exprc,[[exprd]:]expre,...}
59: has the value of
60: .I exprc
61: if
62: .I expra
63: equals
64: .IR exprb .
65: If there is no
66: .I exprb
67: and there is a colon then
68: .I exprc
69: is the default case.
70: If there is no
71: .I exprb
72: and no colon the the pre-incremented value of the prior
73: value of
74: .I exprb
75: is used, the prior value of
76: .I exprb
77: is initialized to \-1.
78: .PP
79: The chip declaration area may contain two strings,
80: .IR name and type .
81: .PP
82: The
83: .B .i
84: and
85: .B .o
86: areas contain
87: .I
88: identifier
89: [ '=' or ':'
90: .I
91: numeric_pinnumber
92: ]
93: (The ':' is used by
94: .I
95: lde \-w
96: as a mark for externals.)
97: Some programs use the order of appearance of the
98: identifiers.
99: .PP
100: The field declaration area contains constructions
101: of the form
102: .I n_id
103: =
104: .I o_id o_id ...
105: where
106: .I n_id
107: is a new identifier for a multibit value the least significant
108: bit of which is the first old identifier,
109: .I o_id.
110: .PP
111: The expression area contains assignments of expressions to
112: identifiers.
113: Identifiers may be modified by a postpended single quote, "'",
114: in which case a value of one has the meaning "don't_care" for the unmodified
115: indentifier.
116: .PP
117: Numeric values may be passed from the command line, they appear as
118: .BR $m .
119: The (zero based)
120: .RI m th
121: occurence of
122: .BI \- n
123: one the command line substitutes the value
124: .I n
125: for the symbol
126: .BR $m .
127: .SH EXAMPLES
128: .IP
129: .ftCW
130: .ps8
131: .vs10
132: .nf
133: /*
134: * bkrom
135: * classifies the location of the
136: * black king.
137: * 0-6 manhattan distance to center
138: * 7 orig square
139: * 8-11 k-side
140: * 12-15 q-side
141: */
142: .x
143: bkrom 74S287
144: .i
145: wkx0 wkx1 wkx2
146: wky0 wky1 wky2
147: GND1 GND2 GND3
148: .o
149: kb0 kb1 kb2 kb3
150: .f
151: kx = wkx0 wkx1 wkx2
152: ky = wky0 wky1 wky2
153: kb = kb0 kb1 kb2 kb3
154: .e
155: xd = (kx) { 3, 2, 1, 0, 0, 1, 2, 3 }
156: yd = (ky) { 3, 2, 1, 0, 0, 1, 2, 3 }
157: d = xd \+ yd
158: kb =
159: (ky == 6)?
160: (kx) { 12, 13, d, d, d, d, 8, 9 }:
161: (ky == 7)?
162: (kx) { 14, 15, d, d, 7, d, 10, 11 }:
163: d
164: /*
165: * By convention the output enable term for
166: * PAL's is 100 + the corresponding pin number.
167: * this example includes a .tt line for use by wcheck.
168: */
169: .x Bpal PAL16L8A
170: .tt iiiiiiiiign222222n2v
171: .i
172: A0 : 1 A1 : 2 A2 : 3 A3 : 4
173: A4 : 5 A5 : 6 A6 : 7 A7 : 8
174: A8 : 9
175: .o
176: SE+ : 12 RNE+ : 13 TD+ : 14 TU+ : 15
177: SFSE : 16 Y5 : 17 BRDY : 19
178:
179: e12 = 112 e13 = 113 e14 = 114 e15 = 115
180: e16 = 116 e17 = 117 e19 = 119
181:
182: .f
183: cnt = A0 A1 A2 A3 A4
184: ardy = A5
185: crdy = A6
186: flushb- = A8
187: flusha- = A7
188: .e
189: tmp = ((cnt == 0) ? ardy ? 1 : 0 :
190: (cnt == 6) ? (crdy || !flushb-) ? 1 : 0 : 1 )
191:
192: /* shift enable + for major data path, also count enable */
193: SE+ = !tmp
194:
195: /* random number clock enable - */
196: RNE+ = !(!flusha- ? 0 : tmp )
197:
198: /* transfer down - for ireg */
199: TD+ = !((cnt == 0) && ardy)
200:
201: /* transfer up + (invert outside) for oreg<0:3> */
202: TU+ = !((cnt == 6) && crdy && flushb-)
203:
204: /* shift flush status enable */
205: SFSE = !(cnt == 3)
206:
207: /* ack- back to ardy */
208: Y5 = !!((cnt == 0) && ardy)
209:
210: /* ready to A */
211: BRDY = !( (cnt == 0)? 1 : 0)
212:
213: e12 = 1 e13 = 1 e14 = 1 e15 = 1
214: e16 = 1 e17 = 1 e19 = 1
215: /*
216: * An example using parameter passing and Don't_care
217: */
218: .x dram PAL16R6
219: .tt iiiiiinnngin222222nv
220: .i
221: CK:1 OE-:11
222: dreq:2 stall:3 cerr:4 read:5 qword:6
223: rasefb=18 casxfb=17 casyfb=16 wefb=15
224: dsfb0=14 dsfb1=13
225: .o
226: rase:18 casx:17 casy:16 we:15
227: ds0:14
228: ds1:13
229: .f
230: DS = rase casx casy we ds1 ds0
231: DSfb = rasefb casxfb casyfb wefb dsfb1 dsfb0
232: .e
233: X.NCAS = 0100 /* don't care bits */
234:
235: DC = 0200 /* don't care state */
236: S.RAS = 040
237: S.CAS = 020
238: S.NCAS = 010
239: S.WE = 004
240:
241: /* low order 2 bits of state vector */
242: A = $0 B = $1 C = $2 D = $3
243:
244: I0 = C /* state assignement */
245: D10 = S.RAS + A
246: D11 = S.RAS + S.CAS + X.NCAS + B
247: D12 = S.RAS + S.CAS + X.NCAS + A
248: D13 = S.RAS + S.NCAS + B
249: D23 = S.RAS + B
250: D14 = S.RAS + S.NCAS + D
251: D24 = S.RAS + D
252: D15 = S.RAS + S.NCAS + C
253: D25 = B
254: D16 = A
255: D26 = D
256: D31 = S.RAS + S.CAS + X.NCAS + D
257: D32 = S.RAS + S.CAS + X.NCAS + S.WE + A
258: D33 = S.RAS + S.NCAS + S.WE + B
259: D43 = S.RAS + S.CAS + X.NCAS + S.WE + B
260: D34 = S.RAS + S.NCAS + S.WE + D
261: D44 = S.RAS + S.CAS + X.NCAS + S.WE + D
262: D35 = S.RAS + S.NCAS + S.WE + C
263: D36 = S.WE
264:
265: DS- = DSfb {
266: I0: dreq ? D10 : I0, /* idle state */
267: D10: read ? D11 : D31,
268: D31: stall ? D31 : D32,
269: D32: qword ? (stall ? D32 : D33) : D36,
270: D33: stall ? D43 : D34,
271: D43: stall ? D43 : D34,
272: D34: stall ? D44 : D35,
273: D44: stall ? D44 : D35,
274: D35: D36,
275: D36: I0,
276: D11: stall ? D11 : D12,
277: D12: qword ? D13 : D16,
278: D13: cerr ? D23 : D14,
279: D23: D14,
280: D14: cerr ? D24 : D15,
281: D24: D15,
282: D15: cerr ? D25 : D16,
283: D25: D16,
284: D16: cerr ? D26 : I0,
285: D26: dreq ? D10 : I0,
286: : DC
287: }
288:
289: DS = 077 ^ DS-
290: DS' = (DS- == DC ) ? ~0 :
291: ((DS- & X.NCAS) ? S.NCAS : 0)
292: .ft
293: .ps
294: .vs
295: .nf
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.