This file is indexed.

/usr/bin/faum-gen-vhdl is in faumachine 20120707-3.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
#!/bin/bash
#
# $Id: faum-gen-vhdl,v 1.74 2012-02-17 07:36:42 vrsieh Exp $
#
# Copyright (C) 2004-2009 FAUmachine Team <info@faumachine.org>.
# This program is free software. You can redistribute it and/or modify it
# under the terms of the GNU General Public License, either version 2 of
# the License, or (at your option) any later version. See COPYING.
#
# $1: generate-file
# [ $2 ]: base directory to look for screenshots/pointers
# emit vhdl script from commands in generate-file on stdout.
#

time_unit() {
	val=`echo $1 | sed -e 's/[a-z]*$//'`
	unit=`echo $1 | sed -e 's/^[0-9]*//'`

	if [ -z "$unit" ]; then
		unit="ms"
	fi

	case $unit in
	fs|ps|ns|us)
		echo "$0: $unit: Unsupported time unit." 1>&2
		exit 1
		;;
	ms | sec | min | hr)
		printf "${val} ${unit}"
		;;
	*)
		echo "$0: ${unit}: Unknown time unit." 1>&2
		exit 1
		;;
	esac
}

# $1 file name of screenshot
# EXP_DIR global (path to experiment directory)
# set SCREENSHOT to found path, exit if not found.
search_screenshot() {
	SHOT=$1
	if [ -e "${SHOT}" ]; then
		return;
	fi

	SHOT="screenshots/$1"
	if [ -e "$SHOT" ]; then
		return;
	fi

	if [ -z "$EXP_DIR" ]; then
		echo "cannot find screenshot $1" 1>&2
		exit 1
	fi

	SHOT="$EXP_DIR/$1"
	if [ -e "$SHOT" ]; then
		return;
	fi

	SHOT="$EXP_DIR/screenshots/$1"
	if [ -e "$SHOT" ]; then
		return;
	fi

	echo "Cannot find screenshot $1" 1>&2
	exit 1
}

# no arguments
# check if ./pointers/ or $EXP_DIR/pointers exists and
# contains images. Exit with error if not.
# will set POINTERDIR on success.
check_mouse_pointerdir() {
	POINTERDIR="pointers"
	if [ -d "$POINTERDIR" ]; then
		PICS=$(echo $POINTERDIR/*.png $POINTERDIR/*.ppm)
		if [ "$PICS" != "$POINTERDIR/*.png $POINTERDIR/*.ppm" ]; then
			return
		fi
	fi

	POINTERDIR="$EXP_DIR/pointers"
	if [ -d "$POINTERDIR" ]; then
		PICS=$(echo $POINTERDIR/*.png $POINTERDIR/*.ppm)
		if [ "$PICS" != "$POINTERDIR/*.png $POINTERDIR/*.ppm" ]; then
			return
		fi
	fi

	echo "Cannot find a pointers directory with images." 1>&2
	exit 1
}

EXP_DIR=$2

IFS='	'
cat $1 \
| grep -v '^#' \
| sed 's/\\/\\\\/g' \
| sed -e 's/		*/	/g' \
| while read p1 p2 p3 p4; do

if [ "$p1" = "debug" ]; then
	#
	# debug
	#
	printf "\n"
	printf "		-- debug on/off\n"
	printf "		debug;\n"
	printf "\n"


elif [ "$p1" = "power_on" ]; then
	#
	# power_on
	#
	printf "\n"
	printf "		-- power on machine\n"
	printf "		power_button <= true;\n"
	printf "		wait for 1000 ms;\n"
	printf "		power_button <= false;\n"
	printf "\n"

elif [ "$p1" = "power_off" ]; then
	#
	# power_off
	#
	printf "\n"
	printf "		-- power off machine\n"
	printf "		power_button <= true;\n"
	printf "		wait for 5000 ms;\n"
	printf "		power_button <= false;\n"
	printf "\n"

elif [ "$p1" = "power_switch_on" ]; then
	#
	# power_switch_on
	#
	printf "\n"
	printf "		-- power on machine\n"
	printf "		power_switch <= true;\n"
	printf "		wait for 1000 ms ;\n"
	printf "\n"

elif [ "$p1" = "power_switch_off" ]; then
	#
	# power_switch_off
	#
	printf "\n"
	printf "		-- power off machine\n"
	printf "		power_switch <= false;\n"
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "reset" ]; then
	#
	# reset
	#
	printf "\n"
	printf "		-- reset machine\n"
	printf "		reset_button <= true;\n"
	printf "		wait for 1000 ms;\n"
	printf "		reset_button <= false;\n"
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "wait_ppm" ]; then
	#
	# wait_ppm	<screenshotname>	<time until timeout>
	#
	search_screenshot "$p2"
	printf "\n"
	printf "		-- wait for screenshot %s\n" "$p2"
	printf "		ASSERT false REPORT \"waiting for %s (%s)\" SEVERITY note;\n" $p2 `time_unit $p3`
	printf "		wakeup_screensaver <= true;\n"
	printf "		send_string(gfx_pattern0, \"%s\");\n" "$SHOT"
	printf "		WAIT ON gfx_match0(1) UNTIL gfx_match0(1) >= 0 FOR %s;\n" `time_unit $p3`
	printf "		send_string(gfx_pattern0, \"\");\n"
	printf "		wakeup_screensaver <= false;\n"
	printf "		IF gfx_match0(1) < 0 THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1000 ms;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"timeout, screenshot taken\" SEVERITY failure;\n"
	printf "		END IF;\n"
	printf "		WAIT ON gfx_match0 UNTIL (gfx_match0(1) = -2);\n"
	printf "		ASSERT false REPORT \"found %s\" SEVERITY note;\n" "$p2"
	printf "\n"

