source: vis_dev/vis-2.1/examples/arbiter/arbiter.mv @ 16

Last change on this file since 16 was 11, checked in by cecile, 13 years ago

Add vis

File size: 10.6 KB
Line 
1# vl2mv arbiter.v
2# version: 0.2
3# date:    15:54:08 11/04/96 (PST)
4.model main
5# I/O ports
6.outputs ackA
7.outputs ackB
8.outputs ackC
9
10.mv sel 4 A B C X
11# assign active  = pass_tokenA  || pass_tokenB  || pass_tokenC
12# pass_tokenA  || pass_tokenB
13.names pass_tokenA pass_tokenB _n1
14.def 1
150 0 0
16# pass_tokenA  || pass_tokenB  || pass_tokenC
17.names _n1 pass_tokenC _n2
18.def 1
190 0 0
20.names _n2 active$raw_n0
21- =_n2
22.mv _n3 4 A B C X
23.names _n3
24A
25.subckt controller controllerA req=reqA  ack=ackA  sel=sel  pass_token=pass_tokenA  id=_n3
26.mv _n4 4 A B C X
27.names _n4
28B
29.subckt controller controllerB req=reqB  ack=ackB  sel=sel  pass_token=pass_tokenB  id=_n4
30.mv _n5 4 A B C X
31.names _n5
32C
33.subckt controller controllerC req=reqC  ack=ackC  sel=sel  pass_token=pass_tokenC  id=_n5
34.subckt arbiter arbiter sel=sel  active=active 
35.subckt client clientA req=reqA  ack=ackA 
36.subckt client clientB req=reqB  ack=ackB 
37.subckt client clientC req=reqC  ack=ackC 
38# conflict arbitrators
39.names active$raw_n0  active
400 0
411 1
42# non-blocking assignments
43# latches
44# quasi-continuous assignment
45.end
46
47
48.model controller
49# I/O ports
50.inputs sel
51.inputs req
52.outputs pass_token
53.outputs ack
54.inputs id
55
56.mv sel 4 A B C X
57.mv state 3 IDLE READY BUSY
58.mv id 4 A B C X
59# state  = 0
60.mv state$raw_n6 3 IDLE READY BUSY
61.names state$raw_n6
62IDLE
63# non-blocking assignments for initial
64# ack  = 0
65.names ack$raw_n7
660
67# non-blocking assignments for initial
68# pass_token  = 1
69.names pass_token$raw_n8
701
71# non-blocking assignments for initial
72# assign is_selected  = (sel  == id )
73# sel  == id
74.names sel id _na
75.def 0
76- =sel 1
77.names _na is_selected$raw_n9
78- =_na
79.mv _nd 3 IDLE READY BUSY
80.names _nd
81IDLE
82.names state _nd _nc
83.def 0
84- =state 1
85.names _nc  _nb
861 1
870 0
88.names is_selected _ne
89- =is_selected
90.names req _nf
91- =req
92# state  = 1
93.mv state$req_n10$true 3 IDLE READY BUSY
94.names state$req_n10$true
95READY
96# pass_token  = 0
97.names pass_token$req_n11$true
980
99# pass_token  = 1
100.names pass_token$req_n12$false
1011
102# if/else (req )
103.names pass_token$req_n11$true pass_token$req_n12$false req pass_token$req$raw_n15
1040 - 1 0
1051 - 1 1
106- 0 0 0
107- 1 0 1
108.mv state$req$raw_n19 3 IDLE READY BUSY
109.names state$req_n10$true state req state$req$raw_n19
110- - 0 =state
111- - 1 =state$req_n10$true
112# pass_token  = 0
113.names pass_token$is_selected_n1b$false
1140
115# if/else (is_selected )
116.names pass_token$req$raw_n15 pass_token$is_selected_n1b$false is_selected pass_token$is_selected$raw_n1f
1170 - 1 0
1181 - 1 1
119- 0 0 0
120- 1 0 1
121.mv state$is_selected$raw_n21 3 IDLE READY BUSY
122.names state$req$raw_n19 state is_selected state$is_selected$raw_n21
123- - 0 =state
124- - 1 =state$req$raw_n19
125.mv _n26 3 IDLE READY BUSY
126.names _n26
127READY
128.names state _n26 _n25
129.def 0
130- =state 1
131.names _n25  _n24
1321 1
1330 0
134# state  = 2
135.mv state$_n24_n27$true 3 IDLE READY BUSY
136.names state$_n24_n27$true
137BUSY
138# ack  = 1
139.names ack$_n24_n28$true
1401
141.mv _n2b 3 IDLE READY BUSY
142.names _n2b
143BUSY
144.names state _n2b _n2a
145.def 0
146- =state 1
147.names _n2a  _n29
1481 1
1490 0
150.names req _n2c
1510 1 
1521 0 
153.names _n2c _n2d
154- =_n2c
155# state  = 0
156.mv state$_n2c_n2e$true 3 IDLE READY BUSY
157.names state$_n2c_n2e$true
158IDLE
159# ack  = 0
160.names ack$_n2c_n2f$true
1610
162# pass_token  = 1
163.names pass_token$_n2c_n30$true
1641
165# if/else (!req )
166.names pass_token$_n2c_n30$true pass_token _n2c pass_token$_n2c$raw_n37
1670 - 1 0
1681 - 1 1
169- 0 0 0
170- 1 0 1
171.mv state$_n2c$raw_n39 3 IDLE READY BUSY
172.names state$_n2c_n2e$true state _n2c state$_n2c$raw_n39
173- - 0 =state
174- - 1 =state$_n2c_n2e$true
175.names ack$_n2c_n2f$true ack _n2c ack$_n2c$raw_n3a
1760 - 1 0
1771 - 1 1
178- 0 0 0
179- 1 0 1
180# case (state )
181.mv state$_n29$raw_n42 3 IDLE READY BUSY
182.names state$_n2c$raw_n39 state _n29 state$_n29$raw_n42
183- - 0 =state
184- - 1 =state$_n2c$raw_n39
185.names pass_token$_n2c$raw_n37 pass_token _n29 pass_token$_n29$raw_n43
1860 - 1 0
1871 - 1 1
188- 0 0 0
189- 1 0 1
190.names ack$_n2c$raw_n3a ack _n29 ack$_n29$raw_n45
1910 - 1 0
1921 - 1 1
193- 0 0 0
194- 1 0 1
195.mv state$_n24$raw_n47 3 IDLE READY BUSY
196.names state$_n24_n27$true state$_n29$raw_n42 _n24 state$_n24$raw_n47
197- - 0 =state$_n29$raw_n42
198- - 1 =state$_n24_n27$true
199.names ack$_n24_n28$true ack$_n29$raw_n45 _n24 ack$_n24$raw_n48
2000 - 1 0
2011 - 1 1
202- 0 0 0
203- 1 0 1
204.names pass_token pass_token$_n29$raw_n43 _n24 pass_token$_n24$raw_n4f
2050 - 1 0
2061 - 1 1
207- 0 0 0
208- 1 0 1
209.mv state$_nb$raw_n52 3 IDLE READY BUSY
210.names state$is_selected$raw_n21 state$_n24$raw_n47 _nb state$_nb$raw_n52
211- - 0 =state$_n24$raw_n47
212- - 1 =state$is_selected$raw_n21
213.names pass_token$is_selected$raw_n1f pass_token$_n24$raw_n4f _nb pass_token$_nb$raw_n53
2140 - 1 0
2151 - 1 1
216- 0 0 0
217- 1 0 1
218.names ack ack$_n24$raw_n48 _nb ack$_nb$raw_n5b
2190 - 1 0
2201 - 1 1
221- 0 0 0
222- 1 0 1
223# conflict arbitrators
224.names is_selected$raw_n9  is_selected
2250 0
2261 1
227.names _nb _ne _nf _n24 _n29 _n2d _n5d
228.def 0
229 1 1 1 - - - 1
230 0 - - 1 - - 1
231 0 - - 0 1 1 1
232.mv _n5e 3 IDLE READY BUSY
233.names _n5d state$_nb$raw_n52 state _n5e
2341 - - =state$_nb$raw_n52
2350 - - =state
236.names _nb _ne _nf _n24 _n29 _n2d _n62
237.def 0
238 1 1 1 - - - 1
239 1 1 0 - - - 1
240 1 0 - - - - 1
241 0 - - 0 1 1 1
242.names _n62 pass_token$_nb$raw_n53 pass_token _n63
2431 0 - 0
2441 1 - 1
2450 - 0 0
2460 - 1 1
247.names _nb _n24 _n29 _n2d _n64
248.def 0
249 0 1 - - 1
250 0 0 1 1 1
251.names _n64 ack$_nb$raw_n5b ack _n65
2521 0 - 0
2531 1 - 1
2540 - 0 0
2550 - 1 1
256# non-blocking assignments
257# latches
258.r pass_token$raw_n8 pass_token
2590 0
2601 1
261.latch _n63 pass_token
262.r state$raw_n6 state
263- =state$raw_n6
264.latch _n5e state
265.r ack$raw_n7 ack
2660 0
2671 1
268.latch _n65 ack
269# quasi-continuous assignment
270.end
271
272
273.model arbiter
274# I/O ports
275.outputs sel
276.inputs active
277
278.mv sel 4 A B C X
279.mv state 4 A B C X
280# state  = 0
281.mv state$raw_n66 4 A B C X
282.names state$raw_n66
283A
284# non-blocking assignments for initial
285# assign sel  = active  ? state  : 3
286.mv sel$raw_n67 4 A B C X
287.mv _n68 4 A B C X
288.names _n68
289X
290# active  ? state  : 3
291.mv _n69 4 A B C X
292.names state _n68 active _n69
293- - 0 =_n68
294- - 1 =state
295.names _n69 sel$raw_n67
296- =_n69
297.names active _n6a
298- =active
299.mv _n6d 4 A B C X
300.names _n6d
301A
302.names state _n6d _n6c
303.def 0
304- =state 1
305.names _n6c  _n6b
3061 1
3070 0
308# state  = 1
309.mv state$_n6b_n6e$true 4 A B C X
310.names state$_n6b_n6e$true
311B
312.mv _n71 4 A B C X
313.names _n71
314B
315.names state _n71 _n70
316.def 0
317- =state 1
318.names _n70  _n6f
3191 1
3200 0
321# state  = 2
322.mv state$_n6f_n72$true 4 A B C X
323.names state$_n6f_n72$true
324C
325.mv _n75 4 A B C X
326.names _n75
327C
328.names state _n75 _n74
329.def 0
330- =state 1
331.names _n74  _n73
3321 1
3330 0
334# state  = 0
335.mv state$_n73_n76$true 4 A B C X
336.names state$_n73_n76$true
337A
338# case (state )
339.mv state$_n73$raw_n79 4 A B C X
340.names state$_n73_n76$true state _n73 state$_n73$raw_n79
341- - 0 =state
342- - 1 =state$_n73_n76$true
343.mv state$_n6f$raw_n7a 4 A B C X
344.names state$_n6f_n72$true state$_n73$raw_n79 _n6f state$_n6f$raw_n7a
345- - 0 =state$_n73$raw_n79
346- - 1 =state$_n6f_n72$true
347.mv state$_n6b$raw_n7e 4 A B C X
348.names state$_n6b_n6e$true state$_n6f$raw_n7a _n6b state$_n6b$raw_n7e
349- - 0 =state$_n6f$raw_n7a
350- - 1 =state$_n6b_n6e$true
351# if/else (active )
352.mv state$active$raw_n84 4 A B C X
353.names state$_n6b$raw_n7e state active state$active$raw_n84
354- - 0 =state
355- - 1 =state$_n6b$raw_n7e
356# conflict arbitrators
357.names sel$raw_n67  sel
358- =sel$raw_n67
359.names _n6a _n6b _n6f _n73 _n85
360.def 0
361 1 1 - - 1
362 1 0 1 - 1
363 1 0 0 1 1
364.mv _n86 4 A B C X
365.names _n85 state$active$raw_n84 state _n86
3661 - - =state$active$raw_n84
3670 - - =state
368# non-blocking assignments
369# latches
370.r state$raw_n66 state
371- =state$raw_n66
372.latch _n86 state
373# quasi-continuous assignment
374.end
375
376
377.model client
378# I/O ports
379.outputs req
380.inputs ack
381
382.mv state 3 NO_REQ REQ HAVE_TOKEN
383# req  = 0
384.names req$raw_n89
3850
386# non-blocking assignments for initial
387# state  = 0
388.mv state$raw_n8a 3 NO_REQ REQ HAVE_TOKEN
389.names state$raw_n8a
390NO_REQ
391# non-blocking assignments for initial
392# assign rand_choice  = $NDset ( 0,1 )
393.names rand_choice
3940
3951
396.mv _n8f 3 NO_REQ REQ HAVE_TOKEN
397.names _n8f
398NO_REQ
399.names state _n8f _n8e
400.def 0
401- =state 1
402.names _n8e  _n8d
4031 1
4040 0
405.names rand_choice _n90
406- =rand_choice
407# req  = 1
408.names req$rand_choice_n91$true
4091
410# state  = 1
411.mv state$rand_choice_n92$true 3 NO_REQ REQ HAVE_TOKEN
412.names state$rand_choice_n92$true
413REQ
414# if/else (rand_choice )
415.names req$rand_choice_n91$true req rand_choice req$rand_choice$raw_n97
4160 - 1 0
4171 - 1 1
418- 0 0 0
419- 1 0 1
420.mv state$rand_choice$raw_n99 3 NO_REQ REQ HAVE_TOKEN
421.names state$rand_choice_n92$true state rand_choice state$rand_choice$raw_n99
422- - 0 =state
423- - 1 =state$rand_choice_n92$true
424.mv _n9c 3 NO_REQ REQ HAVE_TOKEN
425.names _n9c
426REQ
427.names state _n9c _n9b
428.def 0
429- =state 1
430.names _n9b  _n9a
4311 1
4320 0
433.names ack _n9d
434- =ack
435# state  = 2
436.mv state$ack_n9e$true 3 NO_REQ REQ HAVE_TOKEN
437.names state$ack_n9e$true
438HAVE_TOKEN
439# if/else (ack )
440.mv state$ack$raw_na1 3 NO_REQ REQ HAVE_TOKEN
441.names state$ack_n9e$true state ack state$ack$raw_na1
442- - 0 =state
443- - 1 =state$ack_n9e$true
444.mv _na4 3 NO_REQ REQ HAVE_TOKEN
445.names _na4
446HAVE_TOKEN
447.names state _na4 _na3
448.def 0
449- =state 1
450.names _na3  _na2
4511 1
4520 0
453.names rand_choice _na5
454- =rand_choice
455# req  = 0
456.names req$rand_choice_na6$true
4570
458# state  = 0
459.mv state$rand_choice_na7$true 3 NO_REQ REQ HAVE_TOKEN
460.names state$rand_choice_na7$true
461NO_REQ
462# if/else (rand_choice )
463.names req$rand_choice_na6$true req rand_choice req$rand_choice$raw_nac
4640 - 1 0
4651 - 1 1
466- 0 0 0
467- 1 0 1
468.mv state$rand_choice$raw_nae 3 NO_REQ REQ HAVE_TOKEN
469.names state$rand_choice_na7$true state rand_choice state$rand_choice$raw_nae
470- - 0 =state
471- - 1 =state$rand_choice_na7$true
472# case (state )
473.names req$rand_choice$raw_nac req _na2 req$_na2$raw_nb3
4740 - 1 0
4751 - 1 1
476- 0 0 0
477- 1 0 1
478.mv state$_na2$raw_nb5 3 NO_REQ REQ HAVE_TOKEN
479.names state$rand_choice$raw_nae state _na2 state$_na2$raw_nb5
480- - 0 =state
481- - 1 =state$rand_choice$raw_nae
482.mv state$_n9a$raw_nb6 3 NO_REQ REQ HAVE_TOKEN
483.names state$ack$raw_na1 state$_na2$raw_nb5 _n9a state$_n9a$raw_nb6
484- - 0 =state$_na2$raw_nb5
485- - 1 =state$ack$raw_na1
486.names req req$_na2$raw_nb3 _n9a req$_n9a$raw_nb9
4870 - 1 0
4881 - 1 1
489- 0 0 0
490- 1 0 1
491.names req$rand_choice$raw_n97 req$_n9a$raw_nb9 _n8d req$_n8d$raw_nbc
4920 - 1 0
4931 - 1 1
494- 0 0 0
495- 1 0 1
496.mv state$_n8d$raw_nbe 3 NO_REQ REQ HAVE_TOKEN
497.names state$rand_choice$raw_n99 state$_n9a$raw_nb6 _n8d state$_n8d$raw_nbe
498- - 0 =state$_n9a$raw_nb6
499- - 1 =state$rand_choice$raw_n99
500# conflict arbitrators
501.names _n8d _n90 _n9a _na2 _na5 _nc5
502.def 0
503 1 1 - - - 1
504 0 - 0 1 1 1
505.names _nc5 req$_n8d$raw_nbc req _nc6
5061 0 - 0
5071 1 - 1
5080 - 0 0
5090 - 1 1
510.names _n8d _n90 _n9a _n9d _na2 _na5 _nc7
511.def 0
512 1 1 - - - - 1
513 0 - 1 1 - - 1
514 0 - 0 - 1 1 1
515.mv _nc8 3 NO_REQ REQ HAVE_TOKEN
516.names _nc7 state$_n8d$raw_nbe state _nc8
5171 - - =state$_n8d$raw_nbe
5180 - - =state
519# non-blocking assignments
520# latches
521.r req$raw_n89 req
5220 0
5231 1
524.latch _nc6 req
525.r state$raw_n8a state
526- =state$raw_n8a
527.latch _nc8 state
528# quasi-continuous assignment
529.end
530
531
Note: See TracBrowser for help on using the repository browser.