
/*
 *
 * DDL script  Version 1.0  04APR84
 *
 */
/*
 * TNIX/UNIX Version
 * Keyshell Version Number 2
 */

#ifdef _TNIX
main 
#else
ddl
#endif
{
	>
	>\ksetup\e - Commands which may be used to set up the DDL system:
	>              \kget mnem\e, \kdisp form\e, \kget setup\e, \kput setup\e, \kshow conf\e.
	>
	>\kDDL cntrl\e - Commands controlling DDL:
	>              \kstart DDL\e, \kupload\e, \kdisplay\e, \kstate tbl\e, \ktiming\e, \kscroll\e.
	>
	>\kDAS cntrl\e - Commands controlling the DAS:
	>              \ksave acq\e, \kdispl acq\e, \kstate tbl\e, \ktiming\e, \kscroll\e.
	>
	>\kdiags\e - Invoke DDL system diagnostics.
	>
	>\ksend cmd\e - Send a command string to the DAS.
	>
	msg (^Digital Design Lab - Top Level);
	f1;setup; {
		>
		>For DDL time-correlation operations, you must set up the system
		>     (TTA, DAS and emulator) for DDL operations.  Press \kmore-info\e
		>     for details.
		>\kget mnem\e - Upload mnemonic and setup information from DAS;
		>              build and store disassembly symbol tables;
		>              put menmonic information into file \uDASmnem\n.
		>
		>\kdisp form\e - Specify format of the DDL \uddisp\n display;
		>              place format information into file \uDASdform\n.
		>
		>\kget setup\e - Transfer a DAS setup packet from the DAS to a file.
		>
		>\kput setup\e - Transfer a DAS setup packet from a file to the DAS.
		>
		>\kshow conf\e - Display current DAS card configuration.
		>
		msg (^DDL setup);
		f1;get mnem; cmd (^mktab), exec;
		f2;disp form; {
			msg (^Please don't push any soft-keys now), cmd (^dform -v), exec, msg, next;
			f1;dont push; ;
			f2;dont push; ;
			f3;dont push; ;
			f4;dont push; ;
			f5;dont push; ;
			f6;dont push; ;
			f7;dont push; ;
			f8;dont push; ;
		};
		f3;get setup; {
			>
			>\kall\e - Get setup information for all DAS menus and the contents
			>              of reference memory.
			>
			>\kacqsetup\e - Get the setup information describing the \uChannel Specification\n,
			>              \uTrigger Specification\n, and \uTiming Diagram\n menus.
			>
			>\krefmem\e - Get the \uState Table\n menu setup and the contents
			>              of the reference memory.
			>
			>\kpatgen\e - Get the \uPattern Generator\n menu setup information.
			>
			>\kmnemonics\e - Get the \uDefine Mnemonics\n menu setup.
			cmd (^getpac ), msg (^Get what type of information?%%), next;
			f1;all; cmd (all );
			f2;acqsetup; cmd (acqsetup );
			f3;refmem; cmd (refmem );
			f4;patgen; cmd (patgen );
			f5;mnemonics; cmd (mnemonics );
			f6;; ;
			f7;manual; man (getpac);
			f8;done; cmd, msg, break;
		}, {
			>
			>Enter the name of the file to receive the setup packet.
			>
			>\klistfiles\e - List the files in the current directory.
			msg (^Put into which file? %p), exec, msg, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;listfiles; call, cmd (^ls), exec, return, break (0);
			f7;manual; man (getpac);
			f8;done; cmd, msg, break;
		};
		f4;put setup; {
			>
			>\kall\e - Send setup information for all DAS menus and the contents
			>              of reference memory.
			>
			>\kacqsetup\e - Send the setup information describing the \uChannel Specification\n,
			>              \uTrigger Specification\n, and \uTiming Diagram\n menus.
			>
			>\krefmem\e - Send the \uState Table\n menu setup and the contents
			>              of the reference memory.
			>
			>\kpatgen\e - Send the \uPattern Generator\n menu setup information.
			>
			>\kmnemonics\e - Send the \uDefine Mnemonics\n menu setup.
			cmd (^putpac ), msg (^Send what type of information?%%), next;
			f1;all; cmd (all );
			f2;acqsetup; cmd (acqsetup );
			f3;refmem; cmd (refmem );
			f4;patgen; cmd (patgen );
			f5;mnemonics; cmd (mnemonics );
			f6;; ;
			f7;manual; man (putpac);
			f8;done; cmd, msg, break;
		}, {
			>
			>Enter the name of the file that contains the setup packet
			>
			>\klistfiles\e - List files in current directory
			msg (^Get from which file? %p), exec, msg, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;listfiles; call, cmd (^ls), exec, return, break (0);
			f7;manual; man (putpac);
			f8;done; cmd, msg, break;
		};
		f5;show conf; cmd (^showcon), exec;
		f6;; ;
		f7;more-info; {
			>
			>To set up the emulator for DDL operations, use \kdebug\e - \kconfigure\e
			>     path from the ColorKey+ top level.
			>
			>To set up the TTA, use \kdebug\e - \ktta debug\e path from the ColorKey+
			>     top level.  For a summary of TTA setup restrictions, press \kmore-info\e.
			>
			>To set up the DAS, restore setups via DAS tape, transfer setups
			>     (previously saved in a file) from the file to the DAS using 
			>     \kput setup\e or setup DAS directly via DAS keyboard.  Required 
			>     DAS setup configuration is described in DDL manual. 
			>
			>The I/O port which communicates with the DAS must be specially
			>     configured for DDL use.  See DDL manual for details.
			>
			sly (shiftkey 4), msg (^Press "more-info" or "done"%%), next;
			f1;; ;
			f2;; ;
			f3;; ;
			f4;; ;
			f5;; ;
			f6;; ;
			f7;more-info; next;
			f8;done; break;
		}, {	
			>
			>Summary of DDL setup restrictions:
			>
			>1.     DAS must acquire data at the same rate as, or faster than the 
			>       TTA. DAS must also be setup such that it triggers when a 
			>       0XXXXXXX is received from the State Stamp Probe.
			>
			>2.     TTA must be programmed with a trigger event.  State Stamp
			>       Probe \uTRIG\n cable should be connected to the BNC output
			>       connector for the TTA channel programmed with the trigger event.
			>
			>3.     TTA data qualification specifications, if any, must appear
			>       in TTA channel 4.  If data qualification is done, TTA
			>       trigger event must coincide with an acquisition event.
			>
			>4.     Emulator breakpoint must be set up such that adequate time
			>       is permitted for TTA and DAS to acquire trigger signal from
			>       State Stamp Probe.  See DDL manual for details.
			sly (shiftkey 4), break;
		};
		f8;done; cmd, msg, break;
	};
	f2;DDL cntrl; {
		>
		>\kstart DDL\e - Start DDL data acquisition:
		>              create file \uTTAstart\n, providing initial TTA state information;
		>              start emulator;  start DAS and TTA acquisition.
		>
		>\kupload\e - Upload DAS and TTA acquisition data; create files
		>              \uDASconfig\n, containing the DAS card configuration information
		>              \uTTAdata\n, containing the uploaded TTA acquisition data
		>              \uTTAtrig\n, containing the TTA's state after data acquisition
		>              \uDASaq.xx.sp\n, containing DAS acquisition data for pod \up\n
		>                           of acquisitiom module type \uxx\n, located in slot \us\n.
		>
		>\kdisplay\e - Time-correlate and display DAS and TTA acquisition data.
		>
		>\kstate tbl\e - Display state table on the DAS.
		>
		>\ktiming\e - Display timing diagram on the DAS.
		>
		>\kscroll\e - Move DAS display cursor.
		msg (^DDL control);
		f1;start DDL; {
			>
			>\kcurrent\e - Start the emulator at the current address.
			cmd (^dstart ), msg (^Start emulator at address: %P), next;
			f1;current; next;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (dstart);
			f8;done; cmd, msg, break;
		}, {
			>
			>\kYes\e - Start DAS pattern generation as well as data acquisition.
			>
			>\kNo\e - Start only DAS data acquisition.
			msg (^Start pattern generation also?%%), exec, next;
			f1;Yes; cmd (-p );
			f2;No; exec, next;
			f3;; ;
			f4;; ;
			f5;; ;
			f6;; ;
			f7;manual; man (dstart);
			f8;done; cmd, msg, break;
		};
		f2;upload; cmd (^duplod), exec;
		f3;display; {
			>
			>\kYes\e - Show uncorrelated data in addition to correlated data.
			>
			>\kNo\e - Show correlated data only.
			cmd (^ddisp ), msg (^Show uncorrelated data also?%%), next;
			f1;Yes; cmd (-u), exec, next;
			f2;No;  exec, next;
			f3;; ;
			f4;; ;
			f5;; ;
			f6;; ;
			f7;manual; man (ddisp);
			f8;done; cmd, msg, break;
		};
		f4;state tbl; {
			>
			>Specify the sequence number at which the cursor is to be placed.
			cmd (^scur ), msg (^Place cursor where? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (scur);
			f8;done; cmd, msg, break;
		};
		f5;timing; {
			>
			>Specify the sequence number at which the cursor is to be placed.
			cmd (^tcur ), msg (^Place cursor where? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (tcur);
			f8;done; cmd, msg, break;
		};
		f6;scroll; {
			>
			>Specify the number of cursor positions you want to scroll;
			>              positive numbers scroll to the \uright\n in a timing diagram,
			>              or \uup\n in a state table
			>              negative numbers scroll to the \uleft\n in a timing diagram,
			>              or \udown\n in a state table.
			cmd (^scrol ), msg (^How many positions? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (scrol);
			f8;done; cmd, msg, break;
		};
		f7;; ;
		f8;done; cmd, msg, break;
	};
	f3;DAS cntrl; {
		>
		>\ksave acq\e - Save the selected DAS acquisition memory in a file.
		>
		>\kdispl acq\e - Display DAS acquisition data contained in a file.
		>
		>\kstate tbl\e - Change DAS display to state table.
		>
		>\ktiming\e - Change DAS display to timing diagram.
		>
		>\kscroll\e - Move cursor through the display on the DAS.
		>
		>\ksend cmd\e - Send a command string to the DAS.
		>
		msg (^DAS cntrl);
		f1;save acq; {
			>
			>Enter the DAS card slot containing the desired acquisition module.
			>
			>\kF1-F5\e - Previously selected parameters.
			>
			>\kshow conf\e - Display current DAS card configuration.
			cmd (^getacq ), msg (^Which slot of the DAS contains the module to be read? %p), next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;show conf; call, cmd (^showcon), exec, return, break (0);
			f7;manual; man (getacq);
			f8;done; cmd, msg, break;
		}, {
			>
			>Specify the desired acquisition memory.  Valid options are:
			>              \ka\e, \kb\e, \kc\e, or \kd\e on the 91A32 module
			>              \ka\e, \kb\e, or \kc\e on the 91A24 module
			>              \kregular\e or \kglitch\e on the 91A08 module.
			msg (^Which acquisition memory?%%), next;
			f1;a; cmd (a );
			f2;b; cmd (b );
			f3;c; cmd (c );
			f4;d; cmd (d );
			f5;regular; cmd (reg );
			f6;glitch; cmd (glitch );
			f7;manual; man (getacq);
			f8;done; cmd, msg, break;
		}, {
			>
			>Specify the name of the file to receive the data
			>\kdefault\e - File name is \uDASacq.xx.sp\n, where
			>              \uxx\n is 32 for a 91A32 module, 24 for a 91A24 module
			>              or 08 for a 91A08 module
			>              \us\n is the slot number, and \up\n is the pod name.
			msg (^Enter the name of the data file: %p), exec, next;
			f1;default; exec, next;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;listfiles; call, cmd (^ls), exec, return, break (0);
			f7;manual; man (getacq);
			f8;done; cmd, msg, break;
		};
		f2;displ acq; {
			>
			>Display the contents of an acquisition file.
			>
			>\khex\e - Hexadecimal output format.
			>
			>\koctal\e - Octal output format.
			>
			>\kdecimal\e - Decimal output format.
			>
			>\kASCII\e - ASCII output format, a non-printing character is displayed
			>              as a backslash (\\) followed by its hexadecimal value.
			cmd (^showaf ), msg (^Which output format? %%), next;
			f1;hex; cmd (-x );
			f2;octal; cmd (-o );
			f3;decimal; cmd (-d );
			f4;ASCII; cmd (-a );
			f5;; ;
			f6;; ;
			f7;manual; man (showaf);
			f8;done; cmd, msg, break;
		}, {
			>
			>Specify the name of the file to be read.
			msg (^Enter the name of the data file: %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;listfiles; call, cmd (^ls), exec, return, break(0);
			f7;manual; man (showaf);
			f8;done; cmd, msg, break;
		};
			>
		f3;state tbl; {
			>Specify the sequence number at which the cursor is to be placed.
			cmd (^scur ), msg (^Place cursor where? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (scur) ;
			f8;done; cmd, msg, break;
		};
		f4;timing; {
			>
			>Specify the sequence number at which the cursor is to be placed.
			cmd (^tcur ), msg (^Place cursor where? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (tcur);
			f8;done; cmd, msg, break;
		};
		f5;scroll; {
			>
			>Specify the number of cursor positions you want to scroll;
			>              positive numbers scroll to the \uright\n in a timing diagram,
			>              or \uup\n in a state table
			>              negative numbers scroll to the \uleft\n in a timing diagram,
			>              or \udown\n in a state table.
			cmd (^scrol ), msg (^How many positions? %p), exec, next;
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (scrol);
			f8;done; cmd, msg, break;
		};
		f6;; ;
		f7;send cmd; {
			>
			>\kchan spec\e - Tell DAS to display its Channel Specification menu.
			>
			>\ktrig spec\e - Tell DAS to display its Trigger Specification menu.
			>
			>\kI/O\e - Tell DAS to display its Input Output menu.
			>
			>\kmnemonics\e - Tell DAS to display its Define Mnemonics menu.
			>
			>\kstate\e - Tell DAS to display its State Table menu.
			>
			>\ktiming\e - Tell DAS to display its Timing Diagram menu.
			>
			>\kother\e - Allows sending any other command to the DAS.
			cmd (^sendd "), msg (^Send a command to the DAS%%), cmd ("), exec, break;
			f1;chan spec; cmd (channel);
			f2;trig spec; cmd (trigger);
			f3;I/O; cmd (IO);
			f4;mnemonics; cmd (define);
			f5;state; cmd (state);
			f6;timing; cmd (timing);
			f7;other; {
				>
				>Examples:
				>\uScroll up\n    - Scroll DAS display up.
				>\uScroll down\n  - Scroll DAS display down.
				>\uScroll right\n - Scroll DAS display right.
				>\uScroll left\n  - Scroll DAS display left.
				>\uNext\n         - Move DAS cursor to next display field.
				>\uLeft\n         - Move DAS cursor left one position.
				>\uRight\n        - Move DAS cursor right one position.
				>\uUp\n           - Move DAS cursor up one position.
				>\uDown\n         - Move DAS cursor down one position.
				>\uStart Sys\n    - Start DAS data acquisition and pattern generation.
				>\uStart Acq\n    - Start DAS data acquisition only.
				>\uStop\n         - Stop DAS data acquisition and/or pattern generation.
				>
				>Other permissible DAS commands are documented in GPIB section of
				>DAS9100 Operator's Manual.
				cmd (^sendd "), msg (^enter DAS command string: %p), cmd ("), exec, break (2);
				f1;; hist;
				f2;; hist;
				f3;; hist;
				f4;; hist;
				f5;; hist;
				f6;; hist;
				f7;manual; man (sendd), break (0);
				f8;done; cmd, msg, break (2);
			};
			f8;done; cmd, msg, break;
		};
		f8;done; cmd, msg, break;
	};
	f4;diags; {
		>
		>\kYes\e - Specifies the TTA trigger test mode.
		>
		>\kNo\e - Specifies normal run mode.
		cmd (^ddiag ), msg (^TTA trigger test mode?%%), next;
		f1;Yes; cmd (-t );
		f2;No; next;
		f3;; ;
		f4;; ;
		f5;; ;
		f6;; ;
		f7;manual; man (ddiag);
		f8;done; cmd, msg, break;
	}, {
		>
		>Specify the DAS card slot containing the acquisition module to which the
		>State Stamp Probe is connected.
		>
		>\kshow conf\e - Display current DAS card configuration.
		msg (^Which slot of the DAS is the State Stamp Probe connected to?%%), next;
		f1;1; cmd (1);
		f2;2; cmd (2);
		f3;3; cmd (3);
		f4;4; cmd (4);
		f5;5; cmd (5);
		f6;6; cmd (6);
		f7;show conf; call, cmd (^showcon), exec, return, break (0);
		f8;done; cmd, msg, break;
	}, {
		>
		>Specify the pod to which the State Stamp Probe is connected.
		msg (^Which pod is the State Stamp Probe connected to?%%), exec, next;
		f1;a; cmd (a);
		f2;b; cmd (b);
		f3;c; cmd (c);
		f4;d; cmd (d);
		f5;; ;
		f6;; ;
		f7;; ;
		f8;done; cmd, msg, break;
	};
	f5;; ;
	f6;; ;
	f7;send cmd; {
		>
		>\kchan spec\e - Tell DAS to display its Channel Specification menu.
		>
		>\ktrig spec\e - Tell DAS to display its Trigger Specification menu.
		>
		>\kI/O\e - Tell DAS to display its Input Output menu.
		>
		>\kmnemonics\e - Tell DAS to display its Define Mnemonics menu.
		>
		>\kstate\e - Tell DAS to display its State Table menu.
		>
		>\ktiming\e - Tell DAS to display its Timing Diagram menu.
		>
		>\kother\e - Allows sending any other command to the DAS.
		cmd (^sendd "), msg (^Send a command to the DAS%%), cmd ("), exec, break;
		f1;chan spec; cmd (channel);
		f2;trig spec; cmd (trigger);
		f3;I/O; cmd (IO);
		f4;mnemonics; cmd (define);
		f5;state; cmd (state);
		f6;timing; cmd (timing);
		f7;other; {
			>
			>Examples:
			>\uScroll up\n    - Scroll DAS display up.
			>\uScroll down\n  - Scroll DAS display down.
			>\uScroll right\n - Scroll DAS display right.
			>\uScroll left\n  - Scroll DAS display left.
			>\uNext\n         - Move DAS cursor to next display field.
			>\uLeft\n         - Move DAS cursor left one position.
			>\uRight\n        - Move DAS cursor right one position.
			>\uUp\n           - Move DAS cursor up one position.
			>\uDown\n         - Move DAS cursor down one position.
			>\uStart Sys\n    - Start DAS data acquisition and pattern generation.
			>\uStart Acq\n    - Start DAS data acquisition only.
			>\uStop\n         - Stop DAS data acquisition and/or pattern generation.
			>
			>Other permissible DAS commands are documented in GPIB section of
			>DAS9100 Operator's Manual.
			cmd (^sendd "), msg (^enter DAS command string: %p), cmd ("), exec, break (2);
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man (sendd), break (0);
			f8;done; cmd, msg, break (2);
		};
		f8;done; cmd, msg, break;
	};
#ifdef _TNIX
	f8;done; {
		cmd, msg (^Returning to Debug top level.),
		sly (history off),
		sly (newexp keynotes _kdir/dbug.n),
		sly (unsave _kdir/dbug.s),
		break;
	};
#else
	f8;done; cmd, msg , break;
#endif
}