elif [ "$p1" = "wait_asc" ]; then
	#
	# wait_asc	<character sequence>	<time until timeout>
	#
	printf "\n"
	printf "		-- wait for pattern %s\n" $p2
	printf "		ASSERT false REPORT \"waiting for %s (%s)\" SEVERITY note;\n" "$p2" `time_unit $p3`
	printf "		wakeup_screensaver <= true;\n"
	printf "		send_string(int_asc_text0, \"%s\");\n" "$p2"
	printf "		WAIT ON int_asc_text0_state UNTIL int_asc_text0_state FOR %s;\n" `time_unit $p3`
	printf "		send_string(int_asc_text0, \"\");\n"
	printf "		wakeup_screensaver <= false;\n"
	printf "		IF NOT int_asc_text0_state THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1000 ms;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"timeout, screenshot taken\" SEVERITY failure;\n"
	printf "		END IF;\n"
	printf "		WAIT ON int_asc_text0_state UNTIL NOT int_asc_text0_state;\n"
	printf "		ASSERT false REPORT \"%s: found and completed!\" SEVERITY note;\n" "$p2"
	printf "\n"

elif [ "$p1" = "wait_text" ]; then
	#
	# wait_text	<character sequence>	<time until timeout>
	#
	printf "\n"
	printf "		-- wait for text %s\n" "$p2"
	printf "		ASSERT false REPORT \"waiting for %s (%s)\" SEVERITY note;\n" $p2 `time_unit $p3`
	printf "		wakeup_screensaver <= true;\n"
	printf "		send_string(int_text0, \"%s\");\n" "$p2"
	printf "		WAIT ON int_text0_state UNTIL (int_text0_state) FOR %s;\n" `time_unit $p3`
	printf "		send_string(int_text0, \"\");\n"
	printf "		wakeup_screensaver <= false;\n"
	printf "		IF (int_text0_state = false) THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1000 ms;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"%s: timeout, screenshot taken\" SEVERITY failure;\n" "$p2"
	printf "		END IF;\n"
	printf "		ASSERT false REPORT \"%s: done. deactivating...\" SEVERITY note;\n" "$p2"
	printf "		ASSERT false REPORT \"%s: done. waiting on ack\" SEVERITY note;\n" "$p2"
	printf "		WAIT ON int_text0_state UNTIL (int_text0_state = false);\n"
	printf "		ASSERT false REPORT \"%s: pattern found and completed!!\" SEVERITY note;\n" "$p2"
	printf "\n"

