Waveform Generation Program Description ----------------------------------------------- Rev. 12-OCT-1991 This file describes the program that translates a Timing Specification file of Master Timing Generators waveforms into the binary file required to program the PROM's for the MTG's. Inputs: ------- There is one input file called the Timing Specification File. This is an ASCII file. Outputs: -------- There are two output files. One is the "chart" file. This is an ASCII file that shows the timing pattern in the form of a primative timing chart. The second file is the binary file which may be transfered via Kermit to the IBM-PC PROM programmer (VARIX or Sprint Plus). Rules and Syntax of the Input Timing Specification File: -------------------------------------------------------- 1. The Timing Specification file uses the ASCII format. 2. The Timing Specification file is organized as records. No record can be more than 255 characters long. 3. The Timing Specification file is organized into three sections: the header, the data section, and the trailer. 4. The data section must begin with the characters "Beginning_of_Data_Section" on a line by themselves and the data section must end with the characters "End_of_Data_Section" on a line by themselves. 5. The Timing Specification file starts with a header area. This may be any number of lines (records) long and may contain any desired information. Typicaly it will contain information which identifies the file (e.g. the date, description of the timing signal, list of modifications). 6. The Timing Specification file trailer section, like the header, may be any number of lines long and it may contain any information that is useful in identifying and understand the Timing Specification file. 7. The Timing Specification file data section is the part of the file that specifies the timing waveforms that are to be generated. Syntax and Rules for the data section of a Timing Specification file: --------------------------------------------------------------------- 1. All information in the data section of a Timing Specification file is in decimal format. 2. Any blank lines in the data section will be ignored. 3. Any comment lines in the data section must begin with one of the three following characters: "!" ";" "*" . When one of these three characters is found in a line then all text to the right of this character is assumed to be part of the comment. 4. There are 2048 time cells that may be described in a timing specification file. These are numbered 0 through 2047. 5. The numeric index number of a time cell (e.g. time cell #17) identifies both the edge between the previous cell and the current cell (e.g. action taken at the edge between time cells #16 and #17), and the duration of the current cell (e.g. the state during time cell #17). 6. The numeric index number of a time cell is specified by upto 4 decimal digits with no comma. In this document the character string "wxyz" will be used to indicate the numeric index number of a time cell. 7. The 32 channels of a Master Timing Generator are identified as Ch #1 through Ch #32. The # character is required. Note that this program treats the set of channels [1...8] the same as the sets [9...16], or [17...24], or [25...32]. In this document the character string "pq" will be used to indicate a Master Timing Generator channel number. 8. All data for all time cells for all channels is initialized to logic LOW and it will remain that way unless specified otherwise in the data section of a timing specification file. 9. All data for a given MTG channel must be written in the data section in the chronologic order in which the MTG will generate the waveform. That is an action that will happen early in a wave form must be specified in the data section before an action that will happen later. 10. The last action or state that is specified for a channel is assumed to continue from the time cell specified through the last time cell (i.e. through time cell #2047). 11. The two key words that are used to specify the waveform of a given channel are "up_at" and "down_at". These are used in the phrases: Channel #pq, up_at wxyz, and Channel #pq, down_at wxyz, The specification of only a single channel may appear on a given line. The channel number is specificed only once at the beginning of the line. All Up_At and Down_At phrases following the channel specification are assumed to involve the specified channel. The comma is required at the end of all but the last phrase. Any number of phrases may appear on a given line in the data section (upto 255 characters). A comment may follow the last Up_At or Down_At phrase. If there is a comment it must begin with a comment indicator (i.e. !;*) Example usage: Channel #17, Up_At 234, Down_At 255 ! Pulse on MTG Channel 17. 12. Once a series of transistions have been described for an MTG channel (by using "up_at" and "down_at" phrases) this series of transistions may be repeated in later time cells by using a key word "repeat" phrase. An MTG channel that is going to have a series of transistions repeated needs its own separate "repeat" phrase e.g. repeat Channel #pq, starting_with wxyz through wxyz copied_to wxyz Only one "repeat" phrase may be on a line. No other phrases may appear on the same line as a "repeat" phrase. A comment may follow the Repeat phrase. If there is a comment it must begin with a comment indicator (i.e. !;*). Program design and layout: -------------------------- 1. All symbols that must be shared between modules are kept in a common section. This common section is put in each program module that needs it with an Include statement. 2. The basic working array for building the MTG waveforms is the Pulse_Array (this is an Integer*2 array which is 8 wide by 2048 long). 3. This program has two formats for the output display of program status and execution messages. The "Full" format gives complete details of the program execution and shows the lines of the Timing Specification files as they are read. The "Short" format gives brief messages to show the various stages of program execution. In either case full format error messages are displayed. 4. This program makes many tests of the data read from the Timing Specification file before it is used to make PROM data. The MTG Channel number and the timing cell numbers must be valid. In a repeat phrase the relative size of the "starting_with", "through", and the "copied_to" timing cells are tested to verify that it is a valid combination (i.e. "starting_with" < "through" < "copied_to"). 5. Program layout Main_line call the announce the program routine call the initialize variables routine call the get_timing_specification_file routine If there is a null timing specification filename then exit else open the timing specification file and read and display the timing specification file header section; return when the beginning of the data section is found. call the process_data_section read each record and look for either: blank line, comment only line, up_down_at line, repeat line, the end of the data section marker record or else a record that violates the timing_specification file format. call the appropreate routines: call the process_up_down_at record process the up_down_at record call the process repeat record process the repeat record return when the end of data section marker is found. call the trailer section routine read and display the timing specification trailer section then close the timing specification file and return. call the output binary file routine. If filename of binary output file is null then return Else open and write the binary output file, close the file, return announce normal exit exit 6. Naming convintions All names are of the form: waveform...ext