source: vis_dev/vis-2.1/examples/ctlp3/ctlp3.mv @ 11

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

Add vis

File size: 6.4 KB
Line 
1# vl2mv ctlp3.v
2# version: 0.2
3# date:    11:13:08 12/11/95 (PST)
4.model diners
5# I/O ports
6
7.mv s0 4 THINKING HUNGRY EATING READING
8.mv s1 4 THINKING HUNGRY EATING READING
9.mv s2 4 THINKING HUNGRY EATING READING
10.mv _n0 4 THINKING HUNGRY EATING READING
11.names _n0
12EATING
13.subckt philosopher ph0 out=s0  left=s1  right=s2  init=_n0
14.mv _n1 4 THINKING HUNGRY EATING READING
15.names _n1
16READING
17.subckt philosopher ph1 out=s1  left=s2  right=s0  init=_n1
18.mv _n2 4 THINKING HUNGRY EATING READING
19.names _n2
20HUNGRY
21.subckt philosopher ph2 out=s2  left=s0  right=s1  init=_n2
22.subckt starvation str starv=s0 
23# conflict arbitrators
24# non-blocking assignments
25# latches
26# quasi-continuous assignment
27.end
28
29
30.model philosopher
31# I/O ports
32.inputs left
33.outputs out
34.inputs init
35.inputs right
36
37.mv left 4 THINKING HUNGRY EATING READING
38.mv out 4 THINKING HUNGRY EATING READING
39.mv r0_state 4 THINKING HUNGRY EATING READING
40.mv r1_state 4 THINKING HUNGRY EATING READING
41.mv state 4 THINKING HUNGRY EATING READING
42.mv init 4 THINKING HUNGRY EATING READING
43.mv right 4 THINKING HUNGRY EATING READING
44# state  = init
45.mv state$raw_n3 4 THINKING HUNGRY EATING READING
46.names init state$raw_n3
47- =init
48# non-blocking assignments for initial
49# assign r0_state  = $NDset ( 0,1 )
50.names r0_state
51THINKING
52HUNGRY
53# assign r1_state  = $NDset ( 0,2 )
54.names r1_state
55THINKING
56EATING
57# assign out  = state
58.mv out$raw_n8 4 THINKING HUNGRY EATING READING
59.names state out$raw_n8
60- =state
61.mv _nb 4 THINKING HUNGRY EATING READING
62.names _nb
63READING
64.names state _nb _na
65.def 0
66- =state 1
67.names _na  _n9
681 1
690 0
70.mv _nd 4 THINKING HUNGRY EATING READING
71.names _nd
72THINKING
73# left  == 0
74.names left _nd _nc
75.def 0
76- =left 1
77.names _nc _ne
78- =_nc
79# state  = 0
80.mv state$_nc_nf$true 4 THINKING HUNGRY EATING READING
81.names state$_nc_nf$true
82THINKING
83# if/else (left  == 0)
84.mv state$_nc$raw_n12 4 THINKING HUNGRY EATING READING
85.names state$_nc_nf$true state _nc state$_nc$raw_n12
86- - 0 =state
87- - 1 =state$_nc_nf$true
88.mv _n15 4 THINKING HUNGRY EATING READING
89.names _n15
90THINKING
91.names state _n15 _n14
92.def 0
93- =state 1
94.names _n14  _n13
951 1
960 0
97.mv _n17 4 THINKING HUNGRY EATING READING
98.names _n17
99READING
100# right  == 3
101.names right _n17 _n16
102.def 0
103- =right 1
104.names _n16 _n18
105- =_n16
106# state  = 3
107.mv state$_n16_n19$true 4 THINKING HUNGRY EATING READING
108.names state$_n16_n19$true
109READING
110# state  = r0_state
111.mv state$_n16_n1a$false 4 THINKING HUNGRY EATING READING
112.names r0_state state$_n16_n1a$false
113- =r0_state
114# if/else (right  == 3)
115.mv state$_n16$raw_n1c 4 THINKING HUNGRY EATING READING
116.names state$_n16_n19$true state$_n16_n1a$false _n16 state$_n16$raw_n1c
117- - 0 =state$_n16_n1a$false
118- - 1 =state$_n16_n19$true
119.mv _n21 4 THINKING HUNGRY EATING READING
120.names _n21
121EATING
122.names state _n21 _n20
123.def 0
124- =state 1
125.names _n20  _n1f
1261 1
1270 0
128# state  = r1_state
129.mv state$_n1f_n22$true 4 THINKING HUNGRY EATING READING
130.names r1_state state$_n1f_n22$true
131- =r1_state
132.mv _n25 4 THINKING HUNGRY EATING READING
133.names _n25
134HUNGRY
135.names state _n25 _n24
136.def 0
137- =state 1
138.names _n24  _n23
1391 1
1400 0
141.mv _n27 4 THINKING HUNGRY EATING READING
142.names _n27
143EATING
144# left  != 2
145.names left _n27 _n26
146.def 1
147- =left 0
148.mv _n29 4 THINKING HUNGRY EATING READING
149.names _n29
150HUNGRY
151# right  != 1
152.names right _n29 _n28
153.def 1
154- =right 0
155# left  != 2 && right  != 1
156.names _n26 _n28 _n2a
157.def 0
1581 1 1
159.mv _n2c 4 THINKING HUNGRY EATING READING
160.names _n2c
161EATING
162# right  != 2
163.names right _n2c _n2b
164.def 1
165- =right 0
166# left  != 2 && right  != 1 && right  != 2
167.names _n2a _n2b _n2d
168.def 0
1691 1 1
170.names _n2d _n2e
171- =_n2d
172# state  = 2
173.mv state$_n2d_n2f$true 4 THINKING HUNGRY EATING READING
174.names state$_n2d_n2f$true
175EATING
176# if/else (left  != 2 && right  != 1 && right  != 2)
177.mv state$_n2d$raw_n32 4 THINKING HUNGRY EATING READING
178.names state$_n2d_n2f$true state _n2d state$_n2d$raw_n32
179- - 0 =state
180- - 1 =state$_n2d_n2f$true
181# case (state )
182.mv state$_n23$raw_n35 4 THINKING HUNGRY EATING READING
183.names state$_n2d$raw_n32 state _n23 state$_n23$raw_n35
184- - 0 =state
185- - 1 =state$_n2d$raw_n32
186.mv state$_n1f$raw_n36 4 THINKING HUNGRY EATING READING
187.names state$_n1f_n22$true state$_n23$raw_n35 _n1f state$_n1f$raw_n36
188- - 0 =state$_n23$raw_n35
189- - 1 =state$_n1f_n22$true
190.mv state$_n13$raw_n3a 4 THINKING HUNGRY EATING READING
191.names state$_n16$raw_n1c state$_n1f$raw_n36 _n13 state$_n13$raw_n3a
192- - 0 =state$_n1f$raw_n36
193- - 1 =state$_n16$raw_n1c
194.mv state$_n9$raw_n3e 4 THINKING HUNGRY EATING READING
195.names state$_nc$raw_n12 state$_n13$raw_n3a _n9 state$_n9$raw_n3e
196- - 0 =state$_n13$raw_n3a
197- - 1 =state$_nc$raw_n12
198# conflict arbitrators
199.names out$raw_n8  out
200- =out$raw_n8
201.names _n9 _ne _n13 _n18 _n1f _n23 _n2e _n42
202.def 0
203 1 1 - - - - - 1
204 0 - 1 1 - - - 1
205 0 - 1 0 - - - 1
206 0 - 0 - 1 - - 1
207 0 - 0 - 0 1 1 1
208.mv _n43 4 THINKING HUNGRY EATING READING
209.names _n42 state$_n9$raw_n3e state _n43
2101 - - =state$_n9$raw_n3e
2110 - - =state
212# non-blocking assignments
213# latches
214.r state$raw_n3 state
215- =state$raw_n3
216.latch _n43 state
217# quasi-continuous assignment
218.end
219
220
221.model starvation
222# I/O ports
223.inputs starv
224
225.mv starv 4 THINKING HUNGRY EATING READING
226# state  = 0
227.names state$raw_n49
2280
229# non-blocking assignments for initial
230.names _n4c
2310
232.names state _n4c _n4d
233.def 0
2340 1 1
2351 0 1
236.names _n4d _n4b
2370 1 
2381 0 
239.names _n4b  _n4a
2401 1
2410 0
242.mv _n50 4 THINKING HUNGRY EATING READING
243.names _n50
244HUNGRY
245# starv  == 1
246.names starv _n50 _n4f
247.def 0
248- =starv 1
249.names _n4f _n51
250- =_n4f
251# state  = 1
252.names state$_n4f_n52$true
2531
254# if/else (starv  == 1)
255.names state$_n4f_n52$true state _n4f state$_n4f$raw_n55
2560 - 1 0
2571 - 1 1
258- 0 0 0
259- 1 0 1
260.names _n59
2611
262.names state _n59 _n5a
263.def 0
2640 1 1
2651 0 1
266.names _n5a _n58
2670 1 
2681 0 
269.names _n58  _n57
2701 1
2710 0
272.mv _n5d 4 THINKING HUNGRY EATING READING
273.names _n5d
274THINKING
275# starv  == 0
276.names starv _n5d _n5c
277.def 0
278- =starv 1
279.names _n5c _n5e
280- =_n5c
281# state  = 0
282.names state$_n5c_n5f$true
2830
284# if/else (starv  == 0)
285.names state$_n5c_n5f$true state _n5c state$_n5c$raw_n62
2860 - 1 0
2871 - 1 1
288- 0 0 0
289- 1 0 1
290# case (state )
291.names state$_n5c$raw_n62 state _n57 state$_n57$raw_n66
2920 - 1 0
2931 - 1 1
294- 0 0 0
295- 1 0 1
296.names state$_n4f$raw_n55 state$_n57$raw_n66 _n4a state$_n4a$raw_n68
2970 - 1 0
2981 - 1 1
299- 0 0 0
300- 1 0 1
301# conflict arbitrators
302.names _n4a _n51 _n57 _n5e _n6d
303.def 0
304 1 1 - - 1
305 0 - 1 1 1
306.names _n6d state$_n4a$raw_n68 state _n6e
3071 0 - 0
3081 1 - 1
3090 - 0 0
3100 - 1 1
311# non-blocking assignments
312# latches
313.r state$raw_n49 state
3140 0
3151 1
316.latch _n6e state
317# quasi-continuous assignment
318.end
319
320
Note: See TracBrowser for help on using the repository browser.