elif [ "$p1" = "delay" ]; then
	#
	# delay <time>
	#
	printf "\n"
	printf "		-- delay for %s\n" `time_unit $p2`
	printf "		ASSERT false REPORT \"delaying for %s\" SEVERITY note;\n" `time_unit $p2`
	printf "		WAIT FOR %s;\n" `time_unit $p2`
	printf "\n"

elif [ "$p1" = "type" ]; then
	#
	# type <character sequence>
	#
	printf "\n"
	printf "		-- type sequence %s\n" "$p2"
	printf "		ASSERT false REPORT \"Typing %s\" SEVERITY note;\n" `echo "$p2" | sed -e 's/\\\\//g' | sed -e 's/"//g'`
	printf "		send_keyboard(key, 0, %s, 100 ms);\n" "$p2"
	printf "\n"

elif [ "$p1" = "press_alt" ]; then
	#
	# press_alt
	#
	printf "\n"
	printf "		-- press alt key\n"
	printf "		ASSERT false REPORT \"Press alt\" SEVERITY note;\n"
	printf "		key(56) <= true;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "release_alt" ]; then
	#
	# release_alt
	#
	printf "\n"
	printf "		-- release alt key\n"
	printf "		ASSERT false REPORT \"Release alt\" SEVERITY note;\n"
	printf "		key(56) <= false;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "press_ctrl" ]; then
	#
	# press_ctrl
	#
	printf "\n"
	printf "		-- press ctrl key\n"
	printf "		ASSERT false REPORT \"Press ctrl\" SEVERITY note;\n"
	printf "		key(29) <= true;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "release_ctrl" ]; then
	#
	# release_ctrl
	#
	printf "\n"
	printf "		-- release ctrl key\n"
	printf "		ASSERT false REPORT \"Release ctrl\" SEVERITY note;\n"
	printf "		key(29) <= false;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "press_windows" ]; then
	#
	# press_windows
	#
	printf "\n"
	printf "		-- press windows key\n"
	printf "		ASSERT false REPORT \"Press windows\" SEVERITY note;\n"
	printf "		key(125) <= true;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "release_windows" ]; then
	#
	# release_windows
	#
	printf "\n"
	printf "		-- release windows key\n"
	printf "		ASSERT false REPORT \"Release windows\" SEVERITY note;\n"
	printf "		key(125) <= false;\n"
	printf "		WAIT FOR 500 ms;\n"
	printf "\n"

elif [ "$p1" = "mouse_move" ]; then
	#
	# mouse_move <image>
	#
	check_mouse_pointerdir
	search_screenshot "$p2"
	printf "\n"
	printf "		-- wait for screenshot %s\n" "$p2"
	printf "		ASSERT false REPORT \"waiting for %s\" SEVERITY note;\n" $p2
	printf "		send_string(gfx_pattern0, \"%s\");\n" "$SHOT"
	printf "		WAIT ON gfx_match0(1) UNTIL gfx_match0(1) >= 0 FOR 10000 ms;\n"
	printf "		x := gfx_match0(1) + gfx_match0(3) / 2;\n"
	printf "		y := gfx_match0(2) + gfx_match0(4) / 2;\n"
	printf "		send_string(gfx_pattern0, \"\");\n"
	printf "		IF gfx_match0(1) < 0 THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1000 ms;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"timeout, screenshot taken\" SEVERITY failure;\n"
	printf "		END IF;\n"
	printf "		WAIT ON gfx_match0 UNTIL (gfx_match0(1) = -2);\n"
	printf "		ASSERT false REPORT \"found %s\" SEVERITY note;\n" "$p2"
	printf "\n"
	printf "		-- activate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"$POINTERDIR\");\n"
	printf "\n"
	printf "		-- move mouse to positon\n"
	printf "		control_mouse(x, y, mouse_match, mouse_event, mouse_x, mouse_y, mouse_dx, mouse_dy);\n"
	printf "\n"
	printf "		-- deactivate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"\");\n"
	printf "\n"

elif [ "$p1" = "mouse_button1_press" ]; then
	printf "\n"
	printf "		-- press mouse button\n"
	printf "		mouse_button1 <= true;\n"
	printf "\n"

