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

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

Add vis

File size: 13.4 KB
Line 
1# vl2mv tlc.v
2# version: 0.2
3# date:    13:31:53 12/11/95 (PST)
4.model main
5# I/O ports
6
7.mv car_present 2 YES NO
8.mv farm_light 3 GREEN YELLOW RED
9.mv hwy_light 3 GREEN YELLOW RED
10# assign start_timer  = farm_start_timer  || hwy_start_timer
11# farm_start_timer  || hwy_start_timer
12.names farm_start_timer hwy_start_timer _n1
13.def 1
140 0 0
15.names _n1 start_timer$raw_n0
16- =_n1
17.subckt timer timer start=start_timer  short=short_timer  long=long_timer 
18.subckt sensor sensor car_present=car_present 
19.subckt farm_control farm_control car_present=car_present  enable_farm=enable_farm  short_timer=short_timer  long_timer=long_timer  farm_light=farm_light  farm_start_timer=farm_start_timer  enable_hwy=enable_hwy 
20.subckt hwy_control hwy_control car_present=car_present  enable_hwy=enable_hwy  short_timer=short_timer  long_timer=long_timer  hwy_light=hwy_light  hwy_start_timer=hwy_start_timer  enable_farm=enable_farm 
21# conflict arbitrators
22.names start_timer$raw_n0  start_timer
230 0
241 1
25# non-blocking assignments
26# latches
27# quasi-continuous assignment
28.end
29
30
31.model timer
32# I/O ports
33.outputs short
34.outputs long
35.inputs start
36
37.mv state 3 START SHORT LONG
38# state  = 0
39.mv state$raw_n2 3 START SHORT LONG
40.names state$raw_n2
41START
42# non-blocking assignments for initial
43# assign rand_choice  = $NDset ( 0,1 )
44.names rand_choice
450
461
47# assign short  = ((state  == SHORT ) || (state  == LONG ))
48.mv _n7 3 START SHORT LONG
49.names _n7
50SHORT
51# state  == 1
52.names state _n7 _n6
53.def 0
54- =state 1
55.mv _n9 3 START SHORT LONG
56.names _n9
57LONG
58# state  == 2
59.names state _n9 _n8
60.def 0
61- =state 1
62# (state  == 1) || (state  == 2)
63.names _n6 _n8 _na
64.def 1
650 0 0
66.names _na short$raw_n5
67- =_na
68# assign long  = (state  == LONG )
69.mv _nd 3 START SHORT LONG
70.names _nd
71LONG
72# state  == 2
73.names state _nd _nc
74.def 0
75- =state 1
76.names _nc long$raw_nb
77- =_nc
78.names start _ne
79- =start
80# state  = 0
81.mv state$start_nf$true 3 START SHORT LONG
82.names state$start_nf$true
83START
84.mv _n12 3 START SHORT LONG
85.names _n12
86START
87.names state _n12 _n11
88.def 0
89- =state 1
90.names _n11  _n10
911 1
920 0
93.names _n14
941
95# rand_choice  == 1
96.names rand_choice _n14 _n15
97.def 0
980 1 1
991 0 1
100.names _n15 _n13
1010 1 
1021 0 
103.names _n13 _n17
104- =_n13
105# state  = 1
106.mv state$_n13_n18$true 3 START SHORT LONG
107.names state$_n13_n18$true
108SHORT
109# if/else (rand_choice  == 1)
110.mv state$_n13$raw_n1b 3 START SHORT LONG
111.names state$_n13_n18$true state _n13 state$_n13$raw_n1b
112- - 0 =state
113- - 1 =state$_n13_n18$true
114.mv _n1e 3 START SHORT LONG
115.names _n1e
116SHORT
117.names state _n1e _n1d
118.def 0
119- =state 1
120.names _n1d  _n1c
1211 1
1220 0
123.names _n20
1241
125# rand_choice  == 1
126.names rand_choice _n20 _n21
127.def 0
1280 1 1
1291 0 1
130.names _n21 _n1f
1310 1 
1321 0 
133.names _n1f _n23
134- =_n1f
135# state  = 2
136.mv state$_n1f_n24$true 3 START SHORT LONG
137.names state$_n1f_n24$true
138LONG
139# if/else (rand_choice  == 1)
140.mv state$_n1f$raw_n27 3 START SHORT LONG
141.names state$_n1f_n24$true state _n1f state$_n1f$raw_n27
142- - 0 =state
143- - 1 =state$_n1f_n24$true
144# case (state )
145.mv state$_n1c$raw_n2a 3 START SHORT LONG
146.names state$_n1f$raw_n27 state _n1c state$_n1c$raw_n2a
147- - 0 =state
148- - 1 =state$_n1f$raw_n27
149.mv state$_n10$raw_n2b 3 START SHORT LONG
150.names state$_n13$raw_n1b state$_n1c$raw_n2a _n10 state$_n10$raw_n2b
151- - 0 =state$_n1c$raw_n2a
152- - 1 =state$_n13$raw_n1b
153# if/else (start )
154.mv state$start$raw_n30 3 START SHORT LONG
155.names state$start_nf$true state$_n10$raw_n2b start state$start$raw_n30
156- - 0 =state$_n10$raw_n2b
157- - 1 =state$start_nf$true
158# conflict arbitrators
159.names short$raw_n5  short
1600 0
1611 1
162.names long$raw_nb  long
1630 0
1641 1
165.names _ne _n10 _n17 _n1c _n23 _n33
166.def 0
167 1 - - - - 1
168 0 1 1 - - 1
169 0 0 - 1 1 1
170.mv _n34 3 START SHORT LONG
171.names _n33 state$start$raw_n30 state _n34
1721 - - =state$start$raw_n30
1730 - - =state
174# non-blocking assignments
175# latches
176.r state$raw_n2 state
177- =state$raw_n2
178.latch _n34 state
179# quasi-continuous assignment
180.end
181
182
183.model sensor
184# I/O ports
185.outputs car_present
186
187.mv car_present 2 YES NO
188# car_present  = 1
189.mv car_present$raw_n3a 2 YES NO
190.names car_present$raw_n3a
191NO
192# non-blocking assignments for initial
193# assign rand_choice  = $NDset ( 0,1 )
194.names rand_choice
1950
1961
197.names _n3e
1980
199# rand_choice  == 0
200.names rand_choice _n3e _n3f
201.def 0
2020 1 1
2031 0 1
204.names _n3f _n3d
2050 1 
2061 0 
207.names _n3d _n41
208- =_n3d
209# car_present  = 1
210.mv car_present$_n3d_n42$true 2 YES NO
211.names car_present$_n3d_n42$true
212NO
213# car_present  = 0
214.mv car_present$_n3d_n43$false 2 YES NO
215.names car_present$_n3d_n43$false
216YES
217# if/else (rand_choice  == 0)
218.mv car_present$_n3d$raw_n45 2 YES NO
219.names car_present$_n3d_n42$true car_present$_n3d_n43$false _n3d car_present$_n3d$raw_n45
220- - 0 =car_present$_n3d_n43$false
221- - 1 =car_present$_n3d_n42$true
222# conflict arbitrators
223.names _n41 _n48
224.def 0
225 1 1
226 0 1
227.mv _n49 2 YES NO
228.names _n48 car_present$_n3d$raw_n45 car_present _n49
2291 - - =car_present$_n3d$raw_n45
2300 - - =car_present
231# non-blocking assignments
232# latches
233.r car_present$raw_n3a car_present
234- =car_present$raw_n3a
235.latch _n49 car_present
236# quasi-continuous assignment
237.end
238
239
240.model farm_control
241# I/O ports
242.inputs car_present
243.outputs farm_light
244.inputs enable_farm
245.inputs long_timer
246.inputs short_timer
247.outputs farm_start_timer
248.outputs enable_hwy
249
250.mv car_present 2 YES NO
251.mv farm_light 3 GREEN YELLOW RED
252# farm_light  = 2
253.mv farm_light$raw_n4c 3 GREEN YELLOW RED
254.names farm_light$raw_n4c
255RED
256# non-blocking assignments for initial
257# assign farm_start_timer  = (((farm_light  == GREEN ) && ((car_present  == NO ) || long_timer )) || (farm_light  == RED ) && enable_farm )
258.mv _n4f 3 GREEN YELLOW RED
259.names _n4f
260GREEN
261# farm_light  == 0
262.names farm_light _n4f _n4e
263.def 0
264- =farm_light 1
265.mv _n51 2 YES NO
266.names _n51
267NO
268# car_present  == 1
269.names car_present _n51 _n50
270.def 0
271- =car_present 1
272# (car_present  == 1) || long_timer
273.names _n50 long_timer _n52
274.def 1
2750 0 0
276# (farm_light  == 0) && ((car_present  == 1) || long_timer )
277.names _n4e _n52 _n53
278.def 0
2791 1 1
280.mv _n55 3 GREEN YELLOW RED
281.names _n55
282RED
283# farm_light  == 2
284.names farm_light _n55 _n54
285.def 0
286- =farm_light 1
287# (farm_light  == 2) && enable_farm
288.names _n54 enable_farm _n56
289.def 0
2901 1 1
291# ((farm_light  == 0) && ((car_present  == 1) || long_timer )) || (farm_light  == 2) && enable_farm
292.names _n53 _n56 _n57
293.def 1
2940 0 0
295.names _n57 farm_start_timer$raw_n4d
296- =_n57
297# assign enable_hwy  = ((farm_light  == YELLOW ) && short_timer )
298.mv _n5a 3 GREEN YELLOW RED
299.names _n5a
300YELLOW
301# farm_light  == 1
302.names farm_light _n5a _n59
303.def 0
304- =farm_light 1
305# (farm_light  == 1) && short_timer
306.names _n59 short_timer _n5b
307.def 0
3081 1 1
309.names _n5b enable_hwy$raw_n58
310- =_n5b
311.mv _n5e 3 GREEN YELLOW RED
312.names _n5e
313GREEN
314.names farm_light _n5e _n5d
315.def 0
316- =farm_light 1
317.names _n5d  _n5c
3181 1
3190 0
320.mv _n60 2 YES NO
321.names _n60
322NO
323# car_present  == 1
324.names car_present _n60 _n5f
325.def 0
326- =car_present 1
327# (car_present  == 1) || long_timer
328.names _n5f long_timer _n61
329.def 1
3300 0 0
331.names _n61 _n62
332- =_n61
333# farm_light  = 1
334.mv farm_light$_n61_n63$true 3 GREEN YELLOW RED
335.names farm_light$_n61_n63$true
336YELLOW
337# if/else ((car_present  == 1) || long_timer )
338.mv farm_light$_n61$raw_n66 3 GREEN YELLOW RED
339.names farm_light$_n61_n63$true farm_light _n61 farm_light$_n61$raw_n66
340- - 0 =farm_light
341- - 1 =farm_light$_n61_n63$true
342.mv _n69 3 GREEN YELLOW RED
343.names _n69
344YELLOW
345.names farm_light _n69 _n68
346.def 0
347- =farm_light 1
348.names _n68  _n67
3491 1
3500 0
351.names short_timer _n6a
352- =short_timer
353# farm_light  = 2
354.mv farm_light$short_timer_n6b$true 3 GREEN YELLOW RED
355.names farm_light$short_timer_n6b$true
356RED
357# if/else (short_timer )
358.mv farm_light$short_timer$raw_n6e 3 GREEN YELLOW RED
359.names farm_light$short_timer_n6b$true farm_light short_timer farm_light$short_timer$raw_n6e
360- - 0 =farm_light
361- - 1 =farm_light$short_timer_n6b$true
362.mv _n71 3 GREEN YELLOW RED
363.names _n71
364RED
365.names farm_light _n71 _n70
366.def 0
367- =farm_light 1
368.names _n70  _n6f
3691 1
3700 0
371.names enable_farm _n72
372- =enable_farm
373# farm_light  = 0
374.mv farm_light$enable_farm_n73$true 3 GREEN YELLOW RED
375.names farm_light$enable_farm_n73$true
376GREEN
377# if/else (enable_farm )
378.mv farm_light$enable_farm$raw_n76 3 GREEN YELLOW RED
379.names farm_light$enable_farm_n73$true farm_light enable_farm farm_light$enable_farm$raw_n76
380- - 0 =farm_light
381- - 1 =farm_light$enable_farm_n73$true
382# case (farm_light )
383.mv farm_light$_n6f$raw_n79 3 GREEN YELLOW RED
384.names farm_light$enable_farm$raw_n76 farm_light _n6f farm_light$_n6f$raw_n79
385- - 0 =farm_light
386- - 1 =farm_light$enable_farm$raw_n76
387.mv farm_light$_n67$raw_n7a 3 GREEN YELLOW RED
388.names farm_light$short_timer$raw_n6e farm_light$_n6f$raw_n79 _n67 farm_light$_n67$raw_n7a
389- - 0 =farm_light$_n6f$raw_n79
390- - 1 =farm_light$short_timer$raw_n6e
391.mv farm_light$_n5c$raw_n7e 3 GREEN YELLOW RED
392.names farm_light$_n61$raw_n66 farm_light$_n67$raw_n7a _n5c farm_light$_n5c$raw_n7e
393- - 0 =farm_light$_n67$raw_n7a
394- - 1 =farm_light$_n61$raw_n66
395# conflict arbitrators
396.names _n5c _n62 _n67 _n6a _n6f _n72 _n82
397.def 0
398 1 1 - - - - 1
399 0 - 1 1 - - 1
400 0 - 0 - 1 1 1
401.mv _n83 3 GREEN YELLOW RED
402.names _n82 farm_light$_n5c$raw_n7e farm_light _n83
4031 - - =farm_light$_n5c$raw_n7e
4040 - - =farm_light
405.names farm_start_timer$raw_n4d  farm_start_timer
4060 0
4071 1
408.names enable_hwy$raw_n58  enable_hwy
4090 0
4101 1
411# non-blocking assignments
412# latches
413.r farm_light$raw_n4c farm_light
414- =farm_light$raw_n4c
415.latch _n83 farm_light
416# quasi-continuous assignment
417.end
418
419
420.model hwy_control
421# I/O ports
422.inputs car_present
423.outputs enable_farm
424.inputs long_timer
425.inputs short_timer
426.outputs hwy_light
427.outputs hwy_start_timer
428.inputs enable_hwy
429
430.mv car_present 2 YES NO
431.mv hwy_light 3 GREEN YELLOW RED
432# hwy_light  = 0
433.mv hwy_light$raw_n8b 3 GREEN YELLOW RED
434.names hwy_light$raw_n8b
435GREEN
436# non-blocking assignments for initial
437# assign hwy_start_timer  = (((hwy_light  == GREEN ) && ((car_present  == YES ) && long_timer )) || (hwy_light  == RED ) && enable_hwy )
438.mv _n8e 3 GREEN YELLOW RED
439.names _n8e
440GREEN
441# hwy_light  == 0
442.names hwy_light _n8e _n8d
443.def 0
444- =hwy_light 1
445.mv _n90 2 YES NO
446.names _n90
447YES
448# car_present  == 0
449.names car_present _n90 _n8f
450.def 0
451- =car_present 1
452# (car_present  == 0) && long_timer
453.names _n8f long_timer _n91
454.def 0
4551 1 1
456# (hwy_light  == 0) && ((car_present  == 0) && long_timer )
457.names _n8d _n91 _n92
458.def 0
4591 1 1
460.mv _n94 3 GREEN YELLOW RED
461.names _n94
462RED
463# hwy_light  == 2
464.names hwy_light _n94 _n93
465.def 0
466- =hwy_light 1
467# (hwy_light  == 2) && enable_hwy
468.names _n93 enable_hwy _n95
469.def 0
4701 1 1
471# ((hwy_light  == 0) && ((car_present  == 0) && long_timer )) || (hwy_light  == 2) && enable_hwy
472.names _n92 _n95 _n96
473.def 1
4740 0 0
475.names _n96 hwy_start_timer$raw_n8c
476- =_n96
477# assign enable_farm  = ((hwy_light  == YELLOW ) && short_timer )
478.mv _n99 3 GREEN YELLOW RED
479.names _n99
480YELLOW
481# hwy_light  == 1
482.names hwy_light _n99 _n98
483.def 0
484- =hwy_light 1
485# (hwy_light  == 1) && short_timer
486.names _n98 short_timer _n9a
487.def 0
4881 1 1
489.names _n9a enable_farm$raw_n97
490- =_n9a
491.mv _n9d 3 GREEN YELLOW RED
492.names _n9d
493GREEN
494.names hwy_light _n9d _n9c
495.def 0
496- =hwy_light 1
497.names _n9c  _n9b
4981 1
4990 0
500.mv _n9f 2 YES NO
501.names _n9f
502YES
503# car_present  == 0
504.names car_present _n9f _n9e
505.def 0
506- =car_present 1
507# (car_present  == 0) && long_timer
508.names _n9e long_timer _na0
509.def 0
5101 1 1
511.names _na0 _na1
512- =_na0
513# hwy_light  = 1
514.mv hwy_light$_na0_na2$true 3 GREEN YELLOW RED
515.names hwy_light$_na0_na2$true
516YELLOW
517# if/else ((car_present  == 0) && long_timer )
518.mv hwy_light$_na0$raw_na5 3 GREEN YELLOW RED
519.names hwy_light$_na0_na2$true hwy_light _na0 hwy_light$_na0$raw_na5
520- - 0 =hwy_light
521- - 1 =hwy_light$_na0_na2$true
522.mv _na8 3 GREEN YELLOW RED
523.names _na8
524YELLOW
525.names hwy_light _na8 _na7
526.def 0
527- =hwy_light 1
528.names _na7  _na6
5291 1
5300 0
531.names short_timer _na9
532- =short_timer
533# hwy_light  = 2
534.mv hwy_light$short_timer_naa$true 3 GREEN YELLOW RED
535.names hwy_light$short_timer_naa$true
536RED
537# if/else (short_timer )
538.mv hwy_light$short_timer$raw_nad 3 GREEN YELLOW RED
539.names hwy_light$short_timer_naa$true hwy_light short_timer hwy_light$short_timer$raw_nad
540- - 0 =hwy_light
541- - 1 =hwy_light$short_timer_naa$true
542.mv _nb0 3 GREEN YELLOW RED
543.names _nb0
544RED
545.names hwy_light _nb0 _naf
546.def 0
547- =hwy_light 1
548.names _naf  _nae
5491 1
5500 0
551.names enable_hwy _nb1
552- =enable_hwy
553# hwy_light  = 0
554.mv hwy_light$enable_hwy_nb2$true 3 GREEN YELLOW RED
555.names hwy_light$enable_hwy_nb2$true
556GREEN
557# if/else (enable_hwy )
558.mv hwy_light$enable_hwy$raw_nb5 3 GREEN YELLOW RED
559.names hwy_light$enable_hwy_nb2$true hwy_light enable_hwy hwy_light$enable_hwy$raw_nb5
560- - 0 =hwy_light
561- - 1 =hwy_light$enable_hwy_nb2$true
562# case (hwy_light )
563.mv hwy_light$_nae$raw_nb8 3 GREEN YELLOW RED
564.names hwy_light$enable_hwy$raw_nb5 hwy_light _nae hwy_light$_nae$raw_nb8
565- - 0 =hwy_light
566- - 1 =hwy_light$enable_hwy$raw_nb5
567.mv hwy_light$_na6$raw_nb9 3 GREEN YELLOW RED
568.names hwy_light$short_timer$raw_nad hwy_light$_nae$raw_nb8 _na6 hwy_light$_na6$raw_nb9
569- - 0 =hwy_light$_nae$raw_nb8
570- - 1 =hwy_light$short_timer$raw_nad
571.mv hwy_light$_n9b$raw_nbd 3 GREEN YELLOW RED
572.names hwy_light$_na0$raw_na5 hwy_light$_na6$raw_nb9 _n9b hwy_light$_n9b$raw_nbd
573- - 0 =hwy_light$_na6$raw_nb9
574- - 1 =hwy_light$_na0$raw_na5
575# conflict arbitrators
576.names enable_farm$raw_n97  enable_farm
5770 0
5781 1
579.names _n9b _na1 _na6 _na9 _nae _nb1 _nc1
580.def 0
581 1 1 - - - - 1
582 0 - 1 1 - - 1
583 0 - 0 - 1 1 1
584.mv _nc2 3 GREEN YELLOW RED
585.names _nc1 hwy_light$_n9b$raw_nbd hwy_light _nc2
5861 - - =hwy_light$_n9b$raw_nbd
5870 - - =hwy_light
588.names hwy_start_timer$raw_n8c  hwy_start_timer
5890 0
5901 1
591# non-blocking assignments
592# latches
593.r hwy_light$raw_n8b hwy_light
594- =hwy_light$raw_n8b
595.latch _nc2 hwy_light
596# quasi-continuous assignment
597.end
598
599
Note: See TracBrowser for help on using the repository browser.