elif [ "$p1" = "mouse_button1_release" ]; then
	printf "\n"
	printf "		-- release mouse button\n"
	printf "		mouse_button1 <= false;\n"
	printf "\n"

elif [ "$p1" = "mouse_click" ]; then
	#
	# mouse_click <image>
	#
	check_mouse_pointerdir
	search_screenshot "$p2"
	printf "\n"
	printf "		-- wait for screenshot %s\n" "$p2"
	printf "		ASSERT false REPORT \"waiting for %s\" SEVERITY	note;\n" "$p2"
	printf "		send_string(gfx_pattern0, \"%s\");\n" "$SHOT"
	printf "		WAIT ON gfx_match0(1) UNTIL gfx_match0(1) >= 0 FOR 10000 ms;\n"
	printf "		x := gfx_match0(1) + gfx_match0(3) / 2;\n"
	printf "		y := gfx_match0(2) + gfx_match0(4) / 2;\n"
	printf "		send_string(gfx_pattern0, \"\");\n"
	printf "		IF gfx_match0(1) < 0 THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1000 ms;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"timeout, screenshot taken\" SEVERITY failure;\n"
	printf "		END IF;\n"
	printf "		WAIT ON gfx_match0 UNTIL (gfx_match0(1) = -2);\n"
	printf "		ASSERT false REPORT \"found %s\" SEVERITY note;\n" "$p2"
	printf "\n"
	printf "		-- activate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"$POINTERDIR\");\n"
	printf "\n"
	printf "		-- move mouse to positon\n"
	printf "		control_mouse(x, y, mouse_match, mouse_event, mouse_x, mouse_y, mouse_dx, mouse_dy);\n"
	printf "\n"
	printf "		-- deactivate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"\");\n"
	printf "\n"
	printf "		-- click mouse\n"
	printf "		mouse_button1 <= true;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "		mouse_button1 <= false;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "mouse_dclick" ]; then
	#
	# mouse_dclick <image>
	#
	search_screenshot "$p2"
	check_mouse_pointerdir
	printf "\n"
	printf "		-- wait for screenshot %s\n" "$p2"
	printf "		ASSERT false REPORT \"waiting for %s\" SEVERITY	note;\n" "$p2"
	printf "		send_string(gfx_pattern0, \"%s\");\n" "$SHOT"
	printf "		WAIT ON gfx_match0(1) UNTIL gfx_match0(1) >= 0 FOR 10 sec;\n"
	printf "		x := gfx_match0(1) + gfx_match0(3) / 2;\n"
	printf "		y := gfx_match0(2) + gfx_match0(4) / 2;\n"
	printf "		send_string(gfx_pattern0, \"\");\n"
	printf "		IF gfx_match0(1) < 0 THEN\n"
	printf "			screen_shot <= true;\n"
	printf "			WAIT FOR 1 sec;\n"
	printf "			screen_shot <= false;\n"
	printf "			ASSERT false REPORT \"timeout, screenshot taken\" SEVERITY failure;\n"
	printf "		END IF;\n"
	printf "		WAIT ON gfx_match0 UNTIL (gfx_match0(1) = -2);\n"
	printf "		ASSERT false REPORT \"found %s\" SEVERITY note;\n" "$p2"
	printf "\n"
	printf "		-- activate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"$POINTERDIR\");\n"
	printf "\n"
	printf "		-- move mouse to positon\n"
	printf "		control_mouse(x, y, mouse_match, mouse_event, mouse_x, mouse_y, mouse_dx, mouse_dy);\n"
	printf "\n"
	printf "		-- deactivate mouse detection\n"
	printf "		send_string(mouse_pointerdir, \"\");\n"
	printf "\n"
	printf "		-- double click mouse\n"
	printf "		mouse_button1 <= true;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "		mouse_button1 <= false;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "		mouse_button1 <= true;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "		mouse_button1 <= false;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "floppy_insert" ] ; then
	#
	# floppy_insert	<character sequence>
	#
	if [ -f $p2 ] ; then
		img=$p2
		# FIXME currently, faum-gen-vhdl is called before the
		# link exists... cannot check for file presence.
		fixed_img=$(echo "$p2" | sed -e "s/[^a-zA-Z0-9]//g");
	else
		echo "$p2: Not found."
		exit 1
	fi
	printf "\n"
	printf "		-- floppy_insert %s\n" $fixed_img
	printf "		ASSERT false REPORT \"Insert floppy %s\" SEVERITY note;\n" "$fixed_img"
	printf "		send_string(floppy, \"%s\");\n" $fixed_img
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "floppy_remove" ] ; then
	#
	# floppy_remove
	#
	printf "\n"
	printf "		-- floppy_remove\n"
	printf "		ASSERT false REPORT \"Remove floppy\" SEVERITY note;\n"
	printf "		send_string(floppy, "'"");\n'
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "cdrom_insert" ] ; then
	#
	# cdrom_insert	<character sequence>
	#
	
	if [ -f $p2 ] ; then
		img=$p2
		# FIXME currently, faum-gen-vhdl is called before the
		# link exists... cannot check for file presence.
		fixed_img=$(echo "$p2" | sed -e "s/[^a-zA-Z0-9]//g");
	else
		echo "$p2: Not found."
		exit 1
	fi
	printf "\n"
	printf "		-- cdrom_insert %s\n" $fixed_img
	printf "		ASSERT false REPORT \"Insert CD/DVD %s\" SEVERITY note;\n" "$fixed_img"
	printf "		send_string(cdrom, \"%s\");\n" $fixed_img
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "cdrom_remove" ] ; then
	#
	# cdrom_remove
	#
	printf "\n"
	printf "		-- cdrom_remove\n"
	printf "		ASSERT false REPORT \"Remove CD/DVD\" SEVERITY note;\n"
	printf "		send_string(cdrom, "'"");\n'
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "image_show" ] ; then
	#
	# image_show	<character sequence>
	#
	
	if [ -f $p2 ] ; then
		img=$p2
		# FIXME currently, faum-gen-vhdl is called before the
		# link exists... cannot check for file presence.
		fixed_img=$(echo "$p2" | sed -e "s/[^a-zA-Z0-9]//g");
	else
		echo "$p2: Not found."
		exit 1
	fi
	printf "\n"
	printf "		-- image_show %s\n" $fixed_img
	printf "		send_string(image, \"%s\");\n" $fixed_img
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "image_hide" ] ; then
	#
	# image_hide
	#
	printf "\n"
	printf "		-- image_hide\n"
	printf "		send_string(image, "'"");\n'
	printf "		wait for 1000 ms;\n"
	printf "\n"

elif [ "$p1" = "sshot" ]; then
	#
	# sshot
	#
	printf "\n"
	printf "		-- take a screenshot\n"
	printf "		screen_shot <= true;\n"
	printf "		WAIT FOR 1000 ms;\n"
	printf "		screen_shot <= false;\n"
	printf "		ASSERT false REPORT \"screenshot taken.\" SEVERITY note;\n"
	printf "\n"

elif [ "$p1" = "log" ]; then
	#
	# log		<character sequence>
	#
	printf "\n"
	printf "		ASSERT false REPORT \"%s\" SEVERITY note;\n" "$p2"
	printf "\n"

elif [ "$p1" = "start_recording" ]; then
	#
	# start_recording
	#
	printf "\n"
	printf "		-- start recording\n"
	printf "		rec <= true;\n"
	printf "		wait for 1000 ms ;\n"
	printf "		ASSERT false REPORT \"started recording.\" SEVERITY note;\n"
	printf "\n"

elif [ "$p1" = "stop_recording" ]; then
	#
	# stop_recording
	#
	printf "\n"
	printf "		-- stop recording\n"
	printf "		rec <= false;\n"
	printf "		wait for 1000 ms;\n"
	printf "		ASSERT false REPORT \"stopped recording.\" SEVERITY note;\n"
	printf "\n"

elif [ "$p1" = "" ] ; then
	#
	# null command
	#
	# do nothing...
	true

else
	#
	# Illegal command
	#
	echo "$0: $1: Illegal command $p1" 1>&2
	exit 1
fi

done