AUTOMATIC SEMICONDUCTOR SURFACE INSPECTION APPARATUS AND METHOD

Abstract: An apparatus and method for the automatic inspection of a semiconductor wafer surface employs dark field illumination (12) for illuminating a wafer surface (20) to detect the material edges thereon. The surface (20) is scanned (30, 52) and an edge analysis (14) is performed for automatically determining material edge boundaries from the reflected energy spatial distribution. The edge boundaries are compared (126) with a reference pattern (120) and further analysis (128) determines the location of boundary disagreements between the material boundaries and the reference pattern. A report (130) is generated which can include for example, reticle cleaning or replacement information, defect locations, and defect classification including "killer defects".

Description: AUTOMATIC SEMICONDUCTOR SURFACE INSPECTION APPARATUS AND METHOD Background of the Invention The invention relates generally to the 5 inspection of semiconductor wafers during manufacture, s and in particular to a method and apparatus for the automatic inspection of semiconductor wafers during • manufacture to determine the quality of the post-development photoresist and post-etch material 0 structure. Very Large Scale Integration (VLSI) technology and the immense packing density of the products resulting therefrom have, in recent years, required significant time to perform even small inspections of 5 the semiconductor wafer as it is being processed. Such inspection typically requires a method for finding defects such as relatively small feature distortions and small size particulate contaminates. The defects to be identified during semiconductor manufacture generally come from either the photolithographic process employed during manufacture or the properties of the photoresist with which the photolithographic process interacts. For example, the mask through which the semiconductor is exposed can have acquired a defect during handling or the photoresist can develop in a non-uniform manner thereby causing a defect to occur on the semiconductor surface. Other defects can occur due to particulate contaminates such as dirt particles which "land" on the semiconductor wafer surface during processing. Contaminates may also result a from a "dirty" developer photoresist. These defects and contaminates, very small features in a relatively large inspection area, are important because they identify or help to correct potential problems prior to the completion of the manufacturing process. This early identification enables individual wafers containing critical defects to be disposed of at a stage prior to the completion of the manufacturing process. In addition, such information can be employed for monitoring the various stages of the fabrication process and can significantly affect the yield of the production line and hence the cost of manufacture. For example, early detection of a defect may allow the wafer to be reworked and the defect corrected. Presently, inspection is performed either manually on selected semiconductor wafers or by machine. The manual or machine inspection processes often make decisions based only upon the relative feature differences between repeating patterns on the wafer surface. An object of the invention is therefore an automatic inspection method and apparatus for semiconductor wafers which reliably and automatically identify sub-micron defects on the surface of the semiconductor element during manufacture. Other objects of the invention are a method and apparatus for the automatic inspection of semiconductor surfaces which detect both distortions or anomolies in the geometry on the surface as well as the presence of particulate contaminates. A further object of the invention is a method and apparatus for the automatic inspection of wafer surfaces which operate in real time and which reduce the manufacturing cost of the fabrication process. Summary of the Invention The invention relates to a method and 5 apparatus for the automatic inspection of a semiconductor wafer surface. The apparatus features an illumination system for illuminating the wafer surface to be inspected. Preferably, the illumination system employs dark field illumination for highlighting the 10 material edges of the surface. A scanning system is provided for forming in a storage array a representation of the spatial distribution of illumination energy reflected from the surface. This spatial distribution represents, when dark field illumination is employed, 15 the material edges of the wafer which has been illuminated. In a preferred embodiment of the invention the scanning system moves the wafer for scanning the inspection area'while maintaining the optical illumination and receptor system stationary. 20 An edge analysis circuit automatically analyzes the reflected energy spatial distribution, which is represented in the array, for determining edge boundaries occurring on the wafer surface. A comparison circuit then compares the located edge boundaries (found 25 by the analysis circuit) with a reference pattern which describes the expected geometrical layout of the wafer surface. The comparison circuit then determines the location of boundary disagreements between the analysis circuit edge boundaries and the reference pattern 30 description. The boundary disagreements are then output, for example visually shown on a display, whereby the equipment user can personally view the defects. In other aspects, the invention features a circuit employing an edge threshold level to discriminate between potential edge boundaries of different intensities, that is, to discriminate signal from noise. Thresholding acts as an amplitude filter. In addition, the boundaries are preferably spatially filtered (as described hereinafter) to form a more continuous edge pattern. In the preferred embodiment, the apparatus further features a circuit for classifying the boundary disagreements and in particular for providing a class for "killer defects", that is, defects which prevent proper operation of a completed semiconductor circuit. The apparatus further features circuitry for automatically determining, for a wafer having a repeating reticle pattern thereon (that is, a pattern formed using a reticle and which repeats on the wafer surface) , whether a defect in the reticle has occurred and therefore whether the reticle should be cleaned or replaced. Furthermore, the apparatus provides circuitry for automatically repositioning the wafer surface for visual inspection of the surface at a selected boundary. In addition, circuitry is preferably provided to enable a more tolerant thereshold to be applied to matching edge corners on the wafer surface to the reference pattern. In another aspect, the invention relates to a method for the automatic inspection of a semiconductor wafer surface. The method features the steps of illuminating the wafer surface to be inspected, preferably employing dark field illumination for highlighting the edges of the surface. The method further features forming, in a storage array, a representation of the spatial distribution of illumination energy reflected from the surface; automatically analyzing the reflected energy spatial distribution for determining edge boundaries occurring on the wafer surface; comparing the edge boundaries found by the analysis step with a reference pattern description which describes the expected geometrical layout of the wafer surface; and then determining the location of boundary disagreements between the analysis edge boundaries and the reference pattern description. The boundary disagreements are then output, for example shown on a display, whereby the equipment user can view the defects. In other aspects, the method features locating potential edge. boundaries on the wafer using local differences in reflection values and then employing a threshold level to determine which edge boundaries are to be maintained and stored. The illustrated method also features spatially filtering the edge boundaries to form a more continuous edge pattern. In the preferred embodiment of the invention, the method features classifying the various boundary disagreements, and in particular provides for a class for "killer defects", that is, defects which prevent proper operation of the semiconductor circuit. The method further features, in the illustrated embodiment, automatically determining, for a wafer surface having a repeating reticle pattern thereon, whether a defect in the reticle has occurred and therefore whether the reticle should be cleaned or replaced. Furthermore, the illustrated method provides for automatic repositioning the wafer surface for visual inspection at a selected boundary and for providing a more tolerant threshold to be applied to matching corner edges of the wafer to the 5 reference pattern. Brief'Description of the Drawings Other objects, features, and advantages of the invention will appear from the following description taken together with the drawings in which: τ_0 Figure 1 is a schematic representation of the automatic inspection apparatus according to a preferred embodiment of the invention; Figure 2 is a more detailed schematic of the image storage array according to a preferred embodiment τ_5 of the invention; Figure 3 is a diagrammatic representation of the convolution functions employed in connection with a preferred embodiment of the invention; Figure 4 is a flow chart of the edge detection 20 section according to a preferred embodiment of the invention; Figure 5 is a flow chart of the edge pruning section according to a preferred embodiment of the invention; 25 Figure 6 is a flow chart of the edge comparison and report section according to a preferred embodiment of the invention; Figure 7 is a diagrammatic representation of a lessening of tolerance with respect to a corner edge detection; and Figure 8 is a schematic circuit diagram of the automatic detection apparatus according to a preferred embodiment of the invention. Description of a Preferred Embodiment General Structure Referring to Figure 1, an automatic inspection apparatus 10 has an optical section 12, an image storage array 13, an image processing and analysis section 14, and a display section 16. In general operation, a semiconductor wafer 18 having a surface 20 to be inspected is mounted in a stable jig structure 22. The wafer surface is illuminated by the optical section 12. In particular, the preferred embodiment employs a 360° dark field presentation to highlight the edge structure present on the semiconductor surface. (In many applications bright field illumination can also be employed. ) Reflected light is directed through the central image forming optics 26 of a microscope 27 (for example a Leitz Ergolus), and is focused on a photosensitive sensor 28 which may be for example a Fairchild Model CCD-133 having a 1024 x 1 linear element arrangement. The wafer surface is moved, by a step and repeat mechanism 30 attached to jig 22, in a direction transverse to the length of the optical array. Thereby, the image of the wafer surface scans across the sensor 28. The output of optical sensor 28 is stored in the storage array 13. The image processing and analysis circuitry 14 accesses the stored data of array 13 and processes the data to locate edge boundaries on the semiconductor wafer surface. These edge boundaries may be photoresist edge conductors, or other material edges on the semiconductor surface. Circuitry 14 can be implemented in either hardware, software, or a combination of the two. When a software implemention is employed, illustrated circuitry 14 is implemented using a general purpose digital computer, such as a Digital Equipment Corporation Model PDP-11/23 computer. The image processing and analysis section 14 determines the locations of the edge boundaries on the wafer, smoothes and links those boundaries to form a more continuous edge pattern, and compares the edge boundary locations with a reference pattern of the design structure of the wafer surface. Any distortions from or disagreements with the expected pattern are flagged and become potential boundary disagreements. Each of the possible boundary disagreements is preferably classified and a disagreement list results therefrom. The group of boundary disagreements resulting from the analysis of a scanned frame by the image processing and analysis section is displayed, for example on a visual display. The visually presented information can describe the class and location of the defects or can automatically display the actual defects for visual inspection. Background As noted above, the present invention can be employed for monitoring a VLSI semiconductor fabrication. Typically, integrated circuits are fabricated by forming the circuit directly on a silicon crystal substrate. The substrate is typically a circular wafer, having a diameter of between three and six inches, and on each wafer will be fabricated several hundred complete circuits of the same type. Each complete circuit is on a die or chip which is generally rectangular in shape, several millimeters on a side. Following fabrication, the wafer is scribed to obtain the individual die for packaging or integration onto a more complex circuit. Each of the die patterns is typically made by using either a mask or a reticle. The term "mask" is used to denote a patterned target which contains the patterns of all of the die on the wafer. The mask is generally a one-to-one image of the entire wafer and when a wafer is exposed through a mask, the entire wafer is effectively exposed at once. The term "reticle" is generally used to denote a patterned target which contains the pattern of at most a few die on the wafer. In the limit, the reticle may contain the pattern for only one die on the wafer. When using a reticle, the entire wafer is exposed by a step and repeat process. That is, one part of the wafer is exposed; the wafer is then stepped in a known direction; and the exposure is then repeated. By continuing the process, the entire wafer is covered with a repeating pattern. Thus, when exposing with a reticle, and especially a single die reticle, a defect in the reticle affects every group of die on the wafer made with that reticle. Since the VLSI technology is moving the industry away from masks and toward reticles, the inspection of the wafer surface for reticle defects is extremely important. In the illustrated example, the semiconductor wafer 20 is assumed to have thereon a developed photoresist pattern. According to the invention, the photoresist pattern is being automatically inspected for defects such as geometric anomalies. Geometric anomalies occur, for example, as a result of errors or defects on the mask or reticle, particles which settle on or near the mask or reticle during exposure, particles which settle on the wafer during exposure, or development induced defects. In addition, the inspection process is designed to detect and locate dimensional errors, which can occur when the photoresist pattern is geometrically correct but has certain critical dimensions which are out of specification, and particulate contaminates, that is, particles which fall onto a patterned photoresist. In accordance with the invention therefore, the developed photoresist is illuminated, with dark field illumination in this preferred embodiment of the invention, for highlighting the edge information available on the wafer surface, and a digital image of the area to be inspected is acquired. The digital image is processed to generate or derive a description of the area being inspected in terms of the edges in the area. The edge information is presumed to completely define the boundaries of the photoresist and/or particulate contaminates lying thereon. In the case of the photoresist, the edges can be closely spaced to define conductors or can be spaced much further apart to define active areas such as the base or emitter of a transistor. With respect to particulate contaminates, the edges are spaced apart somewhat and form, generally speaking, a relatively ragged closed loop. The Illumination System The illustrated illumination system, as noted above, is a reflective or incident dark field illumination system which directs light energy from a source 40 onto a beam splitter 42 and through a mirrored collar 44 of the microscope 27 and onto the wafer surface 18 at an oblique angle. The incident illumination is then reflected back into and is collected by the microscope optics 26. The illuminated wafer surface image is focused by the microscope objective and subsequent optics 48 (if needed) onto the surface of the optical sensor 28. Because the wafer is opaque, it can only be imaged by light which is reflected from the surface. In dark field illumination, light is directed onto the object at a highly oblique angle through the mirrored collar 44 which surrounds the image forming lens system 26 of the objective. The light energy from source 40 is directed toward beam splitter 46 in an annulus configuration toward the sample semiconductor wafer. An opaque blocking member 50 is employed to prevent energy from being directed into the microscope image forming optics 26. As is well known, the effect of using dark field illumination is to provide a highly specular reflection from an optically smooth, mirror-like surface such as is typical of the polished surface of an unpatterned silicon wafer. However with an optically rough surface, that is, one in which there are material discontinuities, the reflection is diffuse and in that case, reflective rays are scattered in all directions. Some of the reflected energy is captured by the microscope objective and the object appears bright at these areas. Thus, generally speaking, the unpatterned or optically smooth silicon substrate surface appears dark while the photoresist edges and particulate contaminates appear bright. (If bright field illumination had been employed, the silicon substrate would have appeared bright, while the photoresist edges would have appeared dark. Later image processing would proceed accordingly.) o>? Kfr 'y, \,L Semiconductor Scanning As noted above, the dark field image is formed by the microscope optics 26, and further focusing optics 48 if needed, at the image plane of the electro-optical sensor or detector 28. The sensor converts the reflected illumination incident thereon into an electrical signal which is later scaled and quantized into a discrete set of levels. Each level represents a small interval of illumination power and in the illustrated invention the total illumination range has two hundred and fifty-six levels. Sensor 28 is preferably a solid state sensor and in the illustrated embodiments is a linear photoresistive array. An alternate sensor could be a television-type vidicon camera. The linear array approach thus employs a solid state image sensor having a plurality of distinguishable elements arranged in a rectilinear array. In the illustrated embodiment of the invention, the sensor 28 • provides 1,024 distinguishable elements arranged in a straight line linear array. The area of the wafer imaged upon the array (a scan line) is thus spatially quantized into the 1,024 picture elements (pixels). Each pixel in the illustrated embodiment corresponds to 0.5 microns on the wafer surface. The illumination falls onto the array for a preset integration time during which light produced charge is collected in each of the distinguishable elements. At the end of the integration time, the charge accummulated at each element is read out and transduced into a voltage signal. The voltage is then scaled (or amplified) and quantized with the result being a spatial (1,024 elements) and voltage (256 levels) quantization of the line of the image. In order to scan and produce an entire two-dimensional image, relative movement must be provided between the array and the wafer. Either the array must be moved across the stationary image or the image must be moved across the stationary array (a combination of the two could also be employed) . As noted above, in the illustrated embodiment, the image is moved across the array. Thus, a mechanical stage 52 supporting the wafer 18 and jig 22 moves in a direction perpendicular to the array line under the control of a step and repeat mechanism. An alternate approach, which reduces the movement required to produce a two-dimensional image of a selected surface area, is to employ an area array solid state sensor such as the Fairchild Model CCD-221. This sensor has a 488 x 380 element array. No matter how the raw image is acquired, the resulting electrical data signals are stored in memory array 13 for later image processing. Referring to Fig. 2, in the illustrated embodiment of the invention, the storage array 13 has first and second random access memory (RAM) elements 54 and 56, one of which is being filled by the sensor 28 of scanning system while the other memory is being processed by the image processing and analysis section 14. Switches 58 and 60, which control the flow of data into and from elements 54 and 56, are preferably digital gating structures. Image Processing Referring now to the image processing and analysis section, the raw image data stored in memory array 13 represents the image as a two-dimensional matrix of numbers. The "numbers" represent the image intensity across the spatial extent of the wafer surface being scanned. The image processing and analysis circuitry operates upon this raw image data to derive a description of the image in terms of potential edge boundaries (the edge finding procedure). Thereafter the edge boundary data (which identifies potential edge boundaries) is pruned or massaged to eliminate false boundaries and "clean-up" true boundaries (edge boundary pruning) . Finally the edge boundaries are compared against a reference pattern, and defects or disagreement boundaries are recorded (edge boundary comparison). Edge Finding In the illustrated embodiment of the invention, the process of edge finding is implemented using convolution masks (or filters) operating along orthogonal axes. In the illustrated embodiment, these masks align with the horizontal and vertical axes with which most of the edges of the image will also align. Referring to Fig. 3, ideally, a photoresist or other material edge, when illuminated with dark field illumination, produces a bell-shaped light intensity distribution (intensity as a function of distance) in a direction perpendicular to the edge. Thus, if the edge runs parallel to one orthogonal axis, the light distribution profile will be exclusively directed parallel to the other orthogonal axis. An optically rough particle (such as a contaminant) will produce, in response to dark field illumination, a signal waveform (representing light intensity versus distance) , having a rising and a falling edge plus an intermediate region of relatively constant high intensity. To find and distinguish the material edges and the particle edges, two different convolution masks or patterns are employed. A peak finding convolution pattern w is designed to provide a zero crossing when the peak of an intensity distribution is crossed. A typical and preferred peak finding mask w has weighting factors w^ equal to -0.3, -0.1, 0, 0.1, 0.3 (for i = -2, -1, 0, 1, and 2, respectively), so that during the convolution process as defined by equation 1 below, a zero crossing indicates the center of the peak. n 1,- = hi-k w k ( 1) k=-n where 1^ represents a new sequence of numbers created by convolving an original sequence of numbers (h^) with the weighting sequence w^ corresponding to the convolution mask. Thus, to find a horizontal edge, the convolution is performed upon a vertical line of data, and to find a vertical edge, the convolution is performed upon a horizontal line of data. For edges which are neither horizontal or vertical, a combination of the results of the horizontal and vertical peak finding convolution must be considered. It is important at this point to note, however, that the zero crossings resulting from the convolution process only provide the location of a potential edge point. Further processing (edge pruning) is required to determine whether the potential edge point is part of a material edge boundary. The second convolution mask W, a step finding function, provides a data set for finding the edge OMPI ^ Rκlτ boundaries of a particle contaminant. A similar convolution approach is employed; however, the convolution mask is modified to provide a zero crossing where the edge has the appearance of a step with relatively wide pateaus extending from the step in both directions. Thus, the step finding convolution mas ' k is designed to provide zero crossings at the center of an edge bounding a relatively large area or plateau. A typical step finding convolution mask, and the one employed in the illustrated embodiment, uses the weighting sequence W- -.4, -.1, 1, -.1, -.4 (for i = -2, -1, 0, 1, and 2, respectively). The results of using these convolution masks with a photoresist edge structure and a particle contaminate edge structure are illustrated in Figure 3. * Referring to Figure 4, which is a flow chart for that portion of the image processing and analysis section which relates to edge detection, the acquired image represented by block 60 is first spatially smoothed to help eliminate the noise "ripples" inherent in the digitization process of a noisy analog signal. The spatial filter provides low pass filtering which also helps eliminate invalid peaks due to system noise. The spatial filtering, represented by block 62, is applied along each of the orthogonal axes. A Gaussian function could be used, however it is much simpler to approximate the Gaussian by a weighting function having weights: 1/4, 1/2, 1/4. Thus, the value of each picture element intensity is replaced by an average equal to 1/4 of the previous value, plus 1/4 of the succeeding value, plus 1/2 of the present value. The smoothed data resulting from the operation indicated by block 62 is preferably stored in the same memory as the acquired raw image data. Next, assuming that the orthogonal axes are the vertical and horizontal axes, the smoothed image is convolved in both the horizontal and vertical directions with the peak finding and step finding convolution functions respectively. This is indicated at blocks 64, 66, 68, and 70. The reuslt of the respective convolution processes is then searched for possible zero crossings. This is indicated at blocks 72, 74, 76, and 78. For each detected zero crossing, the strength of the crossing, is, for example, set equal to the peak amplitude of the other convolution function for that axis and within a small range of pixels of the zero * crossing. The strengths are stored, as indicated at 80, 82, 84, and 86, preferably in the same storage array which originally stored the raw image data. At this point, the strengths resulting from the step finding convolution are made positive. This is indicated at 88 and 90. Also, the zero crossings for the peak finding convolution result are reviewed by eliminating invalid zero crossings, i.e., those zero crossings representative of noise. These are generally weak zero crossings which do not have associated with them strong related zero crossings. This is represented by blocks 92 and 94 of Figure 4. The edge detection process, by eliminating weak zero crossings of the peak finding convolution, discriminates between noise and potential photoresist edges. The strength measurement discriminator, in the illustrated embodiment, is a threshold value fixed prior to processing and in general depends upon the materials being employed. In other embodiments, the threshold value can be varied dynamically during processing to take account of local variations in both noise and signal strength as a result of the semiconductor fabrication process. The strength measurement for a zero crossing is, in the illustrated embodiment, the maximum value of the step finding convolution output within plus or minus one picture element of where the peak finding convolution output goes through zero. Importantly, the strength of the step finding convolution will not be "confused" with noise since it is not a peak finding element but instead effectively locates inflection points, that is, the position at which the first derivative of the image signal passes through a minimum or maximum. The strengths are coded at 96, 98, 100, and 102 and are stored in coded fashion in the same memory used to first acquire the raw image data. Coding can be accomplished by allocating to each word of the array (one word representing one pixel), preassigned bits representing the vertical and horizontal axes, and the peak finding or step finding strength result. Alternately, the word can be divided to indicate whether the strength stored there is strong or weak, is the result of a step or peak finding convolution, and is for the horizontal or vertical axis. During storage as indicated at block 104, the horizontal and vertical strengths for the peak finding convolutions, and the horizontal and vertical strengths for the step finding convolutions, are summed. This accommodates edge boundaries which are neither horizontal nor vertical but at an angle oblique thereto such as at a 45° angle. The stored and coded zero crossing strengths are then analyzed to detect valid edge boundaries and to discard invalid boundaries. This is referred to as the pruning process and is indicated at block 106 of Figure 4. The Edge Boundary Pruning Referring to Fig. 5, once the coded strength of the convolution edge detection process has been stored (block 108), and prior to forming the edge boundaries, the data must be further analyzed to remove invalid edge points. There is also a need to discriminate between edges representing, for example, a photoresist edge (Block 110) and those which are part of a particle contaminant edge (Block 112) . Thus, in the illustrated embodiment, if there is a peak finding convolution zero crossing within three picture elements of a step finding convolution zero crossing, then the step finding zero crossing is eliminated (Block 112) . This occurs because it is assumed that the step finding zero crossing is erroneous, and it occurred in connection with and in the middle of a relatively wide photoresist area. Similarly, there might occur between two distant step finding convolution zero crossings, a peak finding convolution zero crossing. This can occur for example in the middle of a particle contaminant. In this case, the peak finding convolution zero crossing would be discarded (Block 110) although it is not generally necessary for later processing to do so. As a result of the pruning process therefore all that is left in the storage array 13, are edge boundaries because the discarded zero crossings will have been "zeroed". The edge boundaries which remain however may or may not be complete and continuous. Thus, even though most of an edge boundary may be found, there can further be a gap in the edge boundary which should be * 5 filled in. The gap may occur because the edge point had a small strength. According to the preferred embodiment of the invention, these apparent discontinuities are smoothed and filtered by filling in the gaps between edge boundary points so that the edge is continuous 10 along its boundary. This is indicated at block 116 of Figure 5. Edge Boundary Comparison Referring to Figure 6, the "pruned" edge boundaries are available to a comparison circuit as 15 indicated at block 118. Initially, the "pruned" edge boundaries are aligned with a reference pattern (block 120). The reference pattern is provided from a reference data source such as a computer aided design (CAD) tape which is processed at 122 to provide data to 20 the reference pattern, block 120. The alignment, indicated by block 124, is achieved primarily by "dead reckoning". That is, two relatively long edge boundaries, one parallel to one orthogonal axis and the other parallel to the other orthogonal axis, are 5 selected in the reference pattern and the corresponding edge boundaries are "found" in the pruned edge boundary data memory. This process is practical only because the alignment of " the wafer is known to within a few microns. Thus, the alignment search is carried out over a very 0 small section of the memory and can be performed in a short time. The result of the alignment search is to provide horizontal and vertical offsets between the reference pattern and the stored data. Thereafter, as indicated by block 126, edges in the reference block and the stored data are compared. Corresponding points, that is, points appearing in the same location in both patterns, are eliminated from the storage array 13, and, in the illustrated embodiment, non-corresponding points, that is, points in the reference pattern which do not appear in the storage array are written into the storage array at their appropriate locations. Points in the storage array which do not have a corresponding " point in the reference pattern are kept. As a result, when the matching indicated by block 126 is completed, there results in the storage array 13 a set of disagreement boundaries which define distortions and particle contaminants, if any, on the image surface. The disagreements are examined at block 128; and as a result, the disagreements or defects are classified. One particularly important class of defects or disagreements are those disagreements which materially affect proper operation of the semiconductor circuitry. These defects, if critical, are called "killer defects" and can be determined by defined areas of activity whose location can be provided by the reference pattern 120. Thus, a particle contaminant at a location spaced apart from the operating circuitry of the semiconductor wafer does not normally affect circuit operation whereas a contaminant on the circuit itself may cause the circuit to fail. In either case, a report is compiled, in the illustrated embodiment at block 130, and is provided to the display device 16 of Figure 1. It is important to note, that a defect in one layer of a semiconductor structure can materially affect semiconductor circuit operation on another layer of the structure. Therefore, the "defined areas of activity" provided by reference pattern 120 will relate not only to activity on the layer being formed, but also to the effect of a defect on a subsequently, or previously » 5 formed layer. In the illustrated embodiment of the invention, it is the CAD tape (or other reference . source) which is processed at 122 to provide the multi-layer activity volumes in which a defect can have an adverse effect, and in particular where the defect is 10 properly classified as a "killer defect". In determining the "alignment" at block 124, it has been tacitly assumed that the "pruned" edges align with the horizontal and vertical axes as defined by the analysis process. This may not be the case 5 however. Nevertheless, since the resolution of the system tends to be on the order of one-tenth of a micron per pixel, it has been found satisfactory to provide a plus or minus one picture element deviation in determining the alignment. A similar alignment 0 tolerance has also been provided for determining whether other lines of the reference pattern and the stored detected edge boundaries "correspond" to one another. A major concern which occurs during the comparison process of block 126 relates to the physical 5 processes by which corners are formed during the semiconductor fabrication process. Due to the frequency response of the optical system employed in forming the photoresist corners, and further due to the effects of the chemical process by which the photoresist is layed down and developed, corners generally become rounded so that a truly "squared" edge does not occur. As a result, corners would almost always be "flagged" as a defect absent any provision for loosening the tolerance of the system at the photoresist corner. As a result, referring to Figure 7, a loosening of the tolerance, or a window, is provided at the corner 132 defined by the reference pattern. The tolerance is illustrated by dashed lines 134, which allow the physical phenomena of a rounded corner represented by the dot-dash line 136 to be accommodated without being flagged t defect. Clearly other tolerance windows could be employed although the illustrated window is particularly easy to implement. The illustrated embodiment can also be employed to implement automatic focusing of the optical system, by testing for the "sharpness" of the image at the optical sensor 28. The automatic focusing mechanism adjusts the microscope optics to provide as sharp an image as possible at the image plane of sensor 28. This can be accomplished for example by mounting the microscope illumination system on a jig as indicated by dotted lines 140 (Fig. 1) and moving the jig up or down under the control of a drive mechanism 142. The drive mechanism 142 is controlled by the image processing and analysis section 14. As another feature, the step and repeat mechanism 30 can, under the control of the image processing and analysis section 14, reposition the semiconductor wafer to provide for a visual review of a defect on the semiconductor surface by the apparatus operator. The defect review can be accomplished using either the dark " field illumination employed in connection with edge detection or bright field illumination for visual inspection. As noted above, it is the trend in today's VSLI technology to use a repeating pattern on a semiconductor wafer surface. The apparatus herein is arranged to review the disagreements at block 128 for »5 repeating patterns to find repeating defects, if any. Repeating defects are then reported as a possible and t likely reticle defect which must be cured, for example, by cleaning the reticle or replacing it with. a new element. This is accomplished at block 128 of Figure 6. 0 The entire analysis system can be implemented in either hardware or software. Preferably, hardware is employed since the throughput and process time can be decreased by use of special purpose hardware such as an array processor employing a pipeline processing 5 approach. Nevertheless, a software implementation can ' also be satisfactory. The flow charts of Figures 4, 5, and 6 have been implemented in using a Digital Equipment Corporation PDP-11/23. The software programs, including interactive operating system programs, are attached 0 hereto as Appendix A. While the programs themselves do not form part of the invention, they do provide one particular implementation of the concepts and structure of the invention. In addition, the invention can be implemented in hardware as described in detail hereinafter. Hardware Implementation As noted above, the automatic inspection system of the invention can also be implemented in hardware. Referring to Figure 8, the hardware embodiment employs a process control and sequence timing circuit 148 adapted to provide an orderly transition of the data from the microscope optics illustrated by block 150 to the eventual report generation and display. The process control and timing circuit can be a hardwired apparatus, as is well known in the art, adapted to fix the timing of a plurality of elements or can be a special or general purpose computer which provides * greater flexibility in changing the timing and control of the apparatus. The image from the illumination optics 150 is provided through the sensor element which forms part of an image acquisition section 152. The image acquisition provides the scanned image for storage in a dual memory storage array 154 corresponding to image storage array 13. The scanning of the wafer is under the control of a wafer scan control circuit 156 as is well known in the art which is interactive with the process control and sequence timing circuit 148. The image, once stored, .is continually modified within the storage element so that minimal additional RAM storage is needed. Therefore, the raw data stored in memory 154 is filtered using a spatial filtering network 158. The spatial filtering network is adapted to sequentially read out the raw data from memory 154, and to effectively low pass filter it as described above using its digitial hardwired circuitry. After spatial filtering, the smoothed image data is convolved, by a convolution circuit 158 operating under the control of the control and timing circuit 148, for each of the convolution functions described in connection with Figure 3 so that a peak finding and step finding data is read into memory 154. The convolution circuit 158 is preferably built around an array processor employing pipelined processing. The convolved (or filtered) data, in this illustrated embodiment, is then "pruned" for noise and similar anomalies by an edge pruning circuit element 162. The edge pruning circuit removes invalid edge points using the criteria described above in connection with Fig. 5. After the stored data in element 154 is "pruned", an edge boundary comparison circuit 164, also operating under the control of the process control and timing circuit 148, compares the data stored in the image storage array 154 with the reference model stored in a reference memory circuit 166. The output of the comparison, as described in connection with the flow chart of Figure 6, is stored back in storage array 154. As a result, there is found in storage array 154 the disagreement boundaries determined by a comparison of the processed scanned data with the reference model storage information. This stored information is then analyzed by the classification network 168. This network, after reference to memory 166, maps the boundary disagreements into classes depending in part upon the effect of the defect upon semiconductor operation, and provides detailed information regarding the defect and its classification to a report generating circuit 170. The report generating circuit provides a suitable format for either a visual or printed display. A display element 172 can thus be either a visual monitor which is preferred or a printer, or both. With reference to the generation of the reference pattern stored in memory 166, a CAD model is stored in memory, for example a disk memory 174 and the memory 174 is read and processed by a controller 176 for providing to the memory 166 both a suitable definition of the edge boundaries and a definition of the active volumes of the OT.:PI [fry, iiO final semiconductor structure which can be severely and adversely affected by defects in or near those reference boundaries. The key to proper operation of the hardware is to provide sufficient timing and control via the process control and timing network 148 to enable the various elements to operate in a sequential manner and to use pipeline array processing as needed, such as, for example, the time consuming convolution process which involves a series of time consuming multiplications. Additions, subtractions, deletions, and other modifications of this preferred embodiment of the invention will appear to those practiced in the art and are within the scope of the following claims. : Install the VIDEO MONITOR task in low memory' up to 128kwords > άi t dm3 : s r ou dm3 : ;s*t def S,5 ;run SY : C5 , 53 INIAP / par : c task 1 ! S « t de f S , 1 iron £Y : t5 , 53 STARTAP/ ar : et skl ;copv wafvis.txt ttO : . if ins VIDEOT rem VIDEOT . if ins MATCHT rem MATCHT if in* DEFECT rem DEFECT . if ins CEDCET rem CEDCET i ins STAGET rem STAGET ins/pir : CTASK2 /TA-VIDECT SY :WFVIDEOT ins/pπ : 45/TA-MATCHT SY • .VFMATCHT iπs/TA«DEFECT SY :WFDEFECT ins /par :CTASK1 /Tλ=CEDGET SY; ■ .WFCEDGET ins /TA-STAGET sy :WFSTAGET run C5 , i lw(2000c 1 / task-.mast er rem VIDEOT rem MATCHT rem DEFECT rem CEDGET rem STAGET <* n M MλAIϋSC'T. ER TASK: MASTERT.TSK *> ext MACOMM Intertask communica ion support ext PDPID lsi-11 assem l r symbol def ex MAWIN Memory management support ext INSPLAN The Inspection Flan and Inspection Status ext IPSDBM The Inspection Data Base Management .ext VDT Miscellaneous terminal I/O routines ext MAI IT Master Ini i lization vs r ( "master" , promstr > SRESTART :- base MλlNIT SAVE MASTERT <* Global event flags for synchroniza ion. TASK holds the names of the tasks with whom we are communica ing in RADSO . THESE MUST BE GLOBAL *> parameter TABLEN :» 12. record TASKTAB integer TAS t 2 ) en recor integer SYNC1 t TABLEN > SYNC2 C TABLEN ) TAPTR TASKTAB TASK < TABLEN J with TASK ( 0 > TAPTR OFF <* Define executive directives to be used for tasking with Control *) make 'WAIT rszcall bytewd < 2 , 41. ) make 'CLEAR rszcall bytewd t 2 , 31. ) make 'READ rsxcall bytewd ( 2 , 39. ) make 'SET rszcall bytewd < 2 , 33. ) make "RCVDs rszcall bytewd ( 4 , 75. ) make '5DRC$ rszcall bytewd C 7 , 141. > make ' SDATS rszcall bytewd < 5 , 71. ) make 'WTLOS rszcall bytewd < 3 , 43. > make 'MRKTS rszcall bytewd < 5 , 23. ) <* Execute a subroutine call, the arguments and subroutine name are in EUFF. BUFF contains: TASK1 , TASK2 , 0 or -2 . #ARGS , argl , arg2 , .. argn , subrout ine TASK1 and 2 make up the tasknaae of the caller *> def ine COROUTINE integer BUFF < 1 ) local integer ADR OFFST OFFST1 OFFST :« 4 0FFST1 := 0 if < BUFF i 2 > > ptr C BUFF < 4 > J OFFST1 := 1 OFFST := OFFST ■- length ( ptr < BUFF C 4 ) > > / 2 + 1 end lf lookup ( ptr ( BUFF < BUFF ( 3 > + OFFST - OFFST1 > ) ) , ; ADR := lastword DROP iter BUFF ( 3 ) - OFFST1 ' BUFF < I + OFFST ) ) ; store args on stack loop exec ( ADR ) end <* W i for a logical or of event flags *> def ine WAITLO local integer MASK MASK off iter TAPTR setbit ( SYNC1 ( i ) - 33 , ptr < MASK ) > Ioop WTLOS < 2 . MASK > end define DELAY integer DTIM MRKT$ ( 23. , DTIM * i , I . 0 J WAIT ( 23. ) end <* Return the index into the task table, called with the task name in RAD50 *' define ITASGET integer integer T < 1 ) STASGET on iter TABLEN with TASK < i ) if C T C 0 ) TAS ( II 1 in. T I 1 ) >< TAS t 1 ) > (TASGET endif loop end <* Return the index into the task table of a task, task name is in ascii *> define TASGET integer integer T C I ) local integer R < 2 > TASGET on clue C T ) if < ascrS < T . R ) ) TASGET :» iTASGET ( R > endif end <* Primitive to send data to another task *> define SENDDATA integer INDEX , BUFF' < 1 ) CLEAR < SYNC2 < INDEX ) > wi th TASK C INDEX ) SDATS . TAS ( 0 ) , TAS < 1 > , BUFF , SYNC1 ( INDEX ) > ; ; loerr end <* Wait for another task «> define WTASK integer TSKNAM ( 1 > local integer INDEX det term INDEX : •■ TASGET ' TSKNAM ) if ( INDEX »- -1 ) print "Task not connected" else WAIT < SYNC2 t INDEX ) ) en if at term end <* Connect to a task. It seems that RSX needs to have the terminal when the other task starts, we detach ourself and wait until the other task has initialised before we attach ourself again. Start up synchronization Call: CONNECT ( "TSKNAM" SYNC1 SYNC2 ) TSKNAK must be i characters, iβ. CONNECT < "DRW " . 33 ,34 > «> define CONNECT integer TASKNAM ( 1 ) SYN1 SYN2 Iocal integer BUFF C 13 ) clue < TASKNAM ) if C ascrS < TASKNAM , TASK < TAPTR ) ) .-0 ) print "Bad taskna e" else _ OMPI de11 rm SYNC1 ( TAPTR ) :- SYN1 ; ; SYNC2 < TAPTR SYN2 BUFF ( 0 > :« SYN1 ; ; BUFF < 1 ) :» SYN2 CLEAR ( SYNC1 < TAPTR ) ) CLEAR t SYNC2 < TAPTR > ) wi th TASK < TAPTR > SDRCS ( TAS C O ) , TAS C 1 BUFF y ewd 14. 2 ) 0 0 > WAIT ( SYNC2 C TAPTR ) > increment TAPTR at t erm end f end < » Send a buffer of data to the task we are connected to EUFF ( 0 ) must be greater than C. This can be used in the receiver as a code for what d&ta has been sent. The buffer can be no longer than 13 words. *> de ine SEND integer T I ) BUFF < 1 ) local integer 2 FLAGS < 4 > 2 .» TASGET < T ) if ( Z »«t -l ) print "Task not connected" else READ C FLAGS ) if C getbit C SYNC2 < 2 ) - 33. , ptr < FLAGS < 2 ) > ) ) : f they are dene SENDDATA ( Z , BUFF ) else i ter 3 DELAY < 100 ) READ C FLAGS ) if C getbit C SYNC2 C ) - 33 PTR ( TLAGS C 2 ) ) > ) SENDDATA ( 2 , BUFF exi else print str C T > , " is hung" endi loop endif endi f end <* Call a subroutine that is in the task we are connected to. Call: CALL TASK ROUTINE ARG1 , ARG2 , .. , ARGN where N <= 13 - < #chars_in_rout ine / 2 + 1 ) - 1 - 1 string length code targs this uses the code of 0 in the buffer *) define CALL command integer ARG local integer BUFF C 13 ) T C 4 ) Tl C 8 ) OFFST OFFST1 de t term ztvzer < BUFF , 13 ) BUFF C 1 ) :« e dent - 3 OFFSTl off OFFST :« 2 vstr ( ARG . T > nxtarg mvstr t ARC , Tl ϊ nxtar if C ARG ) BUFF < 0 ) :« -2 BUFF C I ) :» cmdcnt - 2 vstr t ARG . ptr C BUFF < 2 > ) OFFSTl :« length C ARG ) / 2 + 1 OFFST :» OFFST + OFFSTl endif mvstr C Tl , ptr C BUFF C cmdcnt + - 1 > ) ) nxtarg iter cm c - 3 BUFF C I + OFFST ) :» ARG nz r g loop SEND C T , BUFF ) a 11 e d <* Call a subroutine in another task and wart for it to finish Equivalent to CALL "TASK" "SUBROUTINE" 0 ; ; VTASK C "TASK" ) define CALLV command integer ARC local integer T C 3 ) mvstr C ARG , T ) exec C base CALL ) WTASK C T 5 end <* Receive data from that task we are connected to and put it in a buffer Call: RECEIVE C BUFFER > Note: if these routines are overlaid , BUFFER must be global. The buffer must be at least 15 words. EUFFER contains: TASK1 . TASK2 , CODE , DATA where TASK1 AND 2 make the name of the task which is sending the message. CODE is 0 if we are calling a routine, -1 if the other task is informing us of its rundown, and >0 if other data has been sent *> define RECEIVE integer BUFF C 1 ) local integer Z VAITLO wait for flag from any task RCVDS ( 0 , 0 , BUFF ) ; ; ioerr Z :» JTASGET C BUFF ) CLEAR C SYNC1 C Z ) ) if C BUFF C 2 ) »» -1 > rundown SET C SYNC2 c Z > ) acknowledge receipt if C BUFF C 3 ) -«0 ) b e else if C BUFF < 2 ) »»0 or BUFF C 2 ) -2 ) DOROUTINE C BUFF ) endif SET < SYNC2 ( Z ) ) end if end <* Inform the other task that we are stopping. Call : RUNDOWN < arg ) arg e 0 if we want the other task to bye as well. arg ) 0 if we want the other task to stay alive or do something else before dying *> de ine RUNDOWN integer T < 1 > ARC 1ocaI integer BUFF < IS" ) INDEX INDEX :» TASGET < T ) if ( INDEX am -1 ) print "Task not connected" else BUFF < 1 ) OFF if ( ARG ) BUFF C 1 ) := ARG ;; ENDIF BUFF ( 0 ) ON SEND < T BUFF ) endif end <* Set up communications with the task that requested us. receives the two flags that the tasks will use for synchronization. and the name of the task with whom we are communic ted. Any task that gets connected to must issue an INITREC command before p oceedin . *> define INITREC local integer BUFF ( 15 ) dettera RCVDS ( 0 , 0 , BUFF .) ;; ioerr with TASK ( TAPTR ) iter 2 TAS ( I ) :« BUFF < i > loop SYNCl ( TAPTR ) :• BUFF ( 2 ) SYNC2 < TAPTR ) := BUFF < 3 ) SET ( SYNC2 C TAPTR ) ) increment TAPTR end <« The REGION Definition Block «> record MEM_REC integer RGDB ( 0 ) Pointer to Region Definition Block in t e g er REG ID REGION ID integer REGSZ REGION SIZE < to be set ) in eger REGNM ( 2 ) REGION NAME IN RADIX50.CNO NAME) integer PARNM ( 2 ) NAME OF THE PARTITION IN RADIXSOC o be set) integer REGST STATUS : USE DEFAULTS' or to be set ) int ger REGPR NOT PROTECTED AT ALL C* The WINDOW Definition block *) integer VNDB ( 0 ) Pointer to Window Definition Block integer WNDAPR HIGH BYTE HAS THE APR, LOW BYTE IS THE WINDOW ID integer UNDADR VIRTUAL BASE ADDRESS IN TASK'S VIRTUAL SPACE integer WNDSZ WINDOW SIZE IN 32WORD BLOCKS integer VNDREG REGION ID integer VNDOFF OFSSET IN REGION IN 32 WORD BLOCKS integer WNDL LENGTH TO MAP IN 32WORD BLOCKS integer WNDST WINDOW STATUS WORD integer WNDSRB SEN/RECEIVE BUFFER ADDRESS end ecord MEM_REC M_IFSDB ; Memory blocks for model access. MEM_REC M_EDGE ; for creation of EDGE IMAGE Region MEM_REC M_MODEL ; for creation of MODEL for MATCHING region M£M_R£C M_MATCH ; for creation of IMAGE region for MATCHT and DEFECT. C* Define the memory mngnment executives directives *> make "CRRG rsxcall bytewd C 2 , 55. ) make 'DTRC rszcall bytewd C 2 , 59. ) make 'CRAW rsxcall bytewd C 2 , 117. ) make 'MAPW rsxcall bytewd C 2 , 121. ) make 'UMAPW rszcall bytewd C 2 , 123. ) make 'ELAW rsxcall bytewd ( 2 , 119. ) define CREGION integer REGNAM PARNAM REGSIZ REGSZ := REGSIZ ASCR5 ( REGNAM , REGNM ) drop ASCRS C PARNAM , PARNM ) drop REGST :• 57K ; attach it and allow all access CRRG ( RGDB ) ; create the region and attache it i oerr end _,-.— ■•— « „ • ** ■ SHEET oι-.:?ι Tϊ i . c- . n -- define DREGION DTRG ( RCDB ) ,: ioerr if ( REGST )» 400Q0K ) print "Window unmaped" endif end def ine cwndow integer APR , WNRID , WNSIZ , WNOFF WNDAPR :■ urshi ( APR , 5 > ; APR in the upper byte VNDSZ :« WNSIZ MUST BE LESS THAN 4K WNDREG :« WNRID THE REGION'S ID WHERE THE MAPPING TAKES PLACE THIS IS KIND OF TRIKY NO. SO IT MUST BE FETCHED FROM THE REGION DEFINITION BLOCK ( RGDB ) WNDOFF :- WNOFF WINDOW OFFSET IN THE REGION WNDL o f f TAKE THE DEFAULT. CAN BE CHECKED FOR THE ACTUAL WINDOW SIZE AFTER THE CALL WNDST := 202K MAP IT AND ALLOW WRITE ACCESS CRAU ( WNDE ) CREATE AND MAP THE WINDOW IOERH END <* 1NITRG < REGNAM , PARNAM REGSIZ VADDR ) creates a named region and an initial mapping of a 4 window at the begining of the region *) define INITRG integer REGNAM PARNAME REGSIZ VADDR CREGION ( REGNAM , PARNAME , REGSIZ ) create a 32kwords dynamic region. CWNDOW < VADDR , REGID , 20OK , 0 ) create a window at VADDR absolute address of 4k words. Map it at the offset 0 in the re ion end STITUTE SHEET paramβter MAX_FRAMES :« 32 parameter MAX_SITES :* 2 parameter MAX_PATTERNS :« 1 parameter MAI_RETICLES :» 2 parameter MAX_REVS :» 1 parameter MAX_TEST_DIE :- 2 parameter MAX_DIE_ROW :« 10 parameter MAX_LAYERS :« 1 parameter MAX_DEFECT :«= 14 parameter FALSE :» 0 parameter TRUE :» -1 parameter PRIMARY :» 0 parameter CONFIRM :- 1 paramet r BRIGHT : 0 parameter DARK :« 1 record X_ integer X integer Y βndrecord record ID integer ROW integer CLMN βndrecord record DEFECT integer XCOM integer YCOM integer DELX integer DELY βndrecord record DEFECT_BUFFER integer t_DFCTS DEFECT DEFECTS ( MAX_DEFECT ) βndrecord record D_ROW integer 1ST_D_# integer LAST_D_* βndrecord record F_DTL χ_* F_SZ x_¥ F_OLAP endrecord record F_TO_INSP integer #_FS ID FRAMES C MAX_FRAMES ) DEFECT_BUFFER F_DEFCTS C MAX_FRAMES ) endreco d record P_DTL char P_DESCR ( 80 ) integer MIN_DEF_SZ integer MIN_P_SZ integer P_MAG integer »_SITES X_Y S_0RG < MAX_SITES > X_Y F_ORG F_DTL F_DESCR F_TO_INSP INSP_FR < MAX_SITES > endreco d recor D_DTL X_Y D_DIM integer D_ST_HGT integer D_AV_WDTH integer #_PATTERNS P_DTL D_PATTERNS ( MAX_PATTERNS ) (* PATTERNS_TO_INSPECT DIE_ΣNSPECTION ( MAX_PATTERNS ) «) end eco record R_TO_INSP integer t_TO_INSP ID INSP_R ( MAX_RETICLES ) endreco r e c o r d R_DTL X_Y R_DIK integer R_ST_HGT D_DTL RETICLE_DIE <* DIE_T0. .INSPECT RETICLE_INSPECTION *> end eco ecor L_ .DTL char L_REV_# ( 80 ) R_DTL L_RETICLE R_TO_INSP L_INSPECTION endreco recor L_ .REVS char L_DESCR ( 80 ) integer LAYER_* i teger #_REVS L_DTL DTL_LAYER_REV C MAX_REVS ) endrecord record PLAN_HDR char PRODUCT_NAME C 80 ) i t ger WAFER_SZ real DIE_X real DIE_Y X_Y FLAT_TO_ORIGIN ID REFERENCE_DIE -fsJ OMPI TITUTE SHEET ^ λ'A τι integer »_TEST_D1E ID TEST_DIE ( MAX_TEST_DIE ) integer *_DIE_ROWS D_ROW WAFER_MAP ( MAX_DIE_ROW ) endrecord record INSP_PLAN PLAN_HDR HEADER integer *_LAYERS L_REVS LAYERS ( MAX_LAYERS ) DEFECT_BUFFER CONF_DEFECTS DEFECT_BUFFER REPT_DEFECTS record INSP_STATUS integer I-MODE Primary or eonfirm integer STAGE_ERR True , False integer STAGE_BUSY True , False integer LENSE_BUSY True , False integer FOCUS_BUSY True , False integer ILLUM_BUSY True , False integer REG_X integer REG_Y ID MOD_RET ; integer, MOD_SITE (1..15) integer MOD_FRAME integer MOD_ILLUM Br ight , Dark integer MOD_MAGNF (lx .. 500x> integer MOD_ AYER integer MOD_PATTERN ID CUR_RET ; integer CUR_SITE ; (1..15) integer CUR_FRAME integer CUR_ILLUM Bright , Dark integer CUR_MAGNF <lx 500JC) integer CUR_LAYER integer CUR_PATTEHN ID DES_RET j integer DES_SITE (1..15) integer DES_FRAME integer DES_ILLUK Bright , Dark integer DES_MAGNF (Ix .. SOOx) integer OES_LAYER integer DES_PATTERN * Ϋ DES_DISPLAY only screen coordinates TE SHEET endrecord record IPSDB_REC INSP_PLAN INSP_PLN INSP_STATUS INSP_DATA_BASE endrecord define STORE_IPSDB address NAME PLAN local integer OUTCH OUTCH :« open ( NAME , • RWCT ) wrs ( OUTCH , PLAN , SIZE IPSDB_REC ) DROP close ( OUTCH ) end define READ_IPSDB address NAME PLAN local integer INCH INCH := open ( NAME , "R ) rds ( INCH , PLAN , SIZE IPSDB_REC ) DROP close ( INCH > end TITUTE SHEET <* Miscellaneous terminal I/O routines for MASTERT *) APUSH RADIX OCTAL <* GET AN INTEGER GETNUM < PROMPT . DEFAULT ) *> DEFINE GETNUM INTEGER INTECER ARGl ARG2 GETNUM :« ARG2 PRINT STR ( ARGl ) , " Z " , tl 0 , ARG2 , "3: " , #Z IF ( RDLINE ) IF C ILITERAL ( LBUF ) ) GETNUM :» ILVAL ENDIF ENDIF END <« Routines to set up a io/wait from the terminal *) INTEGER QIOW ( 0 > .WORD BYTEWD < 12. 3 ) .WORD 103OK READ .WORD 0 .WORD 24. EVENT FLAG .BLKW 3 .WORD 1 .BLKW 4 DEFINE TYI INTEGER QIOW ( 2 ) :« CICH QIOW ( 6 ) :« PTR i TYI ) TYI OFF RSXDIR ( QIOW > ; ; IOERR END <* GETFNUM ( REAL . PROMPT ) GET A REAL NUMBER *> DEFINE GETFNUM REAL REAL FARG1 INTEGER ARG3 GETFNUM :« FARG1 PRINT STR ( ARG3 ) , "-" , »F 10 2 , FARG1 , " i : *Z IF ( RDLINE > IF ( ILITERAL ( LBUF > ) GETFNUM :» FLOAT ( ILVAL ) ENDIF IF ( RLITERAL ( LBUF ) ) GETFNUM :» RLVAL ENDIF ENDIF END »> SUBSTITUTE SHEET <* CETSTRING ( BUFFER , PROMPT > «> DEFINE GETSTRING INTECER ARGl ARC2 WHILE ( not WORD ) PRINT STR ( ARG2 ) , #Z RDLINE , REPEAT MVSTR ( TBUF ARGl ) END (* Get a string wi h a default CSTRING ( BUFFER . PROMPT , DEFAULT_ST ING ) *> define GSTRING integer BUFFER < 1 ) PROMPT ( 1 ) DEFAULT ( 1 ) mvstr ( DEFAULT , BUFFER > print, str ( PROMPT ) , " t " , βtr < DEFAULT ) , " . «ε rdline if ( word ) mvstr C tbuf , BUFFER ) endif end DEFINE YESNO INTEGER INTECER ARGl LOCAL INTEGER ANSWER PRINT STR ( ARGl ) , " (Y/N) : " , »Z ANSWER : - TYI PRINT #A ANSWER YESNO :« ( ANSWER and 137 ) «» ASCII Y END INTEGER FAUSECHAR ; Bucket for read in character <* PAUSE ROUTINES *> DEFINE VDT_IN address PROMPT PRINT str ( PROMPT > , tZ PAUSECHAR :» TYI PRINT tλ PAUSECHAR CR END APOP SUBSTITUTE SHEET <* Initialision section of the master *) <* Initialise region allocation *) <* and Connect the module tasks *> define MAINIT with M_EDGE CREGION ( "EDGING" , "EDGIMR" , 2000K ) wi th M_MODEL CREGION ( "MODELR" , "GEN , 200K ) with M_MATCH CREGION < "MTCHIM" . "GEN , 2000K ) with M_IPSDB INITRG ( "IPSDBR" , "GEN " , 20OK , 160.000k ) print "VIDEOT is being connected." CONNECT < "VIDEOT" 41. 42. ) ; Initialise the Video Monitor Task VIDEOT print "MATCHT is being connected. M CONNECT ( "MATCHT" 35. 36. ) ; Initialise the Registration and Mathcing print "DEFECT is being connected." CONNECT ( "DEFECT" 37. 38. ) ; Initialise the Defect Analysis Task print "CEDGET is being connected." CONNECT ( "CEDGET" 3?. 40. ) ; Initialise the Edge Detection Task print "STAGET is being connected." CONNECT ( "STAGET" 33. 34. ) ; Initialise the SStage Positioning Task end de f ine RUNDOWNΛLL RUNDOWN ( " IDEOT" 0 ) RUNDOWN C "MATCHT" 0 ) RUNDOWN ( "DEFECT" 0 ) RUNDOWN t "CEDGET" 0 ) RUNDOWN ( "STAGET" 0 ) end define BYE RUNDOWNΛLL bye end <* VIDOET Commands *> define CGRAB ΣM integer XO YO CALL "VIDEOT" "GRABIM" 0 XO YO end define CVDRAW integer FNAME XO YO CALL "VIDEOT" "VDRAW" FNAME XO YO e define CDRAW integer XO YO CALL "VIDEOT" "DRAW" 0 XO YO end define CMDRAW integer XO YO CALL "VIDEOT" "MDRAW" 0 XO YO end define CSAVE integer FNAME CALL "VIDEOT" "MSAVE" FNAME end define CVSAVE integer FNAME CALL "VIDEOT" "VSAVE" FNAME end define CFILLREG integer FEDGE CALL "VIDEOT" "FILLREG" FEDGE end define CREGFILL integer FEDGE CALL "VIDEOT" "REGFILL" FEDGE ' end define CWFMAP integer XO YO SZ CALL "VIDEOT" "WFMAP" 0 XO YO SZ ; DI SPLAY_WAFER_MAP end define CDISPMODEL integer XO YO CALL "VIDEOT" "DISPMODEL" 0 XO YO end define CBNDRCTS i n t eg er XO YO CALL "VIDEOT" "BNDRCTS" 0 XO YO end define STF-VIDEOT ; disconnect "VIDEOT" task and attached to the terminal integer TERM CALL "VIDEOT" "STOPCO" TERM WTASK ( "VIDEOT" ) end <* CEDGE Commands *> define CEDGE CALL "CEDGET" "DOEDGE" 0 end define CSTARTAP CALL "CEDGET" "START_AP" 0 WTASK ( "CEDGET" ) end define STP-EDGET ; disconnect "EDGET" task and attached to the terminal integer TERM CALL "EDGET" "STOPCO" TERM WTASK ( "EDGET" ) end <» MATCH Commands *) define STP-MATCHT ; disconnect "MATCHT" task and attached to the terminal integer TERM CALL "MATCHT" "STOPCO" TERM WTASK ( "MATCHT" ) end define CREGISTER CALL "MATCHT" "REGISTER" 0 end define CMATCH CALL "MATCHT" "MATCH" 0 end define CGETIM CALL "MATCHT" "GETIM" 0 end define COPYIM CALL "MATCHT" "COPYIM" 0 end define CGETMODEL integer FNAME CALL "MATCHT" "GET_MODEL" FNAME end <* DEFECT Commands *> define STP-DEFECT disconnect "DEFECT" task and attached to the terminal integer TERM CALL "DEFECT" "STOPCO" TERM WTASK ( "DEFECT" ) en define CDETECT CALL "DEFECT" "DETECT" 0 end .<* STAGE Commands *> define STP-STAGET disconnect "STAGET" task and attached to the terminal integer TERM CALL "STAGET" "STOPCO" TERM WTASK ( "STAGET" ) end define CCALSTG calibrate the stage CALL "STAGET" "CALSTG" 0 WTASK ( "STAGET" ) end define CSTGINI ; calibrate the stage CALL "STAGET" "STGINI" 0 VTASK ( "STAGET" ) end define CSTAGEM ; stage move according to inspection plan CALL "STAGET" "STAGEM" 0 end define CILLSW ; D/B field switch CALL "STAGET" "ILLSW" 0 end define CFOCUS ; autofocus CALL "STAGET" "FOCUS" 0 end define CERRCOR ;' autofocus CALL "STAGET" "ERRCORR" 0 WTASK ( "STAGET" ) end SUBSTITUTE Sl-VZET trt MACOMANDS (* The demo seetion *) integer DSKFLAG IMCNT ; flag and image counter for EDGE image ; saving on the disk char IMBASE ( 0 ) .test "LNF" integer RDSKFLAG RIMCNT ; flag and image counter for BRIGHT ( RAW ) image ; saving on the disk char RIMBASE ( 0 ) .text "RNF" char MDLBASE ( 0 ) .text "LNF" DSKFLAG on RDSKFLAG on integer YESSTAGE ; &&& YESSTAGE off char ANSWER ( 20 ) define GET_LAYER DES_LAYER :« GETNUM ( "Which mask level do you want to inspect l ) gnore user ; DISPLAY_INSFECTION_DIE CUR_LAYER :» DES_LAYER with LAYERS ( CUR_LAYER ) with DTL_LAYER_REV ( *_REVS - 1 ) print "Mask revision number is .... " , str ( L_REV_# ) print "Mask layer description is .. " , str < L_DESCR ) print "View screen to see precon igured inspection die" print " The blue reticle is the reference die" print " The red reticles are the diβito inspect" end <* START_DEMO Initialises the Inspection Data Base by reading from disk the IPSDB.DAT and placing it in the common region IFSDBR. The Inspection Status is Initialixe . *> define START_DEMO IMCNT off with M_IPSDB GSTRING ( ANSWER , "Please input Product Name to be inspected" , "SEMIEAST" ) READ_IPSDB ( "IPSDB.DAT" , WNDADR ) ptr ( 1PSDB_REC > :» WNDADR with INSP_DATA_BASE with INSP_PLN i th HEADER r — ,r*sr*--ι!tf_-r- nr-™ p int "Wafer sixe is ... WAFER_SZ , " mm" print "Die width is .... DIE_X , ' mic r ons' print "Die height is ... DIE_Y , ' microns ' GET_ AYER CWFMAP ( 96. 383. 128. > mvstr < 'LNF , IMBASE ) mvstr ( 'RNF , RIMBASE ) end define SHOW_ME iter #_SITES with F_DEFCTS ( i > if ( *_DFCTS ) DES_SITE :» j DES_FRAME :χ= i with DES_RET ROW . • ΣNSP_R ( 0 ) : ROW CLMN : = I SP_R ( 0 ) : CLMN CSTAGEM CFOCUS VDT_IN ( "Hit (re turn) to continue ROW := I SP_R ( 1 ) : ROW CLMN : « INSP_R ( 1 > : CLMN CSTAGEM CFOCUS print "Hit (return) to continue" VDT_IN ( "Hit ! to abort inspection: " ) if ( PAUSECHAR »« ascii ! ) exit endif endif loop if ( PAUSECHAR «» ascii ! ) exit endif loop en def ine DOPRINTS och : -. open ( 'REPORT.DAT 'wn ) print «t 30 , "C 0 N T R E pr int *t 28 , "W fervi s ion 2000' print pr int pr int tT 30 "Defect Report" i t er 3 print loop print "Product Name: " , str ( PRODUCT_NAME ) print "Layer Descri tion: " , str < L_DESCR > print "Layer Revision Number: " , str ( L_REV_# ) iter 3 pr int loop pr int •T 25 'Repeating Defects" pr int pr int «τ 10 ■ Number" , »T 30 , "X Location" , IT 50 , "Y Location" pr int #t 30 "< Microns )" , *t 50 , "( Microns )" end define REPORT_DEMO local integer DFCTCNT TEMP TEMPI real CONVFACT DOPRINTS DFCTCNT :« 1 CONVFACT :« .5 80.0 / FLOAT ( CUR_MAGNF ) .5 mi crons / ix β 80% adjust with F_DESCR iter #_SITES with S_ORG ( i ) with INSP_FR ( i ) iter #_FS with FRAMES ( i ) with F_DEFCTS ( i ) iter #_DFCTS with DEFECTS < i ) TEMP : » fix < float < "{.COM ) ' CONVFACT ) *■ ( F_SZ : • ROW ) TEMPI :» ix ( float ( YCOM ) * CONVFACT ) ■ ( F_SZ * CLMN print *T S , DFCTCNT #T 2? TEMP , *T 4? , TEMPI increment DF' CNT loop loop loop close ( och ) och on end define GETEDGES local char PNAME ( 30. ) CALL "VIDEOT" "ACQMSG' WTASK ( "VIDEOT" ) if ( DSKFLAG ) print str C IMBASE ) , *p 60k *i 2 CUR_FRAME #n encode ( PNAME ) CFILLREG C PNAME ) WTASK ( "VIDEOT" ) endif end define GETBFIMG integer XO Y0 local char PNAME ( 30. ) if ( RDSKFLAG ) print str ( RIMBASE ) *p 60k , #i 2 CUR_FRAME «n SUBSTITUTE SHEET ry, WlrO encode ( PNAME > CVDRAW ( PNAME , XO YO ) WTASK ( "VIDEOT" ) endif end define 1STFOCUS if ( not RDSKFLAG ) DES_ILLUM :« DARK ; MUST START WITH DARK ILLUMINATION! ! ! ! ! CILLSW ; switch illumination end i f if ( YESSTAGE ) ; . & . CSTAGEM ; move the. stage to the very first position ; ££& CFOCUS ; and focus on it else CUR_FRAME :» DES_FRAME endif en define DBF ; display bright field CALL "VIDEOT" "GEAR" 0 32 256. 0 256 0 WTASK ( "VIDEOT" ) if ( not RDSKFLAG ) DES_ILLUM : =e B IGHT ; meanwhile change illumination to bright CILLSW ;; WTASK ( "STAGET" ) end i f if ( RDSKFLAG ) GETBFIMG ( 32 0 ) else CGRABIM ( 32. 0 ) ; ; WTASK ( "VIDEOT" ) endif DES_ILLUM :» DARK end define RTMOD ; preserve the current status in MOD_ status for inspection MOD_LAYER : « CUR_LAYER MOD_FATTERN : - CUR_PATTERN MOD_RET :« CUR_RET MOD_SITE :« CUR_SITE MOD_FRAME : =» CUR_FRAME end define GMLRGR ; gat and display the model and register loc l char PNAME ( 30. ) print tr ( MDLBASE ) , tp 60k , *i 2 , MOD_FRAME 1 .MDL' *n encode ( FNAME ) CALL "VIDEOT" "IPRMSG" 0 ; ; WTASK ( "VIDEOT" ) CCETMODEL ( PNAME ) ; ; WTASK ( "MATCHT" ) CDISPMODEL ( 352. 0 ) ; ; WTASK ( "VIDEOT" ) ; back to EDGE detection" SUBώ> π i ϋ . x. Sr.«icT WTASK ( "CEDGET" > ; Before re istration, EDGE must finish COPYIM WTASK ( 'MATCHT ) ; Copy EDGIMG to MTCHIM. ^REGISTER WTASK ( "MATCHT" ) end define MCHDEF ; atchin and defect analysis . COMPLETE DEFECTS CALL "VIDEOT" "MDLMSG" 0 WTASK ( "VIDEOT" ) CMATCH WTASK ( "MATCHT" ) CALL "VIDEOT" "DFTMSG" 0 WTASK ( "VIDEOT" ) CDETECT ; ; WTASK ( "DEFECT" ) CBNDRCTS ( 32. 0 ) ;; WTASK ( "VIDEOT" ) Display the defects VDT_IN ( "Please contemplate and evaluate! f i¬ end define CONFIRM_INSPECT iter t_SITES with INSP_FR < i ) iter t_FS with F_DEFCTS ( i if ( #_DFCTS ) DES_SITE :» J DES_FRAME : * I ; if C i + j «»0 > 1STFOCUS ; else WTASK ( "STAGET" ) CALL "VIDEOT" "LMAG' WTASK ( "VIDEOT" > if ( DSKFLAG ) GETEDGES else CGETIM get the DF image WTASK ( "MATCHT" ) CSTARTAP start the array processor CEDGE EDGE DETECTION WTASK ( "CEDGET" > ; print "; while EDGE is working do the following" endif DBF display BF image RTMOD set the model infer for real-time work GMLRGR get and display the model and register MCHDEF match and defect analysis ; endif endif loop if ( PAUSECHAR «» ascii ! ) exit endif loop end O:.:FI su er.-;P .- ϊ ■ ,-ss , define FRIMARY_INSPECT i er t_SITES DES_SITE :- i with INSP_FR ( DES_SITE > print "frames to inspect a " , »_FS iter t_FS DES_FHAME :- I , ; if ( i + i «-0 ) 1STFOCUS else WTASK ( "STAGET" ) CALL "VIDEOT" "LMAG" 0 WTASK ( "VIDEOT" ) if ( DSKFLAG > GETEDCES else CGETIM ; get the DF image WTASK ( "MATCHT" ) CSTARTAF ; start the array processor CEDGE ; EDGE DETECTION WTASK ( "CEDGET" ) ; print "; while EDGE is working do the following' end i f DBF ; display BF image RTMOD ; set the model infor for real-time work GMLRGR ; get and display the model and register MCHDEF ; match and defect analysis endif loop loop end integer NOFRAMES ; S*-£ FOR TESTING PURPOSE ONLY integer NOSITES ; £&& NOFRAMES :» i i &££ FOR TESTING PURPOSES ONLY NOSITES :- 1 define INSFECT_DEMO with L_"INSPECTION with L_RETICLE wi th RETICLE_DIE DES_PATTERN :« 0 ; initialise the pa11ern with D_PATTERNS ( DES_ PATTERN ) *_SITES :- NOSITES ££& iter t_SITES SS& FOR TESTING PURPOSES ONLY with F_DEFCTS ( i ) t_DFCTS :- 0 initialize number of defects 1oop loop with DES_RET ROW :« INSP_R ( 0 ) ROW CLMN :« INSP_R ( 0 ) : CLMN Cr* ιτ">-s" p I-MODE :» PRIMARY CALL "VIDEOT" "SHOWDIE" 0 WTASK ( "VIDEOT" ) PRIMARY_INSPECT if ( YESNO ( "Do you want to confirm the frames processed so far' ) ) ROW :« INSP_R ( 1 ) : ROW " CLMN :« INSP_R C 1 ) : CLMN I-MODE :» CONFIRM mvstr ( 'CLN , IMBASE ) mvstr ( *RCL . RIMBASE ) CALL "VIDEOT" "GBAR" 0 0 288. 254. ?0. 0 WTASK ( "VIDEOT" ) CALL "VIDEOT" "SHOWDIE" 0 WTASK ( "VIDEOT" ) CONFIRM_INSPECT endif end define DEMO CALL "MATCHT" "WINDOW" 0 4 4 START_DEMO CUR_ILLUM :« BRIGHT if ( YESNO ( "Do you want to calibrate the stage. ) ) CCALSTG endif CALL "VIDEOT" "VDRAW" "JOE" 352. 256. WTASK ( "VIDEOT" ) INSFECT.J3EMO REPORT_DEMO ; CALL "VIDEOT" "ENDMSG" 0 print "End of Demo end DEFINE HAROLD_DEMO START__DEMO CGETMODEL ( "LNF03.MDL" ) WTASK ( "MATCHT" ) CALL "VIDEOT" "HAROLD_DEMO" 0 WTASK ( "VIDEOT" ) END STϊTtf ;« «*********«***«**««»****««*****»t»«**«****«**** VIDEOT.MG - THIS MODULE LOADS ALL OF THE MODULES USED IN "VIDEOT.TSK' **«*******«*s-**************»***«********)t*)(*^ * > ext MAKLEX ex PDPID ext DMISC ext VIDREG ext FLUT ex FXMON ext 22BADDR ext VIDDISP ext FDMACO ex t VIDCOM ext £5, 13INSPLAN mvstr ( "videot" , proms tr ) pari-tter CRNGL : -E 1 parameter REDGL :-. 2 p rameter BLUGL :-. 3 de f ine LLUSETUP TPLANE : ~ 3 GPLANE :- 3 IPLANE := 252. D CHAN ( TPLANE , CCPP AAN1sEE * I IPLANE ) CLRMAP ( 0 ) iter 256. DSLLU ( GREEN sι v- GGRRNNCCLI +i- 1 [ , 255 , GREEN + GRNGL + I , 255 ) DSLLU ( RED + RI IEEDDGGLL +•r I [ , 255 , RED + REDGL + I , 255 > ; DSLLU ( GREEN t BLUGL + I , 128. , GREEN + BLUCL + I , 128 ; DSLLU ( RED s. BLUCL + I , 255 , RED + BLUGL + I , 255 ) DSLLU ( BLUE + BLUGL + I , 255 , BLUE + BLUGL + I , 255 > DSLLU ( GREEN + 1 , 1 I , , . cGRREEN + I » I ) DSLLU ( RED + 1 : , i . , f R 'EEED ) + I , I ) DSLLU ( BLUE + I , I * B BIL ,υUE + I * I loop ( . ) end define INITD DSOPN ( 8 ) drop 0SPLD DSCL < 255. ) DSCXY ( 0 0 LLUSETUP end VIDEO S st. .& ia ' ϋ,. i k. tfc. •»»*» »*—* ■ " "- <* THE MAKE OF THE LEXIDATA 3400 LIBRARY ROUTINES «> APUSH RADIX oct l MAKE 'DSOPN RSXFUNC 60 MAKE • DSCLS RSXFUNC 62 MAKE • DSCFG RSXFUNC 64 MAKE ■ DSMRG RSXFUNC 66 MAKE • DS20M RSXFUNC 70 MAKE • DSMOV RSXFUNC 72 MAKE 'DSLLU RSXFUNC 74 MAKE ■ DSLWT RSXFUNC 76 MAKE •DSLRD RSXFUNC 100 MAKE 'DSCHAN RSXFUNC 102 MAKE •DSVEC RSXFUNC 104 MAKE 'DSCLR RSXFUNC 106 MAKE • DSCIR RSXFUNC 110 MAKE • DSPNT RSXFUNC 112 MAKE 'DSLIM RSXFUNC 114 MAKE ■ DSPUT RSXFUNC 116 MAKE • DSGET RSXFUNC 120 MAKE • DSOWT RSXFUNC 122 MAKE 'DSIWT RSXFUNC 124 MAKE 'DSRNW RSXFUNC 126 MAKE • DSRNR RSXFUNC 130 MAKE 'DSSAO RSXFUNC 132 MAKE ■ DSTXT RSXFUNC 134 MAKE 'DSCSL RSXFUNC 136 MAKE • DSCER RSXFUNC 140 MAKE ■ DSCLD RSXFUNC 142 MAKE • DSCXY RSXFUNC 144 MAKE ■ DSBLIN RSXFUNC 146 MAKE • DSBLOC RSXFUNC 150 MAKE 'DSBLR RSXFUNC 152 MAKE 'DSGXY RSXFUNC 154 MAKE 'DSPLD RSXFUNC 156 APOP * Miscellaneous routines for DEMO «) APUSH RADIX OCTAL DEFINE LIMIT INTEGER INTECER ARGl ARG2 ARG3 LIMIT :« MAX ( ARG2 , MIN ( ARGl , ARC3 ) ) END DEFINE GETNUM INTEGER INTEGER ARGl ARG2 GETNUM : ι ARG2 PRINT STR ( ARGl ) , "t" , #1 0 , ARG2 , "3 : " , *Z IF ( RDLINE ) IF ( ILITERAL ( LBUF ) ) GETNUM :- ILVAL ENDIF ENDIF END DEFINE BEEP PRINT #A 7 , #Z END <* Routines to set up a io/wait from the terminal *) INTEGER QIOW ( 0 ) .WORD BYTEWD ( 12. 3 ) .WORD 103OK READ .WORD 0 .WORD 24. EVENT FLAG .BLKW 3 .WORD 1 .BLKW 4 DEFINE TYI INTEGER QIOW ( 2 > :- CICH QIOW ( 6 ) : * PTR ( TYI ) TYI OFF HSXDIR ( QIOW ) ;; IOERR END DEFINE ERWNA PRINT "ERROR: WRONG NUMBER OF ARGUMENTS' END <* GETFNUM ( REAL , PROMPT ) Commented out for RSX-llM. no floating point DEFINE GETFNUM REAL REAL FARG1 INTEGER ARG3 SUBSTITUTE SHEET CETFNUM :« FARG1 PRINT STR ( ARG3 ) , "C" . «F 6 2 , FARG1 , "J : " , tZ IF ( RDLINE > IF ( ILITERAL ( LBUF ) ) GETFNUM :« FLOAT ( ILVAL ) ENDIF IF ( RLITERAL ( LBUF ) ) GETFNUM :« RLVAL' ENDIF ENDIF END *) <* CETSTRING ( BUFFER , PROMPT ) *) DEFINE GETSTRING INTEGER ARGl ARG2 WHILE ( not WORD ) PRINT STR ( ARG2 ) , *Z RDLINE REPEAT MVSTR ( TBUF ARGl > END DEFINE YESNO INTEGER INTEGER ARGl LOCAL INTEGER ANSWER PRINT STR < ARGl ) , " (Y/N) : " , tZ ANSWER :» TYI PRINT #A ANSWER YESNO :« ( ANSWER and 137 ) »» ASCII Y END <* MCONCAT - Concatenates the strings specified as arguments MCONCAT de t-string(1st source string) , sou ce-string ar -count *> DEFINE MCONCAT COMMAND INTEGER STRI ITER CMDCNT - 1 PRINT STR ( STRI ) , *N NXTARG LOOP NXTARG ( — ( CMDCNT - 1 ) ) ENCODE ( STRI ) END <« IFCR performβs a CR if not at the begining of the line « > DEFINE IFCR IF ( #COLUMN ) ' PRINT ENDIF END x Allows for recursion in MAGIC/L. Calling RECURSE ( λrgl , Arg2 , calls the current subroutine wi h optional input arguments. *> DEFINE RECURSE IMMFUNC CCWD ( . + 1 ) END .MAC <* drop 2 things off the stack *> ENTRY 2DROP ADD # 2 , MSP NEXT (* divide by 2. done by shifting. 2/ ( -5 ) results in -3 , not -2 as -5 / 2 in MAGIC *) ENTRY 2/ INTEGER ASR (MSP) NEXT (* exchange 2 variables, expects pointers as argument! call: xchg ( ptr ( n ) , ptr ( y ) > *> ENTRY XCHG MOV & 0 (MSP) , RO MOV 9 2 (MSP) , Rl MOV Rl , 9 (MSP)+ MOV RO , β (MSP)+ NEXT <* Move a given number of bytes into the same number of words. MVBYWD ( BYTE_ARRA , BYTE OFFSET , WORD_ARRAY , #_BYTES ) *> entry MVBYWD mov ( sp ) + rO Get number of bytes to transfer. mov (Dtp )+ rl Get pointer to word array. mov (msp > + r2 Cet pointer to byte array add (ms )+ r2 plus t e offset. 0$ . movb (r2>+ , (rl > + Transfer byte. Increment pointers cl rb (rl )+ Clear high order byta of word. dec rO Decrement the count . bgt OS Branch if count not 0. nest (* Move a given number of wor s into the same number of bytes MVBYWD ( BYTE ARRAY , BYTE OFFSET , WORD_ARRAY , #_WORDS ) *> ent ry MVWDBY ov (ms ) * rO Get number of bytes to transfer mov (ms > + rl Get pointer to word array. i i r— TT'T'- J"*ΓΠ" G?J' Vr" ?Υ mo (msp) +• , r2 Get pointer to byte array add (msp ) + , r2 plus he offset. IS : ovb (rl)+ , (r2) + Transfer word. Increment pointers. ine rl Increment word pointer one more. dec rO Decrement the count. bgt 1$ Branch if count not 0. nex .END INTEGER PAUSECHAR Bucket for read in character INTECER SLOW Flag set if low mode desired INTEGER FAST Flag set if fast mode desired <* PAUSE ROUTINES ») DEFINE PAUSE IF ( FAST ) RETURN ENDIF IFCR PRINT "TYPE ANY KEY TO CONTINUE' tZ PAUSECHAR :- TYI CR END DEFINE IFFAUSE IF ( SLOW ) PAUSE ENDIF END APOP (» The RECION Definition Block •) record MEM_REC integer RGDB ( < ) ; Pointer o Region Definition Block. integer REGID ; REGION ID integer REGSZ : REGION SIZE ( to be set ) integer REGNM ( 2 ) ; REGION NAME IN RADIX50»<NO NAME) integer PARNM ( 2 ) ; NAME OF THE PARTITION IN RADIX50(to be set) integer RECST ; STATUS : USE DEFAULTS(or to be set ) integer REGPR NOT PROTECTED AT ALL (* The WINDOW Definition block «) integer WNDB ( 0 ) Pointer to Window Definition Block integer WNDAPR HIGH BYTE HAS THE APR, LOW BYTE IS THE WINDOW ID Integer WNDADR VIRTUAL BASE ADDRESS IN TASK'S VIRTUAL SPACE integer WNDSZ WINDOW SIZE IN 32WORD BLOCKS integer WNDREG REGION ID integer WNDOFF OFSSET IN REGION IN 32 WORD BLOCKS integer WNDL LENGTH TO MAP IN 32WORD BLOCKS integer WNDST WINDOW STATUS WORD integer WNDSRB SEN/RECEIVE BUFFER ADDRESS endreco MEM_REC M_MODEL Memory blocks for model access. MEM_REC M_EDGE Memory blocks for edge image access. <* Define the memory mngnment executives directives *) make ΑTRG rsxcall bytewd ( 2 , 57. ) make 'DTRG rsxcall bytewd ( 2 , 5?. ) make 'CRAW rsxcall bytewd ( 2 , 117. ) make 'MAPW rsxcall bytewd ( 2 , 121. ) make 'UMAPW rsxcall bytewd ( 2 , 123. ) make 'ELAW rsxcall bytewd ( 2 , 119. ) define ARECION integer REGNAM ASCRS ( REGNAM , REGNM ) drop REGST : = 57K ; attach it and llow all access ATRG ( RGDB > ; create the region and attache it ioerr end define DREGION DTRG ( RGDB ) ; ; ioerr ; if ( REGST >« 40000K ) print "Window unmaped' endif end SUBSTITUTE SHEET define cwndow integer APR WNRID , WNSIZ , WNOFF WNDAPR : urshift ( APR , 5 ) ; APR in the upper byte WNDSZ WNSIZ MUST BE LESS THAN 4K WNDREG WNRID THE REGION'S ID WHERE THE MAPPINC TAKES PLACE THIS IS KIND OF TRIKY NO. SO IT MUST BE FETCHED FROM THE REGION DEFINITION BLOCK ( RGDB > WNDOFF :. WNOFF WINDOW OFFSET IN THE REGION WNDL off TAKE THE DEFAULT. CAN BE CHECKED FOR THE ACTUAL WINDOW SIZE AFTER THE CALL WNDST :* 202K MAP IT AND ALLOW WRITE ACCESS CRAW ( WNDB > CREATE AND MAP THE WINDOW IOERR END <* This part concerns with random access of a 32kword chunk of rnemory(regIon) . The region is "looked at" through a 4kword window which starts at 160000k absolute address in the Magic task. The region can be viewed as 256 x 256 area where each byte corresponds to a (X,Y) set of coordinates. The main access routnes will be: - MRDPIX ( X , Y ) for reading a value - MWRPIX ( X , Y , VAL ) for writing a value Additional routine are provided for setting up the windowing scheme and filling the region with data from the disk *> integer YLOW , YHIGH ; the Y coordinates cor esponding to the first and ; last raster in the current window relative to ; whole region. <* ATTRG ( REGNAM , VADDR ) att chess a named region and an initial mapping of a 4k window at the begining of the region *> define ATTRG integer REGNAM VADDR AREGION ( REGNAM ) ; create a 32kwords dynamic region. CWNDOW ( VADDR , REGID , 20OK . 0 > ; create a window at 160000 absolute address ; of 4k words. Map it at the offset 0 in the ; region YLOW :« 0 ; init to the very first raster YHIGH :» 31. ; init to 32-nd raster end .mac (* PIXVAL :« MGPIX ( X , YREL ) gives the value of the pixel given the relative coodinate in the window and the X. *) entry MGPIX integer mov (asp)t rl Y-coo - -.-. I add rl , rO ; relative address from begiinig of the window mov β # ptr ( MEM_REC ) , r2 ; Add active record base address add So WNDADR (r2) , rO olr rl bisb. (rO) , rl ; get the pixel value mov l , -(msp) ; retur'n argument next <* MPPIX ( X , YREL , PIXVAL ) gives the value of the pixel given the relative coodinate in the window and the X. *> entry MPPIX mov (m«p)+ , r2 ; value to be w it en mov <msp)+ , rl ; Y-coo mov (mcp)t , rO ; X-cσo swab rl ; Y * 256. add rl , rO ; relative address from begiinig of the window mov β # ptr ( MEM_REC ) , r3 ; Add active record base address add So WNDADR (r3) , rO ovb r2 , (rO) ; return argument next i* YREL :» REMAP (-Y-COO ) gives the relative coordinates in the region corresponding to Y-COO. It remaps the window if required. «> <* define REMAP integer integer YCOO if ( not elm ( YCOO , YLOW , YHIGH > ) YLOW :» Ishift ( urshift ( YCOO , 5 ) , 5 ) ; YCOO / 32.*32. YHIGH :» YLOW + 31. ; 32 rasters per window WNOOFF :- YLOW » 4 ; OFFSE in region is YLOW«256/64 MAPW ( WNDB ) ; remap the window in the same region endif REMAP :« YCOO - YLOW output YREL end *> entry REMAP integer mov (msp) , rO Get desired line number emp rO , 9 # ptr ( YHIGH ) If it is ) YHIGH bgt *»» go to 9t (Remap ) . emp rO , θ # ptr ( YLOW ) Else If it is )« YLOW bge B , go to 8$ (No remap) 9S : bic t 37k . rO Form YLOW. mov rO . β * ptr ( YLOW ) Store YLOW in YLOW . mov rO , β t ptr ( YHIGH > Store YLOW + 3 1 . i n YH I GH . suesT.TU |i-*-"r add t 31 β # ptr ( YHIGH ) asl rO Multiply YLOW by 4. asI rO mov * # ptr ( MEM_REC ) rl ; Active MEM_REC address -> rl mov rO , Jo WNDOFF (rl) Place YLOW * 4 in current WNDOFF. mov rl , —(msp) Push active address add t $0 WNDAPR , (msp) + WNDAPR offset. (WNDB pointer) mo # base MAPW , r3 Load base address of MAPW routine. -fsr pc , xeq Execute the MAPW (Remap). 8* : bic « 177740k , (msp) Return line number - YLOW. next . end <* PIXVAL :« « MRDPIX ( XCOO , YCOO ) reads a pixel at XCOO.YCOQ *> define MRDPIX integer integer XCOO YCOO MRDPIX :* MGPIX.( XCOO , REMAP ( YCOO ) ) en (* MWRPIX ( XCOO , YCOO , PIXVAL ) writes a pixel at XCOO.YCOQ *) def ine MWRPIX integer XCOO YCOO PIXVAL "MPPIX ( XCOO , REMAP ( YCOO ) , PIXVAL ) end This part deals with filling in the region with data from the disk *) record WNO_REC integer WNDARR ( 0 > the window is looked at as an array end ecord <* FILLREC ( IMFILE ) fills th* region with the data provided from th* image file IMFILE. It assumes previous call to INITRG ; i.e. region and fist window mapped * > define FILLREC integer IMFILE loca 1 integer IWNDARR IMCH char PNAME ( 30 ) with M_EDGE ATTRG ( "EDGIMG" , 160000k ) ptr ( WND_REC ) :« WNDADR set begining of the array at window virtual address mvstr ( "dm3: C5, 13" , PNAME > coneat ( PNAME , IMFILE > concat ( PNAME , ' . IM ) IMCH :« OPEN ( PNAME , 'R > REMAP ( 0 ) iter 8. REMAP ( YLOW ) ; ; drop IWNDARR of iter 32. ; fill in a window ; read a raster of 256 bytes from IMFILE into WNDARR at IWNDARR rds ( IMCH , PTR ( WNDARR ( IWNDARR ) ) , 256. ) drop IWNDARR +« 128. ; next blok loop YLOW +» 32. 1 oop close ( IMCH ? DRECION en de f ine REGFILL integer IMFILE loc l integer IWNDARR RDBLK IMCH char PNAME ( 30 ) wi th M_EDGE ATTRG ( "EDGIMG " , 160000k ) pt r ( WND_REC ) : - WNDADR set begining of the array at window virtual address mvstr ( "dm3 : C 100, 1003" , PNAME ) concat ( PNAME , IMFILE ) concat ( PNAME , ' . IM ) IMCH :- OPEN ( PNAME . 'R ) RDBLK OFF REMAP ( 0 ) i ter 8. REMAP ( YLOW ) drop IWNDARR off iter 16. ; fill in a window ; read a raster of 256 bytes rom IMFILE into WNDARR at IWNDARR rdb ( IMCH , RDBLK , PTR ( WNDARR ( IWNDARR ) ) , 1 ) drop INCREMENT RDBLK IWNDARR +- 256. , next blok loop YLOW +» 32. loop close ( IMCH > end FLUT.MG — LOOKUP TABLE SETUP ROUTINES FOR THE LEXIDATA 3400 CL CLRMAF CS RGS GOUT RGOUT SETNIL RECT STEP SETUP 8SETUP SETUP »> <* Variable section: RED, GREEN, and BLUE are the memory locations in the Lexidata memory at which the lookup tables start for each color. ALL is a wildcard to effect action for each color. TPLANE, GFLANE, and IPLANE are arguments for DSCHAN, the channel enabling primitive. *) integer RED GREEN BLUE ALL TPLANE GPLANE IPLANE RED :» 1024 GREEN :« 2048 BLUE :» 3072 ALL on CL — maps the intensity index (GLIN) into the intensity value (CLOUT) to be represented by the Lexidata. For this command to be meaningful, CLIN must be between 0 and 2S5, 1024 and 127?, 2048 and 2303, or 3072 and 3327. Only the LSB of CLOUT will be used. =) GL ( GLIN GLOUT ) «) define GL integer GLIN GLOUT dsllu ( GLIN GLOUT GLIN GLOUT ) end <* CLRMAP — sets every intensity index between 0 and 4095 to the input argument LEVEL. There is no harm in setting intensity indices that are not used, i.e. out of the range of th* memory reserved for each color. —> CLRMAP ( LEVEL ). *> define CLRMAP integer LEVEL dsllu ( 0 . LEVEL , 4095 , LEVEL ) end o GS — sets a ramped lookup table with a variety of arguments. GS takes as input (1) no arguments (2) 1-3 color names (RED, GREEN, or BLUE) or (3) ALL. (1) GS will set up the black-and-white lookup table, from 0 to 255. (2) GS /RED /GREEN /BLUE will set up the lookup table starting at the appropriate memory location. (3) GS ALL will set up all four lookup tables. GS only sets those intensities used by the Lexidata. If in 6-bit mod only intensities « 0(mod 4) will be set All others will be set to 255 (maximum intensity) . -»> CS /RED /GREEN /BLUE /ALL *> define CS command integer COLOR local integer TEMPI TEMP2 if ( cmdcnt a-0 ) -dsllu ( 0 , 0 , 25S , 255 > else TEMP2 : m TPLANE + GFLANE + : if ( COLOR «« -1 ) CLRMAP ( 255 ) iter 4 TEMPI :- 1024. * I iter 256 this sets the lookup tables by GL ( TEMPI + 1 , 1 ) looping with the right index, loop ( TEMP2 ) as defined by TPLANE and GPLANE. loop else iter cmdcnt dsllu ( COLOR , 255 COLOR 255 , 255 ) iter 256 this sets the lookup tables by GL ( COLOR + 1 , 1 ) looping with the right index, loop ( TEMP2 ) as defined by TPLANE and GPLANE. nx tar g 1oop endif endif end <* RGS works much the same way as CS does, accepting the same arguments, but setting the lookup tables in a downward ramp, i.e. , the higher the intensity index, the lower the intensity value. If in 6-bit. ode, all unused indices are set to 0. «»> RGS /RED /GREEN /BLUE /ALL . - «> define RCS command integer COLOR loc l integer TEMPI TEMP2 if ( cmdcnt «»0 > dsllu ( 0 , 255 , 255 , 0 ) else TEMP2 :- TPLANE + GPLANE + 1 if ( COLOR -- ALL ) CLRMAP ( 0 ) iter 4 TEMPI :» 1024 * I iter 256 C- l.! t? ?"T* s . e -a- * CL ( TEMPI + loop ( TEMP2 > loop eIse iter cmdc t iter 256 GL ( COLOR + loop ( TEMP2 ) n t loop endif endif end <* GOUT and RCOUT are merely selectors of GS and RCS. «.> GOUT »»> RGOUT *) define GOUT GS ALL end define RGOUT RCS ALL end <* SETNIL — iβroes all used indices within the input color table. Used in RECT and STEP to set the indices not chosen to sero. Input is a color, or a memory location at which to start setting indices to zero. If input i s not a color, it must be <» 3739 (256 slots from the highest allowable slot). ALL may not be used with SETNIL. »»> SETNIL ( /RED /GREEN /BLUE or 0 to 3739 ) *> define SETNIL command integer COLOR iter 256 GL ( COLOR + 1 , 0 ) loop ( TPLANE ♦ GPLANE 1 > end <« RECT — creates a binary lookup table in a certain color, either 0 or 255 depending on the limits. The first two arguments are the indices to set to the maximum and the third is the color table in which to work. The first argument must be < - th* second argument. ALL may be used as a wildcard, but only one color argument is allowed. «> RECT ( 0-255 , 0-255 , /RED 0 LO HI 1023 /GREEN /BLUE i ! 255 /ALL ) ! ! 0 •) SUBSTITUTE SHEET d e f i ne RECT integer LO HI COLOR if ( COLOR =« -1 ) CLRMAP ( 0 ) dsllu ( LO . 255 HI 255 ) dsllu ( RED LO 255 . RED + HI 255 ) ds llo ( GREEN ι LO , 255 , GREEN + HI , 255 dsl lu ( BLUE + LO , 255 , BLUE + HI , 255 > else SETNIL COLOR ds 1lu ( * COLOR + LO 255 COLOR + HI 255 ) endif end (J! STEP -- a limited version of RECT in which all indices are divided into two regions, instead of three. The first input is the index before which all values should be xero and after which all values should be set to 255 NOTA BENE: the first input is a RELATIVE index, from 0 to 255, not from 0 to 4095. The second input is a color table within which to make the changes. ALL may be used with STEP. •.«) STEP ( 0-255 , /RED 0 THR. 1023 /GREEN /BLUE I 255 /ALL ) ! 0 * > define STEP integer THRESH COLOR if ( COLOR -=- -1 ) CLRMAP ( 0 ) i tec 4 RECT ( THRESH , 255 , 1024 * I ) loop else SETNIL COLOR RECT ( THRESH , 255 , C COO.LOR > endif end <* 8SETUP and 6SETUP set the plane mask variables and call SETUP. »«> 8SETUP ««) SETUP *> define 8SETUP TPLANE off ; if we -are coming from 6-bit mode, set TPLANE GPLANE off ; and GPLANE to 0 , and IPLANE to 255, or IPLANE :« 377K ; 8 planes enabled for th* Lexidata. DSCHAN ( TPLANE , GPLANE , IPLANE > DSCLR ( TPLANE ^ GPLANE ) DSLLU ( 0 , 0 , 255 . 255 ) DSLLU ( RED , 0 , RED + 255 , 255 ) DSLLU ( GREEN , 0 , GREEN + 255 , 255 SUBSTITUTE SHEET DSLLU ( BLUE BLUE + 255 255 ) snd define 6SETUP TPLANE :« 1 if we are co ing from 8-bit mode, set TPLANE GPLANE : * 2 and GPLANE to 1 and 2 espectively, and then IPLANE :» 374K set IPLANE to 252, or 6 planes enabled for DSCHAN ( TPLANE , IPLANE IPLANE ) DSCLR ( TPLANE + GPLANE ) GOUT e d <* «*n««t«««««»»»*«ι«»«ttιι»««t«»ι*««n*ιr»«r>:** > ι«ιιι»»»««t«ι««»«« > ;«»ιr*«!iι FXMON - INTERFACES TO THE STANDARD FIRMWARE "IACMON.XB" **x**xxxxx*xx***x**x**xxxx*x*x**xxxxxxx*****xxxx«xxxxsx**xx*x*x**x*xxx x) APUSH RADIX OCTAL INTEGER LEXIOFLG FLAG TO TELL WBUSY WHETHER TO WAIT FOR OUTPUT OR INPUT <* X* XXX XX* IttmitJIltttttl IJItttltOO UttXXItJI «< XXXXX XXXXXXXXXXXX* DMA TRANSFER ROUTINES (COMMAND 10) XXX****X**X**X*XX*****X****XXXXXX*XX**XXX*******X**X*******X X*XX**XX* *> <* DEFINE DMACT ACTION INTEGER ARGl ARG2 ΛRG3 ARG4 ARG5 INTECER OCODE ( 1 ) WDOAS ( OCODE ( 0 ) > WDOAS ( DCHAD ( ARGl ) ) WDOAS ( ARG2 ) WDOAS ( — ARG3 ) WDOAS ( BYTEWD ( ARG5 , ARG4 ) ) END *> (* WBUSY — WAIT FOR INPUT/OUTPUT FROM LEXIDATA *> DEFINE WBUSY IF ( LEXIOFLG ) DSOWT ELSE DSIWT ENDIF END • * » - r - « ** « - - (* DMAW — WRITE SEQUENTIAL PIXELS WITHIN AN AREA. WORD MODE CALL: DMAW ( BUFFER , XO , XL , YO , YL > *> DEFINE DMAW INTEGEB BUFFER ( 1 ) AXO AXL AYO AYL DSLIM ( AXO , AYO , AXO + AXL - 1 , AYO + AYL - 1 ) DSPUT ( BUFFER , AXL * AYL ) LEXIOFLG ON END (* DMAR — READ SEQUENTIAL PIXELS FROM DISPLAY INTO BUFFER. WORD MODE CALL: DMAR ( BUFFER , XO , XL , YO , YL ) *> DEFINE DMAR INTEGER BUFFER ( 1 ) AXO AXL AYO AYL DSLIM ( AXO , AYO , AXO + AXL - 1 , AYO + AYL - 1 ) DSGET ( BUFFER , AXL * AYL > LEXIOFLG OFF END DEFINE PDMAR INTEGER BUFFER AXO AXL AYO AYL END DEFINE PDMAW INTEGER BUFFER AXO AXL AYO AYL END (* WRPIX - WRITE A SINGLE PIXEL CALL: WRPIX ( IX , IY , LEVEL «> DEFINE WRPIX INTEGER IX IY LEVEL LOCAL INTECER ARR ( 3 ) ARR < 0 > :a XX ; ; ARR ( 1 ) :-. IY ; ; ARR ( 2 ) :-■ LEVEL DSRNW ( 1 , ARR ) END (* RDPIX READ A SINGLE PIXEL CALL : LEVEL :■ RDPIX ( IX , IY > «> DEFINE RDPIX INTEGER INTEGER IX IY LOCAL INTEGER ARR ( 2 ) ARR ( 0 ) :» IX ARR ( 1 ) :. IY DSRNR ( 1 , ARR PTR ( RDPIX > ) ' END <« GBAR FILL A BLOCK OF PIXELS CALL: GBAR ( XO , XL , YO , YL LEVEL ) ») DEFINE GBAR INTEGER AXO AXL AYO AYL LEVEL sfr γ , VvIi SUBSTITUTE SHEET NA IF ( AXL «-0 > RETURN ENDIF DO AYO , MIN ( AYO + AYL - 1 , 511. ) DSVEC ( AXO . I , MIN ( AXO + AXL - 1 , 637. ) , I , LEVEL ) LOOP END DEFINE BLKSUM LONG INTEGER ARGl ΛRG2 ARG3 ΛRG4 ARG5 END (* Define DELAY function using RSX MarS Time directive and Wait for Global Event Flag directive, make 'MRKTS rsxcall bytewd ( 5 , 23. ) make 'STSES rsxcall bytewd ( 2 , 135. ) integer MRKTS ( 0 ) .word bytewd ( 5 , 23. .word 23. .bIkw 1 .word 1 .word 0 integer WTSES ( 0 ) .word bytewd ( 2 , 41. .word 23. define DELAY integer DTIM MRKT* ( 2 ) :» DTIM * 6 RSXDIR ( MRKTS ) ioerr RSXDIR ( WTSES ) ioerr e d APOP T apush radix octal ( * Subroutne 22BADDR does • conversion of the 16-bit virtual address supplied as argument into a full 22-bit physical address of the O-bus. The MMU user map registers are used for this purpose so this subroutine must be used in a magic/I environment linked to the I/O page. For how to link to the I/O page see MGLIOP.CMD file. input: 16 bit word representing the virtual address output: long(32-bit) word representing the 22-bi t address as foilowin : - Is part is the low 16-bits - ms part is the high 6 bits multiplied by 2. note: this format was chosen to correspond to the CCD CAMERA CONTROLLER bui ld by Zvi Orbach. More bit manipulations might be required if used with other devices, calling sequence: long 22b i tadd s 22bitaddr :» 22baddr ( ptr ( buff ) ) *> .mac ; the user map e ister add esses in i / σ page label UPAR ; , .word 177440k label UPDR ; ; .word 177600k entry 22ADDR long ov (msp ) , r0 ; get the virtual address mo rO , rl ; rol rO ; isolate the APF ( Active Page Field > rol rO rol rO rol Γ0 ; bic f 177770k , rO ; in rO as I 1 rO . e en bi c * 160000k , rl ; isolate DP ( Displacement Field ) in r 1 mov rl , r3 ; sa e 1 t bic # 177700k , rl ; isolate the displacement in block ash * 177772 , r3 ; block * in page add UPAR , rO ; get the co esponding FAR addr in i/o page add (rO) , r3 ; 16 bits physical address in blocks elr r2 ; < r2,r3 ) will be the 22 bit physical addr ache tt 6 , r2 ; make place for the additional 6 bits add r 1 , r3 ; finally... the 22 bit address mo r3 , (msp ) ; least significant portion of the address asl r2 ; CCD camera controller format mov r2 , - (ms ) ; push the extra 6 bits in the stack next . end apop SUOGT.TOTE SHEET parameter WCR 172410k DMA word count register. parameter BAR 172412k Bus address register for DMA . parameter CSR 172414k Control status register. parameter DBR 172416k Data buffer register. long PHYADR Physical (22-bit) address of the buffer record DMALINE integer LNBUF ( 256. ) end eco DMALINE INLN < 2 ) integer OUTLN ( 256. ) char PNAME ( 30. ) integer TXO TYO integer IFN ( 10 ) IDPN ( 20 ) integer VCH integer CFLAG CFLAG off (* Wait until DMA operation is complete, (Monitors EUSY bit.) *> define WBUS?Y while ( peek ( CSR ) AND 200k ) epeat end define RDLN integer BUFF ( 1 ) x O xl yO y PHYADR :» 22ADDR. ( BUFF ) poke ( 130000k + X0 - 1 , DBR > poke ( 114000k + Y0 . DBR ) poke ( — XL / 2 , WCR ) ; poke ( — < XL * YL ) , WCR ) poke ( lsword ( PHYADR ) , BAR > poke < 0 , DBR ) poke ( msword ( PHYADR ) + 1 , CSR ) end ( * define WRTLN integer X0 Y0 LEN if ( CFLAG «»0 ) poke 130000k X0 DBR ) poke 134000k Y0 DBR > else poke 132000k X0 DBR ) poke 136000k Y0 DBR ) endif iter LEN pokβ ( ( OUTLN ( i ) and 777k ) + 120000k , DBR > loop end *) vst r ( ' dm3 : f.5 , 1 i IDPN ) define IMAGEFN i te e ARGl mvstr ( ARGl , IFN ) mvstr ( IDPN , PNAME ) mconcat PNAME , ARGl ti¬ print str ( PNAME ) end de fine VDRAW integer FNAME X0 Y0 local integer BUFPTR IMAGEFN ( FNAME ) VCH : -- open ( PNAME , 'r ) BUFPTR off do Y0 , Y0 + 255. if ( rds ( VCH , OUTLN , 256. ) <) 256. ) print "WARNING: Unexpected end of file' exi else t MVBYWD ( OUTLN , 0 , INLN ( BUFPTR 256. DMAW ( INLN ( BUFPTR ) , X0 , 256. , 1 BUFPTR : « 1 - BUFPTR en i loop WBUSY close ( VCH > end define REDRAW VDRAW ( IFN > end define VSAVE integer FNAME local integer BUFFI BUFF2 with M_EDCE ATTRG ( " IOPAGE" , 160000K ) IMAGEFN ( FNAME ) VCH :- open ( PNAME , " rwct > BUFFI :» ptr ( INLN ( 0 ) ) BUFF2 :« ptr ( INLN ( 1 > ) RDLN ( BUFFI , 128. , 256. , 128. 1 ) do 12?. , 384. WBUS7Y RDLN ( BUFF2 , 128. , 256. , i , 1 ) WRS ( VCH , BUFFI , 256. ) XCHG ( ptr ( BUFFI ) , ptr ( BUFF2 ) loop WBUS?Y DREGION close ( VCH ) end define GRABIM integer XO YO local integer BUFPTR with M_EDGE ATTRG ( "IOPAGE" . 160000K ) BUFPTR off . poke ( 1000k , DBR ) delay ( 1 ) poke ( 0 , DBR ) do 128. 383. WBUS?Y RDLN ( INLN ( BUFPTR ) , 128. . 256. , i , 1 ) MVBYWD ( INLN ( BUFPTR ) , 0 , OUTLN , 256. ) DMAW ( OUTLN , XO , 256. , YO ♦ i - 128. , 1 > BUFPTR :χ 1 - BUFPTR loop WBUSY DRECION end (* integer BLKBUF ( 0 ) .word 39. .word 1 - 256. / 2 .blfcw 128. define PDMAW ' integer BUFFER ( 1 ) mvwds ( BUFFER , BLKBUF -t 4 , 128. ) DSOWT DSBLOC ( BLKBUF , 130. ) end *> define {DRAW integer TXO TYO local integer IWNDARR LNCNT DSLIM ( TXO , TYO , TXO * 255. , TYO + 255. ) YLOW :« 32. iter 25 . REMAP ( i ) drop IWNDARR :» WNDADR iter 32. MVBYWD ( IWNDARR , 0 , OUTLN , 256. ) DSPUT ( OUTLN , 256. ) WBUSY IWNDARR += 256. loop loop ( 32. ) REMAP ( 0 ) drop end define DRAW wi th M_EDGE ATTRG ( "EDGIMG' 160000k ) tDRAW DREGION end de ine MDRAW with M_EDGE ATTRG ( "MTCHIM" 160000k ) .DRAW DREGION end define MSAVE integer FNAME local inte βr OUTCH IWNDARR PNAME ( 15. mvstr ( "dm3 : 200 , 2001" . PNAME ) concat ( PNAME , FNAME ) concat ( PNAME , ' . i ) OUTCH :« open ( PNAME , ' rwct ) with H_EDGE ATTRG ( "EDGIMG" , 160000k ) YLOW :» 32. iter 256 • REMAP ( i ) drop IWNDARR :» WNDADR iter 32. WRS ( OUTCH , IWNDARR , 256. ) IWNDARR +« 256. loop loop ( 32. ) REMAP ( 0 ) drop DREGION close ( OUTCH ) end <* Global event flags for synch onisation. TASK holds the name of the task with whom we are communicating. THESE MUST BE CLOBAL *) integer SYNC1 SYNC2 TASK ( 2 ) <* Define executive directives to be used for tasking with Control *) make 'WAIT rsxcall bytewd ( 2 , 41. ) make 'CLEAR rsxcall bytewd < 2 , 31. ) make 'READ rsxcall bytewd ( 2 , 37. ) make 'SET rsxcall bytewd ( 2 , 33. ) make 'RCVD$ rsxcall bytewd ( 4 , 75. ) make 'SDATϊ rsxcall bytewd ( 5 , 71. ) (* Execute a subroutine call , the arguments and subroutine name are in BUFF. BUFF contains. TASKl . TASK2 , 0 or -2 , eλRGS , argl , arg∑ , .. argn , βubroul ine TASKl and 2 make up the taskname of the caller *) define DOROUTINE integer BUFF ( 1 ) l oc a l integer ADR OFFST OFFSTl OFFST :» 4 OFFSTl : - 0 if < BUFF ( 2 ) ) ptr ( BUFF ( 4 ) ) OFFSTl :* 1 OFFST : - OFFST + length ( ptr ( BUFF ( 4 ) ) ) / 2 + l end i f lookup ( ptr ( BUFF ( BUFF ( 3 > + OFFST - OFFSTl ) ) ) ; ; ADR :■ lastworc DROP iter BUFF ( 3 > - OFFSTl C BUFF ( I + OFFST ) ? ; store args on stack loop exec ( ADR > end (* Send a buffer of data to the task we are connected to. BUFF ( 0 ) must be greater than 0. This can be used in the receiver as a code for what data has been sent . The buffer can be no longer than 13 words. *) define SEND integer BUFF ( 1 ) SDATS C TASK ( 0 ) , TASK ( 1 ) , BUFF , SYNCl ) ; , ioerr WAIT ( SYNC2 > CLEAR ( SYNC2 ) end <* Receive data from that task we are connected to and put it in a buffer Call: RECEIVE ( BUFFER ) Note: if these routines are overlaid , BUFFER must be global. The buffer must be at least 15 words. BUFFER contains: TASKl , TASK2 . CODE , DATA ' where TASKl AND 2 make the name of the task which is sending the message. CODE is 0 if we are calling a rcutine, -1 if the other task is informing us of its rundown, and >Q if other data has been sent *> define RECEIVE integer BUFF ( 1 ) WAIT ( SYNC! ) CLEAR ( SYNCl > RCVDJ ( 0 . 0 , BUFF ) ;; ioerr if ( BUFF ( 2 ) «» -1 ) rundown SET ( SYNC2 ) acknowledge receipt if ( BUFF ( 3 ) »=0 ) bye else return endif else if ( BUFF ( 2 ) -«0 or BUFF ( 2 > m. -2 ) DOROUTINE ( BUFF ) endi f SET ( SYNC2 > endif end ( * Set up communications with the task that requested us. receives the two flags that the tasks will use for synch o iz tion. and the name of the task with whom we are communic ted. Any task that gets connected to must issue an INITREC command before p oceeding . *> define INITREC local integer BUFF ( 15 ) det term RCVDt ( 0 , 0 , BUFF ) ; ; ioerr i ter 2 TASK ( I ) :« BUFF ( i ) loop SYNCl :- BUFF C 2 ) SYNC2 :* BUFF ( 3 ) SET ( SYNC2 ) end EXT DISPMODEL EXT WFMP EXT BLBDISP blob bounding rectangles EXT HAROLD integer STPFLAG integer VIDCBF ( 15. ) def in* CONNECT_2_MASTER INITREC begin RECEIVE ( VIDCBF ) until ( STPFLAG > end define RECONNECT SET ( SYNC2 ) begin RECEIVE ( VIDCBF ) until ( STPFLAG ) end integer TMPICH TMPOCH -STJ R Ec def ine STOPCO integer TERM TMPICH :« cich TMPOCH :« cooh coch :« cich poke ( 2 , fdb ( ooch ) ) at term STPFLAG on end define STRTCO de11erm elose ( cich ) cich :« TMPICH coch :« TMPOCH STPFLAG off RECONNECT end define INITVID INITD CONNECT_2_MASTER end .RESTART :- base INITVID ; entry point for VIDEOT.TSK SAVE WFVIDEOT parametβr MAX_#_ENT :« 20 Maximum * of permissible entities. parameter »POINTS :« 25 Maximum t of points permitted within an enti y. record POINT_REC integer XI YI Coordinates of first corner point. integer CURTYPE Type of the line between 1st and 2nd point integer XJ YJ Coordinates of second point. integer NXTTYPE Type of th* next line (between 2nd and 3rd) dummy -3 end ecord record ENTITY integer *PTS tt cf point . FOINT_REC 21 ( #P0INTS ) See record POII'TS. endrecord record FRAME_REC integer FRMt ; Frame # . integer #ENT ; * of ent it ies ENTITY El ( MAX_#_ENT integer HX1 HXr. H 1 HV2 Horizontal landmark points. integer VXl VX2 VY1 VY2 Vertical landmark points. intβς÷r HX3 HX4 H 3 H 4 Horizontal landmark points. integer VX3 VX4 VY3 VY4 Vertical landmark points. end ecord define DISFMODEL integer TXO TYO GBAR ( TXO . 254. , TYO 254 . GRNGL ) with M_EDGE ATTRG ( "MODELR" , 160000k ) tr C FRAME. _REC ) : » WNDADR iter #ENT with El ( i ) it*r #PTS - 1 with : ZI ( i ) DSVEC ( I + TXO , Yl + TYO , XJ * TXO , YJ + T O , REDGL loop loop DSVEC ( HX1 ♦ T O , HY1 + TYO , H 2 + T O , HY2 + TYO , REDGL > DSVEC ( VX1 + TXO , VY1 + TYO , VX2 + TXO , VY2 + TYO , REDGL > DSVEC ( HX3 + TXO , HY3 + TYO , H 4 + TXO , HY4 + TYO , REDGL ) DSVEC ( VX3 ♦ TXO , VY3 + TYO , VX4 + TXO , VY4 + TYO , REDGL ) DREGION end (* Display the Wafer Map module * > <* Attachβment to the Inspection Plan »> MEM_REC M_IPSDB define ATIPSDB with M_IPSDB ATTRG ( "IFSDBR" , loOOOOK ) ptr ( IPSDB_REC ) :» WNDADR end integer MPXO , MPYO the origin x,y of the wafer map on the screen integer MPRAD the map size on the screen real MPSCL • pixel /mi eron integer XPI YPI the pit ches integer STH AVW str and ave sizes integer DIH DIW ie sizes integer XROW YROW current row to display i teger CLDI E the gray level at which the die boundaries are display ed integer GLCIR ; the gray level of the circle integer CROSX ( MAX_RETICLES ) ; x location of the marker for the die being ins pec ted integer CROSY ( MAX_RETICLES ) ; y location of the marker for the die being ins pect ed <* Get the current row coordinates *) define GROWCOO integer ROW COL XROW :» MPXO + COL * XPI YROW : « MPYO * ROW * YPI end define GTORG integer XO YO SZ with FLAT_TO_O IGIN MPXO :» XO s- ( SZ - fix ( float ( X > » MPSCL ) ) MPYO :« YO + fix ( float ( Y ) * MPSCL ) end define BOX integer XDI , YRO , GL DSVEC ( XDI , YRO , XDI + DIW , YRO , GL ) DSVEC ( XDI , YRO + DIH , XDI + DIW , YRO + DIH , GL ) DSVEC ( XDI , YRO , XDI , YRO + DIH • , GL ) DSVEC ( XDI + DIV , YRO , XDI + DIW , YRO + DIH , GL > end de ine WFMAP Integer XO , YO , SZ loc l integer XDIE ATIPSDB GLDIE GRNGL GLCIR .* GRNGL wi th INSF '_PLN wi th : HEADER wi th I SE '_DATA_ .BASE SZ -« 10. XO ♦» 5 YO ♦« 5 MPRAD : SZ / 2 MPSCL :> float ( MP! / ( float ( WAFER_SZ ) * 500.0 ) XPI :- fix ( DIE_X * MPSCL ) YPI :« fix ( DIE_Y « MPSCL ) with LAYERS ( CUR_LAYER ) with DTL_LAYER_REV ( #_REVS - 1 ) with L_RETICLE with RETICLE_DIE STH D_ST_HGT AVW D_AV_WDTH DIW YPI - fix float ( AVW ) » MPSCL ) DIH XPI - fix float ( STH ) * MPSCL ) GTORG ( X0 Y0 MPRAD ) iter *_DIE_ROWS with WAFER_MAP ( i ) CROWCOO ( l , 1ST_D_« XDIE :« XROW iter LAST_D_# - 1ST_D. BOX ( XDIE , YROW , GLDIE ) XDIE XDIE + XPI loop loop DSCIR ( ( X0 + MPRAD ) , C Y0 + MPRAD > MPRAD GLCIR ) with REFERENCE_DIE GROWCOO ( ROW , CLMN ) GET COORDINATES OF REFERENCE_DIE BOX ( XROW , YROW , BLUGL DRAW IT IN RED with L_INSPECTION GET RETICLES TO INSPECT iter *_TO_INSP wi h INSP_R ( l ) GROWCOO ( ROW , CLMN ) CROSX ( i ) :» XROW + DIW / 2 - 2 CROSY ( i > :■ YROW t DIH / 2 - 3 BOX ( XROW , YROW , REDGL ) loop DREGION end define DISPX integer XO YO GL DSSAO ( XO YO GL 0 1 ) DSTXT ( "X" ) end define SHOWDIE ATIPSDB if ( I-MODE «■» PRIMARY ) ' DISPX ( CROSX ( CONFIRM > CROSY ( CONFIRM ) , 0 ) DISPX ( CROSX ( PRIMARY ) CROSΫ ( PRIMARY ) , REDGL ) else DISPX ( CROSX ( PRIMARY > CROSY ( PRIMARY ) , 0 ) DISPX ( CROSX ( CONFIRM ) CROSY ( CONFIRM ) , REDGL ) endif DREGION end define DMESSΛGE address MESS GBAR ( 0 288. 254. 90. 0 ) DSSAO ( 32. 320 REDGL 0 2 ) DSTXT ( MESS ) end define ACQMSG DMESSAGE < "IMAGE ACQUISITION" end define IPRMSG DMESSAGE ( "IMAGE PROCESSING" ) end define MDLMSG DMESSAGE ( "MODEL MATCHING" ) end define DFTMSG DMESSAGE ( "DEFECT ANALYSIS" > end define ENDMSG DMESSAGE ( "THAT'S ALL FOLKS!" ) end integer MINXO MINYO MAXXl MAXYl define BOUND DSVEC ( MINXO 1 , MINYO - 1 , MAXXl + 1 , MINYO - 1 , REDGL > DSVEC ( MAXXl 1 , MINYO - 1 , MAXXl + 1 , MAXYl + 1 , REDGL ) DSVEC ( MAXXl 1 , MAXYl + 1 , MINXO - 1 , MAXYl + 1 , REDGL ) DSVEC ( MINXO 1 , MAXYl + 1 , MINXO - 1 , MINYO - 1 , REDGL > end define BNDRCTS integer TXO TYO ATIPSDB with 1NSP_DATA_BASE TXO * * REG_X TYO +« REG_Y with INSP_PLN wi th LAYERS ( MOD LAYER with DTL_LAYER__REV ( t_REVS - 1 ) with L_RETICLE with RETICLE_DIE with D_PATTERNS ( MOD_PATTERN ) with INSP_FR ( MOD_SITE ) with F_DEFCTS MOD_FRAME ) print "No of Defects #_DFCTS iter #_DFCTS with DEFECTS ( i ) MINXO :- XCOM - DELX + TXO MINYO YCOM - DELY + TYO MAXXl XCOM + DELX + TXO MAXYl YCOM + DELY + TYO BEEF BOUND DELAY ( loop DREGION end de ine DRAWBOX integer XO XL YO YL GL local integer XI Yl XI :- XO + XL sets up the new coordinates of the Yl :» YO + YL right bottom dsvec ( O , YO . XI , YO , GL > draws the new box according to specs dsvee ( XI , YO . XI , Yl , GL ) dsvec ( XI , Yl . O , Yl , GL ) dsvec ( XO , Yl . xo , YO , GL ) end define LOWMAG DSCLR ( 255. ) VDRAW ( 'JOE 32. 256. ) iter 6 DRAWBOX ( 201 , 24 . 346. + ( I 24 ) 24 REDGL ) LOOP PAUSE end define LMAG ATIPSDB GBAR ( 520. . 30. 345 , 150 0 ) DRAWBOX ( 521. , 24 , 346. + ( ( 5 - CUR FRAME ) * 24 ) 24 , BEDGL ) DREGION end define HAROLD_DEMO VDRAV ( "RNF03 32. 0 ) DRAWBOX ( 47. , 226. , 15. 226. REDCL > PAUSE DISFMODEL ( 352. 0 ) PAUSE VDRAW ( 'RNF03 352. 256 ) DRAWBOX ( 547. 17. 308. 18. REDGL ) DRAWBOX ( 428. 17. 357. 15. REDGL > PAUSE DSCLR ( 255. ) WFMAP ( 220. 56. 200 ) VDRAW ( "RNF03 32. 256. ) VDRAW ( • RCL03 352. 256 > DSVEC ( 318. 155. 32 254. REDGL ) DSVEC ( 318 155. 286. 254. REDGL > DSVEC < 348 155. 352. 254. REDGL > DSVEC ( 348. 155. 608. 254. REDGL ) DRAWBOX ( 227. 17 308. 18. REDGL ) DRAWBOX ( 547. 17 308. 18. REDGL ) end EDGE DETECTION CEDGET. C * THIS MODULE LOADS ALL OF THE MODULES USED IN "CEDGET" ************************ *> ext POP ID ext DMISC ent MAKAP ext EDGREG ext APDECL est I ITAP ext APEDGE ext EOGCOM integer STPFLAG integer EDGCBF ( 15. > define CONNECT_2_MASTER INITREC egin RECEIVE ( EDGCBF ) until ( STPFLAG ) end define RECONNECT SET { SYNC2 ) begin RECEIVE ( EDGCBF ) until ( STPFLAC ) end integer TMPICH TMPOCH define STOPCO integer TERM TMPICH :» cich TMPOCH :» coch cich :» open ( TERM , ' rwa coch :« cich poke ( 2 , fdb ( coch ) ) at term STPFLAG on end define STRTCO det term cIose ( c ich ) cich :« TMPICH coch :« TMPOCH STPFLAG off RECONNECT end define EDGEINIT wi th M_EDCE ATTRG ( "EDGIMG" , 140000k ) . CONNECT_2_MASTER end mvstr ( 'cedget , proms r > 'restart :~ base EDGEINIT i RESTART FOR EDGE DETECTION PROGRAM save CEDGET ( * Nam* : APEDGE.M integer COUNT define INIT_DBF iter 40 DBF ( I ) : m I + 1 I oop end define FIRST ACHN ( ptr ( N ) FCBCHN , 500. > Pe form 1,2,1 AADD ( DBF ( 26 ) , DBF ( 18 ) , DBF ( 18 > ) hor . conv AADD ( DBF ( 26 ) DBF ( 26 ) , DBF ( 17 ) ) — > DBF < 26 AADD ( DBF ( 26 ) DBF ( 26 ) , DBF ( 19 ) ) ACONV ( DBF ( 27 ) , DBF ( 26 ) , 1 > HO —> DBF ( 27 ) ASCDB ( -2. DBF ( 26 ) > ACONV ( DBF ( 28 ) , DBF ( 26 ) . 2 ) HE — > DBF ( 28 ) AHORZ ( DBF ( 32 ) , DBF ( 27 ) DBF ( 28 ) ) HEDGE ( CUR INE ) ASUB ( DBF ( 26 ) . DBF ( 16 ) , DBF ( 20 AMULS ( DBF ( 26 ) , DBF ( 26 ) , 1 ) Equiva1ent ASUB ( DBF ( 2? ) , DBF ( 17 ) , DBF ( 1? vβr t . conv . AMULS ( DBF ( 29 ) . DBF ( 29 ) , 3 ) ; with odd mask. AADD ( DBF ( 30 ) , DBF ( 29 ) , DBF ( 26 ) ) ; VO —> DBF ( 29 ) ATFRl ( DBF ( 29 ) DBF ( 30 ) 7 ) ASCDB ( 1 DBF ( 29 ) ) AADD ( DBF ( 26 ) , DBF ( 16 ) , DBF ( 20 ) ) AMULS ( DBF ( 26 ) , DBF ( 26 > , 2 ) Equi alent AADD ( DBF ( 30 ) , DBF ( 17 ) . DBF ( 19 ) ) vert . con . AMULS ( DBF ( 30 > , DBF ( 30 ) . 5 ) with even mask. AADD ( DBF ( 30 ) , DBF ( 30 ) , DBF ( 26 ) ) VE —> DBF ( 30 ) AMULS ( DBF ( 26 > , DBF ( 18 > , 6 ) AADD ( DBF ( 26 ) , DBF ( 30 ) . DBF ( 26 ) ) ASCDB ( -1 DBF ( 26 ) ) ATFRl ( DBF ( 30 ) DBF ( 26 ) 7 ) ACEND AHIAB ( FCBCHN . 8. , N ) AXCHN ( 8. ) ARLDS ( 8. ) end define ROT_SCRATCH local integer TEMPI TEMP2 TEMP3 TEMP4 TEMP2 :« DBF ( 20 ) do 16 , 19 TEMPI :» DBF ( I' ) DBF ( I ■ > :- TEMP2 TEMP2 :« TEMPI loop DBF ( 20 > :« TEMP2 end define ROT_OUT local integer TεMPl TεMP2 TεMP2 :- DBF ( 9 > do 10 , 15 TEMPI :» DBF ( I ) DBF ( I ) :« TEMP2 TEMP2 :» TEMPI loop DBF ( 9 ) :» TEMP2 end define UPDATE ROT_SCRATCH ACHN ( ptr ( N ) , FCBCHN . 500. ) AHIAB ( BOT , DBF ( 31 ) , 128. ) AUPAK ( DBF ( 20 ) , DBF ( 31 ) > A O FI *W ADNSN ( DBF ( 20 ) ) ANRDB ( DBF ( 20 ) ) ADBDB < DBF ( 36 ) DBF C 29 ) ) ADBDB ( DBF ( 37 ) DBF ( 30 > > ADBDB ( DBF < 9 : I DBF ( 32 ) ) AZRDE ( DBF ( 34 ) ) ADBDB ( DBF ( 34 ) DBF ( 35 ) ) AZRDB ( DBF ( 35 ) ) ACEND AHIAB ( FCBCHN . 8. . N ) AXCHN ( 8. ) ARLDB ( 8. ) end define DOLINES integer KLINES iter tLINCS FIRST increment COUNT if ( COUNT < 2 ) UPDATE else AVZER ( DBF ( 36 ) DBF ( 37 ) DBF ( 29 ) DBF ( 30 ) Λ DBF ( 34 ) DBF ( 35 ) ) AORDB ( DBF ( 9 > DBF ( 34 ) ) ROT_OUT if ( COUNT ( 4 ) UPDATE else AFRUN ( DBF ( 9 ) , DBF ( 10 > , DBF ( 11 ) , DBF ( 12 ) DBF ( 13 ) DBF ( 14 > , DBF ( 15 ) ) if ( COUNT < 7 ) UPDATE else AABHI ( TOP , DBF ( 15 ) , 256. , 0 ) MVWDBY ( TOP , 0 , TOP , 256. ) UPDATE end i f endif endif ptr ( HNE_REC ) += 256. loop end define DOEDGE COUNT off INIT_DBF Initilixe AP DBF values ZERO_DBF READ INIT je zer ( VNDADR , 256. ) DOLINES ( 24. ) do 64 . , 832. WNDOFF :» i MAPW ( WNDB ) ptr ( LINE_REC ) :« WNDADR + 1024 DOLINES ( 16. > loop ( 64. ) WNDOFF :» 896. MAPW ( WNDB > ptr ( LI E_REC > :» WNDADR + 1024. DOLINES ( 19. ) iter 4 ROT_OUT APRUN ( DBF ( 9 ) , DBF ( 10 ) , DBF ( 11 ) , DBF ( 12 DBF ( 13 ) DBF ( 14 ) , DBF ( 15 ) ) AABKI ( TOP . DBF ( 15 ) , 256. , 0 ) MVWDBY ( TOP , 0 , TOP , 256. ) ptr ( LINE_REC ) +» 256. loop iter ROT_OUT AABHI ( TOP , DBF ( 15 ) , 256. 0 ) MVWDBY ( TOP , 0 , TOP . 256. ) ptr ( LINE_REC ) +« 256. loop vxer ( TOP 256. > end <* Name : APDECL.MG This routine sets up the buffers required by the AF . *) integer DBF ( 40 ) ; Data buffers coded as follows integer N ; Chaining counter integer FCBCHN ( 500. ) -Chaining space record LINE_REC char TOP ( 256. ) dummy 102 . char BOT ( 256. ) end ecord (* DBF ( I ) MEANING VALUE DBF ( 0 ) DBMO 1 DBF ( 1 ) DBME 2 DBF ( 2 ) DBM02 3 DBF ( 3 ) DBMO3 4 DBF ( 4 ) DBME2 5 DBF ( 5 ) DBME3 6 DBF ( 6 > DBFTR 7 DBF ( 7 > Chaining Buffer 8 DBF ( 8 ) Chaining Buffer 9 DBF ( 9 ) OUT1 10 DBF ( 10 ) OUT2 11 DBF ( 11 ) OUT3 12 DBF ( 12 ) OUT4 13 < OUTPUT DATA DBF ( 13 ) OUTS 14 DBF ( 14 ) OUT6 15 DBF ( 15 ) OUT7 16 DBF ( 16 ) DBF1 17 DBF ( 17 ) DBF2 18 DBF ( 18 ) DBF3 19 -- RAW DATA DBF ( 19 ) DBF4 20 DBF ( 20 ) DBFS 21 DBF ( 21 > DBF6 22 DBF ( 22 ) DBF7 23 DBF ( 23 ) DBF8 24 < FILTERED DATA DBF ( 24 > DBF9 25 DBF ( 25 ) DBFIO 26 DBF ( 26 ) DBF11 27 DBF ( 27 > DBF12 28 DBF ( 28 ) DBF13 29 < EDGE DATA DBF ( 29 > DBF14 30 DBF ( 30 > DBF15 31 DBF ( 31 ) DBFD 32 DBF ( 32 > HZER1 33 DBF ( 33 ) HZERZ 34 DBF ( 34 ) .ZER1 35 DBF ( 35 ) ZER2 36 _c-.π. " " DBF ( 36 ) VOl 37 DBF ( 37 > VE1 38 *> <* This routine initilises the data buffers in the AF with the first five lines of the raw image data *> define READ_INIT local i teger DBFl DBFl * . 17. ; AAPP rraw data buffers with M. _EDGE ptr ( LI E_REC ) :« WNDADR - 2304. WNDOFF o f MAPW ( WNDB ) ACHN ( ptr ( N > , FCBCHN , 5 Start chaining i ter 5 AHIAB ( BOT , DBF ( 31 128. (LINE) —> DBFl AUFAK ( DBFl , DBF ( 3 ) > ADNSN ( DBFl ) Determine Normalizing Coeff. ANRDB ( DBFl ) Norm.liis increment DBFl ptr ( LINE_REC ) +« 25 loop ACEND ; End chaining AHIAB ( FCBCHN , 8. , N ) AXCHN ( 8. ) ARLDB ( 8. ) end define ZERO_DBF AZRDB ( DBF ( 34 ) ) AZRDB ( DBF ( 35 ) ) end (* THE MAKE OF AP400 ARRAY PROCESSOR PRIMITIVES *) APUSH RADIX OCTAL MAKE • AINIT RSXFUNC 34 ; MAKE •ARESET RSXFUNC 36 ; MAKE •AABRT RSXFUNC 40 MAKE 'ACEND RSXFUNC 42 MAKE • ACHN RSXFUNC 44 ; MAKε •ACTL RSXFUNC 46 ; MAKE ■ ASETV RSXFUNC 50 ; MAKE 'AWAIT RSXFUNC 52 MAKE •AUFCB RSXFUNC 54 MAKE "AXCHN RSXFUNC 56 HAKE • AEXIT RSXFUNC 60 MAKE ΆABHI RSXFUNC 62 MAKE 'AHIAB RSXFUNC 64 MAKE ' ADNSN RSXFUNC 66 MAKE ' ANRDB RSXFUNC 70 MAKE • AADD RSXFUNC 72 ; MAKE ' AMUL RSXFUNC 74 ; MAKE ■ AFTR2 RSXFUNC 76 ; MAKE ' A I T 1 RSXFUNC 100 MAKE ' AALDB RSXFUNC 102 MAKE ■ AZRDB RSXFUNC 104 ; MAKE • ASQRT RSXFUNC 106 MAKE ■ AEXPE RSXFUNC 110 MAKE ' ARLDB RSXFUNC 112 MAKE 'ASUB RSXFUNC 114 MAKE •AMULS RSXFUNC 116 MAKE 'ATFRl RSXFUNC 120 MAKE • ACONV RSXFUNC 122 MAKE 'AEDGE RSXFUNC 124 MAKE • AMOVE RSXFUNC 126 MAKE 'ADETS RSXFUNC 130 MAKE .'ADBDB RSXFUNC 132 MAKE • APRUN RSXFUNC 134 MAKE 'ASCDB RSXFUNC 136 MAKE "AZERO RSXFUNC 140 MAKE ' AHZER RSXFUNC 142 MAKE ■ AVZER RSXFUNC 144 MAKE •AORDB RSXFUNC 146 MAKE 'AUPAK RSXFUNC 150 MAKE 'ASCR5 RSXFUNC 152 MAKE •AHORZ RSXFUNC 154 MAKE ΆVERZ RSXFUNC 156 MAKE • AVCON RSXFUNC 160 APOP .TITLE LIBRARY ROUTINES FOR AP400 FUNTIONS . IDENT/01/ FUNCTION. ALLOWS THE AP400 FUNCTIONS TO BE CALLED FROM MAGIC AUTHOR : CHETANA BUCK DATE: AUG 9, 1982 REVISIONS: .SBTTL VARIABLE STORAGE FOR CALL ARGUMENTS .PSECT APDATA.D.RW INTERFACE BETWEEN MAGIC/L AND FORTRAN CALLING SEQUENCE ARGL≤T; .BLKW ΛD10 ARGUMENT LIST ( POINTERS ) MGLST: -BLKW ΛDIO ARGUMENT LIST ( VALUES ) SAVERS: .WORD 0 TEMPORARY STORAGE FOR R5 -SBTTL MAGIC/L CALLABLE AP400 ROUTINES .PSECT APCODE ;AP RESOURCE MANAGEMENT ROUTINES .GLOBL KINIT AINIT. • JSR RO ,SAVR ■ SAVE REGISTERS - MOV •0 ,R0 ,-• OF ARCS JSR PCAPMG1 iSET INTERFACE JSR PC, INIT JSR RO ,RSTOR -RESTORE REGISTERS RTS PC .GLOBL KLOAD ALOAD: :JSR RO ,SAVR SAVE REGISTERS MOV i2,R0 t OF ARGUMENTS JSR PCAPMG4 SET INTERFACE JSR PC,KLOAD JSR RO,RSTOR RESTORE REGISTERS RTS PC .GLOBL KRESET ARESET: :JSR RO , SAVR • SAVE REGISTERS MOV *0 , R0 ;» OF ARGS JSR PC APMG1 • SET INTERFACE JSR PC , RESET JSR RO .RSTOR iRESTORE RECISTERS RTS PC .GLOBL KABRT AABRT: : JSR RO ,SAVR SAVE REGISTERS MOV •0 ,R0 # OF ARGUMENTS JSR PC.APMGl SεT INTERFACE JSR PC,KABRT JSR RO ,RSTOR RESTORE REGISTERS RTS PC GLOBL KCEND ACEND: : JSR RO ,SAVR SAVE REGISTERS MOV *0 ,R0 * OF ARGUMENTS JSR PCAPMGl SET INTERFACE JSR PC,KCEND JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KCHN ACHN: JSR RO ,SAVR SAVE REGISTERS MOV •3 ,R0 • OF ARCS JSR PC ,APMG2 SET INTERFACE JSR PC,KCHN JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KCTL ACTL: JSR RO, ΞAVR SAVE RECISTERS MOV tl ,RO • OF ARCS JSR PCAPMG2 SET INTERFACE JSR PC, CTL JSR RO ,RSTOR .RESTORE REGISTERS RTS PC .GLOBL KSETW ASETW: : JSR RO ,SAVR -SAVE REGISTERS MOV •1 ,R0 ,-t OF ARGS JSR PCAPMG2 ;SET INTERFACE JSR PC,,KSETW JSR RO , ,RSTOR • RESTORE REGISTERS RTS PC .GLOBL KWAIT AWAIT: : JSR RO , SAVR SAVE REGISTERS MOV •0 ,R0 t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PC,KWAIT JSR RO ,RSTOR RESTORE REGISTERS RTS PC .GLOBL KWFCB AWFCB: JSR RO , , SAVR SAVE REGISTERS MOV tl ,R0 t OF ARCS JSR PC, , APMG2 SET INTERFACE JSR PC ,KWFCB JSR RO , ,RSTOR RESTORE REGISTERS RTS PC .GLOBL KXCHN AXCHN: : JSR RO ,SAVR SAVE REGISTERS MOV tl ,R0 t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PC,KXCHN JSR RO .RSTOR RESTORE REGISTERS RTS PC ; - .GLOBL KEXIT AEXIT: : JSR RO .SAVR ;SAVE REGISTERS MOV tO ,R0 ;t OF ARCS JSR PCAPMG1 • SET INTERFACE JSR PC,KEXIT JSR RO .RSTOR ;RESTORE REGISTERS RTS PC AP DATA MEMORY DATA BUFFER MANAGEMENT ROUTINES .GLOBL KALDB AALDB: : JSR RO , SAVR SAVE REGISTERS MOV #2 ,R0 t OF ARCS JSR PC , , APMC1 SET INTERFACE JSR PC ,KALDB JSR RO , , RSTOR RESTORE REEGISTERS RTS PC .GLOBL KRLOB ARLDB : : JSR RO ,SAVR SAVE REGISTERS MOV tl ,R0 « OF ARCS JSR PC , APMG1 SET INTERFACE JSR PC.KRLDB JSR RO ,RSTOR RESTORE REGISTERS RTS PC .GLOBL KDBTS ■ tDBTS: : JSR RO ,SAVR SAVE REGISTERS MOV *1 ,R0 t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PC,KDBTS JSR RO .RSTOR RESTORE REGISTERS RTS PC DATA TRANSFER ROUTINES .GLOBL KABHI AABHI JSR RO .SAVR SAVE REGISTERS MOV t4 ,R0 t OF ARCS JSR PCAPMG3 SET INTERFACE JSR PC,KABHI JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KHlλB AHIAB: : JSR RO ,SAVR SAVE REGISTERS MOV «3 ,H0 t OF ARCS JSR PCAPMG3 SET INTERFACE JSR PCKHIAB JSR RD .RSTOR RESTORE REGISTERS RTS PC .GLOBL KMOVE AMOVE : : JSR RO ,SAVR SAVE REGISTεRS MOV •3 ,R0 t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC,KMOVE JSR RO .RSTOR RESTORε RεoιsτεRS RTS PC .LOGICAL DATA MANIPULATION ROUTINES .GLOBL KDNSN ADNSN: : JSR RO .SAVR SAVE REGISTERS MOV tl ,R0 t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC,KDNSN JSR RO .RSTOR RESTORE REGISTεRS RTS PC GLOBL KNRDE • „: JSR RO.SAVR SAVE RεCISTERS MOV #1 ,R0 t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC.KNRDB JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KZRDB AZRDB : : JSR RO .SAVR SAVE REGISTεRS MOV tl ,R0 t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC.KZRDB JSR RO ,RSTOR RESTORE REGISTERS RTS PC .GLOBL KDBDB ADBDB . : JSR RO ,SAVR SAVE REGISTERS MOV t2,R0 t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PC,KDBDB JSR RO .RSTOR RESTOHE REGISTERS OMPI RTS PC COMPUTATION ROUTINεS .GLOBL KSCDB ASCDB : : JSR RO ,SAVR SAVB REGISTERS MOV f2 ,R0 t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC,KSCDB JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KTFR1 ATFRl : JSR RO ,SAVR SAVE REEGISTERS MOV #3 ,RC t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PCKTFR1 JSR RO ,RSTOR RESTORE REGISTERS RTS PC .GLOBL CONV ACONV: : JSR RO ,SAVR SAVE REGISTERS MOV •3 ,R0 t OF ARCS JSR PCAPMG1 SET INTERFACE JSR PC,KCONV JSR RO .RSTOR RESTORε RεGISTERS RTS PC .GLOBL KEDGE AEDGE : : JSR RO ,SAVR SAVE RεGISTERS MOV * 5 ,RO t OF ARCS JSR PC.APMG1 SET INTERFACE JSR PC,KEDGE JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KZERO AZERO: : JSR RO ,SAVR iSAVE REGISTERS MOV tS ,R0 ;t OF ARCS JSR PCAPMG1 SET INTERFΛCε JSR PCKZεRO JSR RO .RSTOR RεSTORE RεGISTεRS RTS PC .GLOBL KPRUN APRUN: JSR RO ,SAVR SAVB REGISTERS MOV «7,R0 t OF ARCS JSR PCAPMG1 SFT INTERFACE JSR PC, PRUN JSR RO ,RSTOR RESTORE REGISTERS RTS PC GLOBL KH: -ER AHZE : JSR RO, ,SAVR ;SAVε RεGISTεRS MOV #3 ,RO ;t OF ARGS JSR PC, ,APMG1 ;set interface JSR PC ,KHZER JSR RO , ,RSTOR • RESTORE REGISTERS RTS PC .GLOBL KVZER AVZER: : JSR RO.SAVR SAVE REGISTERS MOV * 6 ,RO t OF ARCS JSR . PC.APMG1 SFT iNτεRFAcε JSR PC,KVZER JSR RO .RSTOR RESTORE REGISTSRS RTS PC .GLOBL KOI IDE AORDB: JSR RO , ,SAVR SAVE REGISTεRS MOV *2 ,R0 t OF ARCS JSR PC,rAPMGl ≤ετ iNTεRFAcε JSR PC ,KORDB JSR RO, ,RSTOR RεSTORε REGISTERS RTS PC .GLOBL KUPAK AUPA : : JSR RO ,SAVR ;SAVE REGISTERS MOV *2 ,RO ;t OF ARGS JSR PC , APMG1 SET INTERFACε JSR PC ,KUPAK JSR RO , ,RSTOR RεSTORε REGISTERS RTS PC .GLOBL KSUB ASUB: JSR RO ,SAVR SAVE REGISTERS MOV *3 ,RO t OF ARCS JSR PC, ,APMG1 SET INTERFACE JSR PC ,KSUB JSR RO, ,RSTOR RFSTORε REGISTERS RTS PC .GLOBL KMULS AMULS: JSR RO ,SAVR SAVE RεEGISTERS MOV t3 ,R0 t OF ARCS JSR PC , ,APMG1 ≤ετ iNTεRFAcε JSR PC , ,KMULS JSR RO , , STOR RESTORE REGISTERS RTS PC .GLOBL KADD AADD: JSR RO ,SAVR SAVE REGISTεRS MOV t3 ,R0 t OF ARCS JSR PC,APMG1 sεT iNTεRFAcε JSR PC,KADD JSR RO .RSTOR RESTORE REGISTERS RTS PC ,GLOBL KMUL AMUL: JSR RO ,SAVR SAVE REGISTERS MOV #3 ,RO t OF ARGS JSR PC ,APMG1 SET INTεRFAcε JSR PC,KMUL JSR RO .RSTOR RεSTORE RεGISTERS RTS PC .GLOBL KSQRT ASQRT: JSR RO.SAVR ;SAVE RεGISTERS MOV 12 ,R0 t OF ARCS JSR PC APMGl SET INTERFACE JSR PC ,KSQRT JSR RO .RSTOR RESTORE REGISTERS RTS PC .GLOBL KEXPE AEXFE: : JSR RO .SAVR SAVE REGISTεRS MOV t2 ,R0 t OF ARGS JSR PC,APMGl SFT INTεRFACE JSR pcxεxpε JSR RO , STOR RESTORE REGISTERS RTS PC .GLOBL KFTR2 r\FTR2: : JSR RO ,SAVR SAVE REGISTεRS MOV »3 ,R0 t OF ARCS JSR PC,APMGl SET INTERFACE JSR PCKFTR2 JSR RO ,RSTOR RESTORE REGISTERS RTS PC .GLOBL KITR1 AITRl:: JSR RO ,SAVR .SAVE REGISTεRS MOV t3,R0 t OF ARGS JSR PC.APMGl S8T INTεRFACE JSR PC.KITRl JSR RO .RSTOR RESTORE REGISTERS RTS PC SERVICE SUBROUTINES SAVE ALL REGSTERS SAVR: MOV R2.-ISP) MOV R3.-ISP3 MOV R4 ,-<SF) JMP (RO) • RESTORS ALL REGISTERS RSTOR: TST (SF>+ MOV (SP)+,R4 MOV (SP)+,R3 MOV (SP)+,R2 MOV t-1 ,R1 ;REQ BY MAGIC MOV SAVERS ,R5 ;RESTORε RS RTS RO MAGIC/L INTεRFACE SETUP ROUTINES THIS ROUTINE IS CALLED FOR ALL FUNCTIONS WHOSε CALL STATEMENT ARGUMENTS ARE OF THE FOLLOWING TYPE : < NO ARGUMENT ) ( VAL ) ( VAL,VAL ) ( VAL,VAL,VAL i ( VAL,VAL,VAL,VAL ) WHERE VAL IS ANY INTEGER VALUE. APMGl : MOV RO ARGLST SET « OF ARGS TST RO t OF ARGS BED 2$ IF ZERO,TRANSFER CONTROL WITHOUT CHANGE MOV RO Rl ASL Rl ;«2 FOR WORD ALLIGNMENT ADD tARCLST+2 ,R1 ;R1 POINTS TO ONEAFTER BOTTOM OF ARG PTR LIS"! MOV #MGLST,R2 R2 POINTS TO THE ARGUMENT LIST ( MAGIC CALL ) IS : MOV R2 ,-CRl > POINTER SET UP MOV (R5)+, (R2)+ ARGUMENT SET UP DEC RO BGT IS 2$ MOV RS .SAVER5 ;SAVε RS MOV tARGLST.RS ■ FORTRAN CALL SET UP RTS PC THIS ROUTINE IS CALLED BY FUNCTIONS WHOSE CALL STATEMENT ARGUMENTS ARE OF THE FOLLOWING TYPE: ( ADDR ) ( ADDR,ADDR ) ( ADDR,ADDR,VAL ) WHEHE ADDR IS A HOST MEMORY ADDRESS APMG2 : MOV RO .ARGLST • SET » OF ARGUMENTS MOV R0.R1 ADD t-2,Rl ;TST # OF ARGS BLE IS DEC RO MOV tMGLST.ARGLST* i ; SET PTR TO VAL MOV <R5 J+ .MGLST 1 S : DEC RO BEQ 2$ IF 1 ARG .NO CHANGE MOV (R5 )+,ARGLST+4 INTERCHANGε ARGUMεNT ADDRESSES MAGIC CALL RS POINTS TO LAST ARG 2t MOV (R5)+,ARGLST+2 FORTRAN CALL SETUP MOV R5 ,SAVεR5 SAVE RS MOV tARCLST.RS RTS PC THIS ROUTINE IS CALLED BY FUNCTIONS WHOSE CALL STATFMENT ARGUMENTS ARE OF THE FOLLOWINC TYPE: ( ADDR,VAL, AL ) l ADDR, AL,VAL,VAL > WHERE ADDR IS A HOST MEMORY ADDRESS AND VAL IS ANY INTEGER VALUE APMG3 : MOV RO,ARGLST ;SET t OF ARGUMENTS MOV R0,R1 ASL Rl ;*2 FOR WORD ALLIGNMENT ADD *ARCLST+2,R1 ,-Rl POINTS TO ONE AFTER THE BOTTOM OF ;ARG PTR LIST < FORTRAN CALL ) MOV tMGLST,R2 ;R2 POINTS TO ARG LIST (MAGIC CALL ) DEC RO IS : MOV R2 ,-(Rl ) ;ARG PTR SET UP MOV (RS>+, (R2)+ ;ARG SET UP DEC RO BGT It MOV (R5 )+,-(Rl> MOV RS .SAVERS ;SAVE R5 MOV tARGLST,R5 ; FORTRAN CALL SET UP RTS PC THIS ROUTINE IS CALLED BY FUNCTIONS WHOSE CALL STATEMENT HAS ARGUMENTS OF THE FOLLOWING TYPE. ( VAL,ADDR ) (VAL,ADDR,VAL ) WHERE ADDR IS A HOST MEMORY ADDRESS AND VAL IS ANY INTEGεR VALUε APMG4: MOV RO .ARGLST SET « OF ARGUMENTS ADD t-2,R0 CHECK t OF ARGS BEQ It FOR 2 ARGS MOV »MGLST,ARGLST+4 SET PTR LIST MOV (R5)+,MGLST It : MOV (R5J-r.ARGLST+4 ;SεT ADDRε≤S VALUE MOV tMGLST+2 ,ARGLST+2 MOV (R5)f.MGLSTs>2 MOV RS ,SAVER5 ;SAVε RS MOV tARGLST.RS ;FORTRAN CALL SεT UP RTS PC END .NLIST TTM -PRODUCE LISTING IN WIDE STYLE. . ENABL LC -RETAIN LOWER-CASε CHARACTERS AS SUCH. PROGRAM: HSTFNC . VECTOR ADD (REAL OR COMPLEX) PART NUMBER: VERSION DATE: AUGUST 25. 1982 AUTHOR: CHETANA BUCH HISTORY: DESCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UP AN AP-BASED AP FUNCTION IN ORDER TO PERFORM A "TIME DOMAIN CONVOLUTI ON" BFTWε THE RESPECTIVE ELEMENTS OF TWO AP DATA MEMORY DATA BUFFERS. ONE CONTAINS THB SIGNAL AND THE OTHER THE FILTER (MASK). .TITLE KCONV - HSTFNC: TIME CONVOLUTION .IDENT /V01/ -IDENTIFIER FOR THE OBJECT MODULE. ϊESTABLISH ASSEMBLY AND LISTING CONVENTIONS: .NLIST TTM ,-PRODUCE LISTING IN WIDE STYLE. .DSABL GBL -FLAG NON-EXISTεNT-SYMBOL RBFFRENCES AS ERRORS .ENABL LC ,-RETAIN LOWER-CASE CHARACTERS AS SUCH. •CSECT KCONV :ESTABLISH A NAMED CSECT. INTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KCONV -EXTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KEXFCB AP MANAGER'S "FCB EXECUTION" SUBROUTINE. .GLOBL KWAIT AP MANAGER'S WAIT ROUTINE .GLOBL MGRM67 AP MANAGER'S "FATAL ERROR t-47" εXIT ROUTINE. .GLOBL COMCTL AP MANAGεR'S "FCB CONTROL WORD". ;AP FUNCTION ID'S RεFεRENCED: CONV * 802. ; ID FOR "TIME CONVOLUTION" ;SYMBOL DEFINITIONS: ;NONE .TεRMINOLOGY: ; FCB - FUNCTION CONTROL BLOCK, READ BY THE AP EXεCUTIVE FROM HOST MEMOR . .PAGE J+HOST FUNCTION "KCONV ;THIS HOST FUNCTION CALLS UP A CORRESPONDING AP FUNCTION IN THE AP400. -THIS HOST FUNCTION VεRSION ASSUMBS THAT SOURCE DATA ALREADY RESIDES IN TWO AP ■ DATA MEMORY DATA BUFFERS, AND THAT THE RESULT DATA WILL Bε PLACεD IN ANOTHεR ;AP DATA MεMORY DATA BUFFBR . ;THε MAXIMUM MASK ( FILTER ) SIZE HANDLED BY THIS ROUTINE IS EIGHT POINTS. IF • FILTER IS SMALLER, THE REMAINING BUFFER MUST CONTAIN ZEROS • THE TWO POINTS AT BOTH ENDS OF RESULT WILL CONTAIN ZEROS. ;THE CORRESPONDING "TIME CONVOLUTION" AP FUNCTION SHOULD BE -REFERεNCED FOR FURTHER INFORMATION. ;CALL FROM FORTRAN VIA: ; SUBROUTINE CALL: CALL KCONV( DBIa, DBIb, DBIc > ; OR INTEGER FUNCTION CALL, AS: IERR • KCONV ( DBIa, DBIb, DBIc ) ;WHERE: DBI* - ID OF AP DATA BUFFER TO HOLD RESULT DATA. "DBI*" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF NEED NOT HAVE BEEN PREVIOUSLY ALLOCATED. IF NOT ALREADY ALLOCATED, DBF WILL BE ALLOCATED; SIZE WILL EQUAL THAT OF SOURCE DATA BUFFERS. IF RESULT DBF WAS PREVIOUSLY ALLOCATED, IT MUST BE OF SIZE EQUAL OR GREATER THAN SOURCE DATA BUFFERS. DBIb a ID OF AP DATA BUFFER HOLDING SIGNAL DATA SET. "DBIb" MUST BE A SINGLE-WORD INTBGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PREVIOUSLY ALLOCATεD IN AP DATA MεMOR . DBIc - ID OF AP DATA BUFFER HOLDING MASK ( FILTER ) DATA SET. "DBIc" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PREVIOUSLY ALLOCATED IN AP DATA MEMORY. IF LESS THAN 8 PTS. ,THE REMAINING BUFFER SHOULD BE ZEHOED . RETURNS TO FORTRAN WITH: ALL ARGUMENTS RETURNεD AS Rεcεi εD. FUNCTION εXεCUTION "IN PROGRESS" OR • COMPLETE", DEPENDING UPON CURRεNT AP MANAGER "RETURN" STATUS. IF CALLED AS A FORTRAN FUNCTION, THE VALUE RETURNED WILL BE AS SPECIFIED ' FOR REGISTεR "RO", RεTURNεD FROM AN ASSEMBLY-LANGUAGE CALL. UPON ERROR, A STANDARD AP MANAGER ERROR EXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUAGE VIA: ; A FORTRAN-COMPATIBLE CALL SEQUENCE. ;RETURNS TO CALL+1-. (ALWAYS) ALL CONDITIONS AS DεSCRIBεO FOR THE FORTRAN FUNCTION CALL FORM. ABOVε . RO - STATUS VALUε . (DEFINED BY AP MANAGER.) "KCONV" DEFINES NO UNIQUE VALUES. Rl « UNDEFINED. R2 • UNDEFINED. RS « UNDEFINED. iUPON ERROR, WHεN CALLED FROM FORTRAN OR ASSεMBLY LANGUAGE: IF A FATAL BRROR OCCURS DURING EXECUTION OF THIS HOST FUNCTION OR DURING EXεCUTION OF A ROUTINε WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGER OR AP DRIVεR), THE AP MANAGER'S FATAL ERROR εXIT ROUTINE WILL BB CALLED. .PAGE KCONV: CMPB (R5>, #3 -CHECK FOR PROPER NUMBER OF ARGUMENTS. BNE εRRORX -IF NOT CORRεCT NUMBBR, HANDLE AS A FATAL ERROR. TST (R5)+ -STEP POINTER AHEAD TO FIRST ARGUMENT ADDRESS. TST FCBDON TEST FOR COMPLETION OF A PREVIOUS OPERATION. BNE It A ZERO "DONE" FLAG INDICATES PREVIOUS OPERATION STILL IN PROGRESS. JSR PC,KWAIT -WAIT FOR THE AP TO FINISH PROCESSING It : CLR FCBDON -REINITIALIZE THE "DONE" FLAG. MOV COMCTL, FCBCTL RETRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SELECTED OPTIONS. PLACE IT IN FCB'S CONTROL WORD. MOV β(RS)+, FCBARL ;MOVE RESULT DATA BUFFER ID "A" INTO FCB ; ARGUMENT LIST. ; STεP HOST MεMORY ADDRESS POINTER AHEAD. MOV β(RS)+. FCBARL+4 ;MOVB SOURCE DATA BUFFBR ID "B" INTO FCB ; ARGUMENT LIST. ; STεP HOST MεMORY ADDRESS POINTER AHSAD. MOV βCR5)+, FCBARL+8. ;MOVB SOURCε DATA BUFFER ID "C" INTO FCB ; ARGUMENT LIST. ( INCREMENTING RS , ALTHOUGH UNNECESSARY, SAVES EXECUTION TIME AND ONE MEMORY WORD.) MOV •MGRARG, RS SET UP ADDRESS OF ARGUMENT LIST FOR CALL TO AP MANAGER . JMP KEXFCB CALL UP THE AP MANAGER TO PROCESS THE FCB. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR", FOLLOWED BY AN "RTS PC". "KEXFCB" WILL RETURN ITS STATUS VALUε IN PDP-11 REGISTER RO AS WELL AS IN LOCATION "STATUS". MGRARG: BE 2t BRANCH AROUND ARGUMENT LIST. (THIS INSTRUCTION PROVIDES "NUMBBR OF ARGUMBNTS" COUNT FOR AP MANAGER; THF BRANCH IS NBVεR ACTUALLY TAKεN. ) .WORD FCBBLK ADDRESS OF FCB. .WORD STATUS ADDR8SS FOR RETURNED STATUS. 2t : -THIS LABEL MAI BRRORX: JMP MCRM67 ;TAKE AN AP MANAGER STANDARD FATAL ERROR EXIT. RETURN STATUS CODE -47 TO INDICATE "IMPROPER ; NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS: .WORD 0 ;TEMPORARY STORAGE LOCATION FOR RETURNED AP ; MANAGER STATUS. .PAGE ;FUNCTION CONTROL BLOCK: FCBBLK: FCBID. .WORD CONV ID OF THE AP FUNCTION. FCBCTL: .WORD 0 CONTROL WORD. FCBDON: .WORD 1 DONB FLAG. INITIALIZεD TO "DONε" STATE. FCBLNK: .WORD 0 (HIGH-ORDER.) HOST MEMORY ADDRESS LINK TO NEX'I .WORD 0 (LOW-ORDER.) FCB IN HOST MEMORY. (NONE.) FCBPLT: • WORD 1 FCB PARAMETER LIST TYPE. (DATA BUFFER ID'S.) FC8NRG: .WORD 3 NUMBεR OF ENTRIES IN ARGUMENT IST. FCBLEN: .WORD 6 LENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS. FCBARL. .WORD 0 ;RESULT DATA BUFFER ID 'A" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SECOND WORD .WORD 0 ;SIGNAL DATA BUFFER ID "B" ARGUMENT. .WORD 0 ; FIRST WORD « DBF ID; SBCOND WORD .WORD 0 iFILTεR DATA BUFFER ID "C" ARGUMENT. .WORD 0 ; FIRST WORD « DBF ID; SECOND WORD .END PROGRAM: APFNC : TIME CONVOLUTION PART NUMBER: VERSION DATE: AUGUST 25, 1982 AUTHORS: CHETANA BUCH HISTORY: DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMS A TIME DOMAIN CONVOLU TION OF A SIGNAL WITH A FILTER OF MAXIMUM SIX POINTS THIS AP FUNCTION IS NORMALLY CALLED UP BY THE AP EXECUTIvε, WHICH RεTRIEVES THIS AP FUNCTION'S ID NUMBER FROM A FUNCTION CONTROL BLOCK READ FROM HOST MEMORY. TITLE APFNC: TIME CONVOLUTION NAME QCONV, 001 ;NAME AND VERSION FOR THE OBJECT MODULE. PAGE RADIX H ;DEFAULT TO HEXADECIMAL RADIX. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: (IGLOBL) ; BNTRY POINTS: ;NONE ; SUBROUTINES: ;NONE ; GENERAL SYMBOLS ;NONE ; DATA MεMORY LAEBLS : ;NONε EXTERNALLY DEF INED GLOBAL I ZED SYMBOLS : ( EGLOBL ) ENTRY PO INTS : ,-NONE SUBROUTINES: EGLOBL FLSICE, ADDI1, FLSHAF, CETLZC. NRMCND GENERAL SYMBOLS: -,NONE DATA MEMORY LABELS: ;NONE ;SYMBOL DEFINITIONS: ;NONE ;TERMINOLOGY: jNONE -113- PAC PMORG ;START OF RELOCATABLE CODE IN PROGRAM MEMORY. ;>+AP FUNCTION "QCONV" ; This AP function performs the time convolution. Call wi th : parameter list type 1 , number of arguments parameter list length & . word 9 argument tl ID of result Data Buffer "A" word 10 argument #1 Igno ed. word 11 argument #2 ID of source Data Buffer "B" word 12 argument 12 Ignored . word 13 argument #3 ID of source Data Buffer "C" word 14 argument 13 Ignored. ; Exits to AP Executive's "Fatal Abort" Service: , If an error is found by AP Service Subroutine 'PLS1CE' : >- PAGE ;DεFINITION OF T THHEE FFUNCTION ID FOR THE AP εXECUTIVE FUNCTION TABLE: FUNC SDSO QCONV ;FUNCTION ID AND ENTRY POINT NAMB . PCLRAC: EQU %D32 CLEAR ACC IN PIPE PAC ID. PCONVS: .EQU SDS2 CONVOLUTION (INITIAL) PAC ID. PCONVT: EQU *D83 CONVOLUTION (ITERATIVε) PAC ID. QCONV: JSR PLS1CE GO CHεCK CORRεCTNεSS OF VALUES IN FCB, FIND SOURCE DATA BUFFERS. ALLOCATB RεSULT DBF IF NεCεSSARY, SET UP ARGUMENTS FOR A FUNCTION ADDR CALL. UPON ERROR, EXIT THROUGH AP EXECUTIVε'S FATAL ABORT ROUTINB . JSR ADD 11 FORM AND STORE RESULT BEX AND NSN SET R2-R8+1 PTR TO FIRST RESULT DATA SETR R3-0 STREGI R3 ,R2 WRITE ZERO IN FIRST TWO PLACES STREG R3 ,R2 SET R2-R2-1 SET R2-R2+R* * PTR TO LAST+1 RSSULT DATA STREGD R3 ,R2 WRITE ZERO IN LAST TWO PLACES STRεGD R3 ,R2 MOVE RECSCL.R3 ;CLEAR SCL/LZC REGISTER SET R10-R9-4 ;COUNT REGISTεR SET R11-R7-1 ;INITIALIZε SIGNAL DATA POINTER SET R13«R8+2 -INITIALIZE RESULT DATA POINTER AGAIN: SET R12-R6+1 j INITIALIZE FILTER DATA POINTER PIPE PCLRAC.SCLO, , LZCOFF ;CLEAR PIPE ACCUMULATORS PAD R3-R3 FAD ;NOT USED PAD ;NOT USED PAD ;NOT USED sεTR R2-2 PIPE PCONVS.SCLO, ZCOFF ;CONV ( FOUR POINTS ) PAD R11-.R11+R2,SI PAD ' R11«R11+R2 ,S2 PAD R12.R12.S3 PAD R12=R12+R2,S4 PIPE PCONVT.SCL0.LZC2 ;REMAINING POINTS CONV PAD R11-.R11+R2,S1 PAD R13.R13+1 ,D2R PAD R12«R12+R2,S3 FAD R12»R12+R2,S4 SET Rll-Rll-5 REINITIALIZE SIGNAL DATA PTR DBNZ RIO,AGAIN ;REPEAT UNTILL ALL DATA DONE JSR FLSHAP • FLUSH PIPELINE JSR GETLZC ;UPDATE NSN OF RESULT JMP NRMCND GO TO NORMALIZE THE RESULT DATA. IF FCB CONTROL BIT INDICATES SUCH REQUIREMENT. A DIRECT BRANCH IS THB EQUIVALεNT OF A "JSR" FOLLOWED BY AN "RTN" . END .NLIST TTM ;PRODUCE LISTING IN WIDE STYLε . .ENABL LC ;RεTAIN LOWER-CASE CHARACTERS AS SUCH. ; PROGRAM: HSTFNC : EDGε PRUNINC ; PART NUMBER: β . ; VERSION DATE: SεPTEMBER 1, 1982 ; AUTHOR: CHETANA SUCH ; HISTORY: ; DESCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UP AN AP-BASED AP FUNCTION IN ORDER TO PERFORM "EDGε PRUNING" .TITLε KPRUN HSTFNC: EDCE PRUNING . IDεNT /V01/ IDENTIFIER FOR THE OBJECT MODULE. .PACE ;ESTABLISH ASSEMBLY AND LISTING CONVENTIONS: NLIST TTM PRODUCE LISTING IN WIDε STYLε. DSABL GEL FLAG NON-ε ISTENT-SYMBOL REFεRENCES AS ERRORS. ENABL LC RETAIN LOWER-CASE CHARACTERS AS SUCH. CSECT KPRUN ESTABLISH A NAMED CSECT. INTERNALLY DEFINFD GLOBALIZBD SYMBOLS: ■GLOBL KPRUN ;EXTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KEXFCB AP MANAGER'S "FCB EXECUTION" SUBROUTINE. .GLOBL KWAIT AP MANAGER'S WAIT ROUTINE .GLOBL MGRMΛ7 AP MANACER'S "FATAL ERROR #-6?" EXIT ROUTINE. .GLOBL COMCTL AP MANAGER'S "FCB CONTROL WORD". ;AP FUNCTION ID'S RFFFRENCED: PRUN . SO.. ;ID FOR "VECTOR ADD (REAL OR COMPLEX)' ;SYMBOL DEFINITIONS: C?f !? ! 5'C:"S" "ϊ"i | '"t-r** _ ■ ■»! •fr-.p—tj-. ;NONE ;TεRMIN0LOGY: FCB FUNCTION CONTROL BLOCK, RBAD BY THE AP εXECUTIVε FROM HOST MεMOR . .PAGE , >*HOST FUNCTION "KPRUN" ;THIS HOST FUNCTION CALLS UP A CORRSSPONDING AP FUNCTION IN THε AP400 ;THIS HOST FUNCTION VERSION ASSUMεS THAT SOURCE DATA ALRεADY RεSIDES IN SEVεN A? ;DATA MEMORY DATA BUFFERS, AND THAT THE PRUNING WILL Bε DONε ON DATA IN THE FOUR TH ,AP DATA MEMORY DATA BUFFER. ;TKE CORRESPONDING "EDGE PRUNING" AP FUNCTION SHOULD BE .REFERENCED FOR FURTHER INFORMATION. ;CALL FROM FORTRAN VIA. SUBROUTINE CALL : CALL KPRUN ( DBIa.. DBIb, .. DBIg > OR INTEGεR FUNCTION CALL, AS: IFRR KADD ( DBIa, DBIJ>, DBIg } ;WHERE: DBI*,DBIb,DBIe ...DBIg « ID OF AP DATA BUFFERS WHICH HOLD RESULT εDGε INFORMATION OF SFVεN CONSεCUTIVE IMAGE LINES. DBIet WILL HOLD THE INFORMATION WHICH WILL BE THE FOCUS OF THIS PRUNER. . "DBIx" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PREVIOUSLY ALLOCATED. RETURNS TO FORTRAN WITH: ALL ARGUMENTS RETURNED AS RECεiVED. FUNCTION EXECUTION "IN PROGRESS" OR "COMPLETε" , DεPεNDING UPON CURRENT AP MANAGER "RETURN" STATUS. IF CALLεD AS A FORTRAN FUNCTION, THε VALUε RεTURNεD WILL BB AS SPECIFIED FOR RBGISTER "RO", RETURNεD FROM AN ASSεMBLY-LANGUAGE CALL. UPON ERROR, A STANDARD AP MANAGER ERROR εXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUAGE VIA: ; A FORTRAN-COMPATIBLE CALL SEQUεNCε. ; ETURNS TO CALL+ 1 (ALWAYS) ALL CONDITIONS AS DESCRIBED FOR THE FORTRAN FUNCTION CALL FORM, ABOVB . RO « STATUS VALUε. (DEFINεD BY AP MANAGER.) "KPRUN" DEFINES NO UNIQUE VALUES. Rt « UNDEFINFD. R2 * UNDEFINED. R5 * UNDEFINFD. ;UPON ERROR, WHεN CALLεD FROM FORTRAN OR ASSEMBLY LANGUAGE: IF A FATAL ERROR OCCURS DURING EXεCUTION OF THIS HOST FUNCTION OR DURING EXECUTION OF A ROUTINε WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGER OR AP DRIVER), THE AP MANAGER'S FATAL ERROR EXIT.HOUTINE WILL BE CALLED. .PAGB KPRUN: CMPB (R5), »7 ;CHεCK FOR PROPER NUMBER OF ARGUMENTS. BNE ERRORX ;IF NOT CORRECT NUMBER, HANDLE AS A FATAL ERROR. TST (R5 )+ iSTEP POINTER AHEAD TO FIRST ARGUMFNT ADDRESS. TST FCBDON T8ST FOR COMPLETION OF. A PRεVIOUS OPεRATION. BNE IS A Z8RO "DONε" FLAG INDICATES PREVIOUS OPERATION STILL IN PROGRESS. JSR PC, WAIT ;WAIT FOR THE AP TO FINISH PROCESSING *: CLR FCBDON REINITIALIZE THE "DONE" FLAG. MOV COMCTL, FCBCTL RεTRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SELεCTεD OPTIONS PLACE IT IN FCB'S CONTROL WORD. MOV β(R5)+, FCBARL MOVE RESULT DATA BUFFER ID "A" INTO FCB ARGUMENT IST. STεP HOST MεMORY ADDRε≤S POINTER AHEAD. MOV t(H,5>+, FCBARL+4 ;MOVε SOURCE DATA BUFFεR ID "B" INTO FCB ARGUMENT IST. STEP HOST MEMORY ADDRESS POINTER AHEAD. MOV β(R5)+, FCBARL+8 ;MOVE SOURCE DATA BUFFER ID "C" INTO FCB ARGUMENT LIST. MOV β(R5)+, FCBARL-tl ;MOVE SOURCE DATA BUFFER ID "D" INTO FCB ARGUMεNT IST. MOV *(R5)+, FCBARL+1 ;MOVE SOURCE DATA BUFFER ID " Σ" INTO FCB ARGUMENT LIST. MOV 9(R5)+, FCBARL+2 ;MOVE SOURCE DATA BUFFER ID "F" INTO FCB ARGUMENT LIST. MOV β(R5)+, FCBARL+2 ;MOVE SOURCE DATA BUFFBR ID "G" INTO FCB ARGUMεNT LIST. (INCRεMεNTING R5. ALTHOUGH UNNεCESSARY, SAVES EXεCUTION TIME AND ONE MEMORY WORD.) s .n n-ss..., MOV •MGRARG , RS SET UP ADDRBSS OF ARGUMENT LIST FOR CALL TO AP MANAGER . JMP KEXFCB CALL UP THE AP MANAGER TO PROCESS THE FCB. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR", FOLLOWED BY AN "RTS PC". "KEXFCB" WILL RETURN ITS STATUS VALUE IN PDP-11 RεGISTER RO AS WεLL AS IN LOCATION "STATUS" . MGRARG : BR 2$ BRANCH AROUND ARGUMBNT LIST. (THIS INSTRUCTION PROVIDES "NUMBER OF ARGUMENTS" COUNT FOR AP MANAGER; THE BRANCH IS NEVεR ACTUALLY TAKεN. ) .WORD FCBBLK ADDRESS OF FCB . .WORD STATUS ADDRESS FOR RETURNED STATUS. 2S : ;THIS LABEL MARKS THE END OF THE ARGUMENT LIST. ERROR : JMP MGRM67 TAKE AN AP MANAGER STANDARD FATAL ERROR εXIT. RETURN STATUS CODE -*7 TO INDICATE "IMPROPER NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS: -WORD 0 ;TEMPORARY STORAGE LOCATION FOR RETURNεD AP ; MANAGER STATUS. .PAGE .FUNCTION CONTROL BLOCK : FCBBLK: FCBID: .WORD PRUN ; ID OF THE AP FUNCTION. FCBCTL : .WORD 0 ;CONTROL WORD. FCBDON: .WORD 1 ;DONE FLAG. INITIALIZED TO "DONE" STATE. FCBLNK: .WORD 0 ; (HIGH-ORDER. ) HOST MEMORY ADDRESS LINK TO NEX. .WORD 0 ; (LOW-ORDER. > FCB IN HOST MEMORY. (NONE.) FCBPLT: .WORD 1 ;FCS PARAMETεR LIST TYPE. (DATA BUFFER ID'S.) FCBNRG: .WORD 7 ;NUMBBR OF FNTRIES IN ARGUMENT LIST. FCBLEN: .WORD 14 .-LENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS. FCBARL: .WORD 0 ;RESULT DATA BUFFER ID "A" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SεCOND WORD » 0. .WORD 0 ;SOURC8 DATA BUFFBR ID "B" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SECOND WORD * 0. .WORD 0 ;SOURCE DATA BUFFER ID "C" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SECOND WORD > 0. .WORD 0 ;SOURCE DATA BUFFBR ID "D" ARGUMBNT. .WORD 0 ; FIRST WORD » DBF ID; SεCOND WORD =- ■ 0. .WORD 0 ,-SOURCε DATA BUFFER ID "E" ARGUMENT. .WORD 0 ; FIRST WORD « DBF ID; SECOND WORD « 0. .WORD 0 ;SOURCE DATA BUFFER ID "F" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SECOND WORD - 0. O H F *^ ' s O .WORD 0 ;SOURCE DATA BUFFBR ID "G" ARGUMεNT. .WORD 0 ; FIRST WORD -. DBF ID; SECOND WORD - 0. .εND ; PROGRAM: APFNC : EDGE PRUNING ; PART NUMBBR: ; VBRSION DATε: SEFTεMBεR 1. 1982 ; AUTHORS: CHETANA BUCH ; HISTORY: ; DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMES EDGE PRUNING. SεVεN DATA BUFFERS CONTAINING EDGε INFORMATION OF SFVEN ; CONSECUTIVε IMAGE DATA LINES ARE REQUIRED. ; THIS AP FUNCTION IS NORMALLY CALLεD UP BY THE AP EXECUTIVE, WHICH ; RETRIEVES THIS AP FUNCTION'S ID NUMBBR FROM A FUNCTION CONTROL BLOCK ; READ FROM HOST MEMOR . TITLE APFNC: EDCE PRUNING NAME QPRUN, 001 ;NAME AND VERSION FOR THE OBJECT MODULE. - s ^ s- s i sJTE SHEE PAGE RADI X ;DEFAULT TO HεXADECIMAL RADIX. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: ( IGLOBL) ENTRY POINTS: ;NONE ; SUBROUTINBS: ; GENERAL SYMBOLS ;NONE ; DATA MEMORY LABELS: ;NONB ,EXTERNALLY DEFIN8D GLOBALIZBD SYMBOLS: (EGLOBL) ENTRY POINTS: ;NONE SUBROUTINES: EGLOBL PLCHK1, PLDBF, FTLABT, NRMCND GENERAL SYMBOLS: ;NONE DATA MEMORY LABELS: ,-NONE ;SYMBOL DEFINITIONS: .NONE ;TεRMINOLOGY: ;NONE P cε PMORG ;START OF RBLOCATABLε CODE IN PROGRAM MεMORY. >+AP FUNCTION "QPRUN' This AP Function scans the data in DBId to find odd zero crossings ( results from QEDGE ) and deletes any even xero crostings in the vicinity of three pint Cil 1 with: p rame r list type 1 , number of arguments parante ter 1 ist Iingth 14 word 9 argument #1 « ID of result Data Buffer "A" word 10 argument #1 • Ignored . word 11 argument #2 - ID of source Data Buffer "B" . word 12 argument #2 « Ignored. word 13 argument #3 » ID of source Data Buffer "C" . word 14 argument #3 » I no ed . wcrd IS argument #4 - ID of source Data Buffer "D" . word lli argument #4 « Igno e . word 17 argument #5 ID of source Data Buffer "E' word 18, argument #5 Ignored . word 1? argument #4 « ID of source Data Buffer • F" . word 20 argument #4 » Ignored. word 21 argument 17 • ID of source Data Buffer "G" word 22 argument #7 « Igno ed . ; ε»itβ to AP εxecutivβ's "Fatal Abort" Service: ; If an error is found by AP Service Subroutine 'PLCHKl 'or 'PLDBF' ; >- FACE DEFINITION OF THE FUNCTION ID FOR THE AP EXεCUTIVε FUNCTION TABLE: FUNC *D804, QPRUN ;FUNCTION ID AND BNTRY POINT NAME. QPRUN: sεTR Rl * l ;SET UP FOR PLCHK1 CALL SETR R2-.7 SETR R3«=*D1 JSR PLCHK1 GO CHECK CORRECTNεSS OF VALUES IN FCB, FIND SOURCE DATA BUFFERS, ALLOCATE R8SULT DBF IF NBCε.SSARY, SET UP ARGUMENTS FOR A FUNCTION ADDR. CALL. SUBSTI UPON ERROR , ε IT THROUGH AP EXεCUTIVε ' S JMP FTLABT FATAL ABORT ROUTINε . SETR R15-7 ARG COUNT FETCH: JSR PLDBF FFTCH DBF ADDR JMP FTLABT SET Rl-Rl+1 POINT TO FIRST DATA WORD PUSH Rl SAVB ON STACK DBNZ R15.FETCH POP R14 ;R1 —)DBIg POP R13 ;R13—)DBIf POP R12 ;R12—)DBIe POP Ril ;R11—>DBId MAIN LINE. SETR R3-STORE ;SAVE OTHER ADDR IN STORE SETR R4«3 SAVE: FOP Rl STREGI Rl ,R3 sεTR R1«0 ;COUNT POINTER NEXT LDREGI R3.R11 ;C8T DATA INTO R3 SET R4-R3 ;COPY IN R4 SET R4-R4 'AND'*H3D ;CHεCK FOR CORNER SKIPNE R4'XOR**H3D JMP CORNER SET R4-R3 SET R4-R4"ANO'%H39 SKIPNE R4 -XOR'^HS? ;ODD HORZ CODE JMP HORODD SET R4»R3 SET R4« , AND'%H35 sκiPNε R4'XOR'*H35 ;ODD VERT CODε JMP VEROOD DONE: sεT Rl-Rl+1 ;UPDATE POINTεR DBNZ R2.NE T JMP NRMCND ; ETURN TO AP EXEC. RTN CORNER: SETR R15—1 ;FLAG FOR CORNER PIXEL HORODD : SETR R4--1 DIRECTION FLAG SETR R3»3 ;COUNT SET R4«R11 ~ ;POINTER IN FORVARD DIRECTION CHK: LDREGI R7,R*S ; ETCH DATA CHK1 : SET RS.R7 .-COPY IT SKIPNE R8 'XOR' '»rlH3A ;EVEN HORZ POSITIvε STRONG CODε JMP ZEROH SεT R8-R7 SKIPNE R8'XOR'*H3E ;EVEN CORNER STRONG CODE JMP ZEROH SKIPLT R4.R4 ;CHECK DIRECTION JMP OPP DBNZ RS , CHK ;REPEAT REV: SETR R4-0 ;REVERSE DIR8CT10N FLAG SETR R5.3 ;COUNT SET R4- 11-1 CHK2 : LDREGD R7 ,R& JMP CHK1 OPP: DBNZ R5 ,CHK2 SKIPLT R1S-R1S JMP DONE SETR R15-0 JMP VERODD ZEROH. SETR R7«0 (KILL THE εvεN CROSSING PRESεNT SKIPLT R4=.R4 JMP LεFT SET R4-R4-1 iCORRECT POINTER STRεG R7,R6 JMP REV ;CHECK IN OTHER DIRεCTION LEFT: STREG R7.R4 SKIPLT R1S-R15 JMP DONE SETR R1S-0 VERODD: SETR R4-.-1 ;DIRECTION FLAG SETR R5«3 ;COUNT SET R4-R12 REPEAT: SET R4-R4+R1 PTR TO CORRES WORD IN ADJECENT LINE CHK3 : LDREC R7.R4 FETCH DATA SET R8-R7 COPY IT SKIPNE R8 'XOR'*H3c. EVEN VERT POSITIVE STRONG CODE JMP ZEROV SET R8«R7 SKIPNE R8 'XOR'SHSE ;EVEN CORNER STRONG CODE JMP ZEROV DBNZ R5 ,TEST S IPLT R4.R4 ;CHECK DIRECTION JMP DONE REV1 SETR R4.0 FLAG FOR REVεRSE DIRECTION SETR R5 * 3 COUNT SETR R9-STORE FETCH OTHER ADDR LDREGI R< ,R9 JMP REPEAT TEST: SET R7-R5 SKIPEQ R7 'XOR'*H2 -124- JMP THIRD SKIPLT R4-R4 JMP REV2 SET R4-R13 JMP REPEAT ;PTR TO Nε T LINε THIRD: SKIPLT R4-R4 JMP REVS SET R>S * R14 JMP REPεAT ;PTR TO THIRD LINE REV2: LDREGI R« ,R? JMP REPEAT REV3 : LDREGI R4.R9 JMP REPEAT ZEROV: SETR R7-0 ;KILL THE EVEN ZERO CROSSING STRεG R7.R4 SKIPLT R4-R4 JMP DONE JMP RE 1 ;CHεCK IN RεvεRSE DIRECTION STORE: DS 0 ;STORE FOR BUFFER ADDRESSES DS 0 DS 0 END .NLIST TTM ;PRODUCE LISTING IN WIDE STYLE. .ENABL LC • RETAIN LOWER-CASE CHARACTERS AS SUCH. PROGRAM: HSTFNC: EDGE DETECTION FOR RAW IMAGE • PART NUMBER: ; VBRSION DAT8: SEFTεMBεR 13, 1982 ; AUTHOR: CHETANA BUCK ; HISTORY: ; DεSCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UF AN AP-BASED AP FUNCTION IN ORDER TO PERFORM "EDGE DETECTION" OPεRATION BBTWEEN THE RESPεCTIVE ELEMENTS OF TWO AP DATA MEMORY DATA BUF FERS WHICH CONTAIN THE VAHIOUS CONVOLUTION RESULTS OF THE LINE IMAGE WITH A M ASK. .TITLE KHORZ - HSTFNC: EDGE DETεCTION .IDεNT /V01/ IDENTIFIER FOR THE OBJECT MODULB . .PAGE ;ESTABLISH ASSEMBLY AND LISTING CONVεNTIONS: . LIST TTM PRODUCE LISTING IN WIDE STYLE. .DSABL GBL FLAG NON-E ISTENT-SYMBOL REFεRENCES AS ERRORS. .ENABL LC RETAIN LOWER-CASε CHARACTεRS AS SUCH. .CSεCT KHORZ ;ESTABLISH A NAMED CSECT. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KHORZ ;EXTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KEXFCB AP MANAGER'S "FCB EXECUTION" SUBROUTINE. . ' GLOBL KWAIT AP MANAGER'S WAIT ROUTINE .GLOBL MGRM67 AP MANAGER'S "FATAL ERROR t-47" EXIT ROUTINE. .GLOBL COMCTL AP MANAGER'S "FCB CONTROL WORD". ;AF FUNCTION ID'S REFεRENCED: HORZ- ΛD820. ;ID FOR "EDGE DETECTION" ;SYMBOL DEFINITIONS: ;NONE ;TERMINOLOGY: ; FCB - FUNCTION CONTROL BLOCK. READ BY THE AP EXECUTIVE FROM HOST ; MεMORY. .PAGE ;)+HOST FUNCTION "KHORZ" ;THIS HOST FUNCTION CALLS UP A CORRESPONDING AP FUNCTION IN THE AP400. THIS HOST FUNCTION VERSION ASSUMES THAT SOURCE DATA ALREADY RESIDεS IN TWO AP DATA MEMORY DATA BUFFERS, AND THAT THE RESULT DATA WILL Bε PLACED IN ANOTHER AP DATA MεMORY DATA BUFFFR. ;THB CORRESPONDING "EDGε DεTECTlON" AP FUNCTION SHOULD BE REFεRENCED FOR FURTHER ; INFORMATION. ;CALL FROM FORTRAN VIA: O:. < Π»I ' t r ' -126- SUBROUTINε CALL: CALL XHORZ ( DBIi, DBIb, DBIc > OR INTεGER FUNCTION CALL, AS: IERR « KHORZ ( DBIa, DBIb, DBIc ) ; HERE- DBI* « ID OF AP DATA BUFFER' TO HOLD RESULT DATA. "DBI»" MUST BB A SINGLε-WORD INTεGER VARIABLE OR CONSTANT. DBF NEED NOT HAVE BEEN PREVIOUSLY ALLOCATED. IF NOT ALREADY ALLOCATED. DBF WILL BE ALLOCATED; SIZE WILL EQUAL THAT OF SOURCE DATA BUFFERS. IF RESULT DBF WAS PREVIOUSLY ALLOCATED, IT MUST BE OF SIZE EQUAL OR GREATER THAN SOURCE DATA BUFFERS. DBIb » ID OF AP DATA BUFFER HOLDING SOURCE DATA SETC ODD HORZ. CONV RES ULTS i "DBIb" MUST BE A SINGLE-WORD INTBGER VARIABLE OR CONSTANT. DBF MUST HAVE BEεN PRεVIOUSLY ALLOCATεD IN AP DATA MεMORY DATA BUFFERS DBlb.DBIc,DBI .DBIβ MUST BE OF EQUAL LεNGTH. DBIc » ID OF AP DATA BUFFER HOLDING SOURCE DATA SETCEVEN HORZ. CONV RεS ULTS) . "DBIc" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DEF MUST HAVE BEεN PRεVIOUSLY ALLOCATED IN AP DATA MEMORY. ;RETURNS TO FORTRAN WITH: ; ALL ARGUMFNTS RεTURNεD AS RECEIVED. FUNCTION EXECUTION "IN PROGRESS" OR "COMPLETE", DEPENDING UPON CURRENT AP MANAGεR "RETURN" STATUS. IF CALLED AS A FORTRAN FUNCTION. THE VALUE RεTURNED WILL BE AS SPECIFIED ' FOR REGISTER "RO", RETURNED FROM AN ASSEMBLY-LANGUACE CALL. UPON ERROR. A STANDARD AP MANAGER ERROR EXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUAGE VIA: A FORTRAN-COMPATIBLE CALL SEQUENCE. .RETURNS TO CALL+1: (ALWAYS) ALL CONDITIONS AS DεSCRIBBD FOR THE FORTRAN FUNCTION CALL FORM, ABOVF. RO « STATUS VALUε. (DEFINED BY AP MANAGER.) "KHORZ" DEFINES NO UNIQUE VALUES. Rl » UNDEFINεD . R2 » UNDεFINFD. R5 « UNDEFINED. ;UPON ERROR, WHEN CALLED FROM FORTRAN OR ASSEMBLY LANGUAGE: IF A FATAL FRROR OCCURS DURING EXεCUTION OF THIS HOST FUNCTION OR DURING εxεCUTION OF A ROUTINε WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGεR OR AP DRIVER), THE AP MANAGER'S FATAL FRROR εXIT ROUTINE WILL BE CALLED. ; )- .PAGE KHORZ: CMPB (R5), #3 ;CHBCK FOR PROPER NUMBER OF ARGUMENTS. BNE ERRORX ;IF NOT CORRECT NUMBER, HANDLE AS A FATAL ERROR. TST (R5>+ ;STEP POINTER AHEAD TO FIRST ARGUMENT ADDRESS. TST FCBDON TEST FOR COMPLETION OF A PREVIOUS OPERATION. BNE II A ZERO "DONE" FLAG INDICATES PREVIOUS OPERATION STILL IN PROGRESS. JSR PC, WAIT ;WAIT FOR THE AP TO FINISH PROCESSING IS : CLR FCBDON ;RεiNITIALIZε THε "DONε" FLAG. MOV COMCTL, FCBCTL RεTRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SεLECTED OPTIONS. PLACE IT IN FCB'S CONTROL WORD. MOV β(R5> * -, FCBARL iMOVE RBSULT DATA BUFFBH ID "A" INTO FCB ARGUMENT LIST. STEP HOST MεMORY ADDRεSS POINTER AHEAD. MOV β(R5)+. FC8ARL+4 ;MOVE SOURCE DATA BUFFER ID "B" INTO FCB ; ARGUMENT LIST. ; STEP HOST MEMORY ADDRESS POINTER AHEAD. MOV β(R3)+, FCBARL+ΛD8 ;MOVE SOURCE DATA BUFFER ID "C" INTO FCB ARGUMENT LIST. (INCREMENTING RS , ALTHOUGH UNNECε≤SARY, SAVεs EXECUTION TIME AND ONε MEMORY WORD.) MOV •MGRARG, R5 SET UP ADDRESS OF ARGUMENT LIST FOR CALL TO AP MANAGE . JMP XEXFCB CALL UP THE AP MANAGεR TO PROCεSS THE FCB. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR", FOLLOWED BY AN "RTS PC". "KEXFCB" WILL RETURN ITS STATUS VALUE IN PDP-11 REGISTER RO AS WELL AS IN LOCATION "STATUS" . MGRARG: BR 21 BRANCH AROUND ARGUMENT LIST. (THIS INSTRUCTION PROVIDES "NUMBER OF ARGUMENTS" COUNT FOR AP MANAGER; THE BRANCH IS NEVεR ACTUALLY TAKEN.) .WORD FCBBLK ADDRESS OF FCB . .WORD STATUS ADDRESS FOR RETURNED STATUS. 2« : ;THIS LABEL MARKS THE END OF THE ARGUMENT LIST. ERROR : JMP MGRM-37 TAKE AN AP MANAGER STANDARD FATAL ERROR EXIT. RETURN STATUS CODε -47 TO INDICATE "IMPROPER NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS: .WORD ;TEMPORARY STORAGE LOCATION FOR RETURNεD AP ; MANAGεR STATUS. .PAGE ;FUNCTION CONTROL BLOCK: FCBBLK: FCBID- .WORD HORZ ;ID OF THE AP FUNCTION. FCBCTL. .WORD 0 ;CONTROL WORD. FCBDON: .WORD 1 ;DONB FLAG. INITIALIZED TO "DONE" STATE. FCBLNK. .WORD 0 .(HIGH-ORDER.) HOST MEMORY ADDRESS LINK TO NEXT .WORD 0 ;(LOW-ORDER. ) FCB IN HOST MEMOR . (NONε.) FCBPLT: .WORD 1 FCB PARAMBTER LIST TYPE. (DATA BUFFER ID'S.) FCBNRG: .WORD 3 NUMBER OF ENTRIES IN ARGUMENT LIST. FCBLBN: .WORD 4 LENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS. FCBARL: .WORD 0 ;RESULT DATA BUFFBR ID "A" ARGUMεNT. .WORD 0 ; FIRST WORD » DBF ID; SECOND WORD -> 0. -WORD- 0 ;SOURCE DATA BUFFBR ID "B" ARGUMBNT. .WORD 0 ; FIRST WORD ■ DBF ID; SECOND WORD * 0. .WORD 0 -,SOURCε DATA BUFFBR ID "C" ARGUMBNT. .WORD 0 ; FIRST WORD * DBF ID; SεCOND WORD .END ; PROGRAM: APFNC: EDGE DETECTION ; PART NUMBER: ; VERSION DATE: SEPTεMBεR 13, 1982 ; AUTHORS: CHETANA BUCH ; HISTOR : ; DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMS AN EDGE DETECTION BY BASICALLY DETECTING A ZDRO CROSSING IN THE CONVOLVεD RES ULTS OF THE LINE OF RAW IMAGE DATA. ODD AND εVEN MASKS ARE USED ON HORIZONTAL L IMAGE DATA . ; THE RESULT BUFFER CONTAINS A CODED WORD FOR EACH PIXEL. ; THIS AP FUNCTION IS NORMALLY CALLED UP BY THE AP EXεCUTIVE, WHICH ; RETRiεvεS THIS AP FUNCTION'S ID NUMBER FROM A FUNCTION CONTROL BLOCK ; RFAD FROM HOST MEMORY. TITLE APFNC: EDGE DETECTION NAMε QHORZ, 001 ;NAMε AND VεRSION FOR THE OBJECT MODULB . PAGε RADIX ;DEFAULT TO HεXADECIMAL RADIX. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: ( IGLOBL) ; ENTRY POINTS: ;NONE ; SUBROUTINES: ;NONE ; GENERAL SYMBOLS ;NONE ; DATA MEMORY LABELS: ;NONE [EXTERNALLY DEFINED GLOBALIZED SYMBOLS: ( EGLOBL ) ; BNTRY POINTS: ;NONE SUBROUTINεS: EGLOBL PLCHK1 , FTLABT, PLDBF, NRMCND CENERAL SYMBOLS: ;NONE DATA MEMORY LABELS: ; NONE ; SYMBOL DEF INITI ONS : ;NONE j TERMINOLOGY : ,-NONE PMORG ;START OF RELOCATABLB CODε IN PROGRAM MεMORY. ,">+AP FUNCTION "QHORZ" ; This AP Fαnetion performs a edge detection. This is ac ually * * zero crossing ; detection scheme. Call with: parameter list type 1. number of arguments - 3. parameter list length 4. word 9 argument tl ID of result Data Buffer "A" word 10 argument #1 Ignored . word 11 argument #2 ID of source Data Buffer ■ B' word 12 argument 42 Ignor . word 13 argument #3 ID of source Data Buffer word 14 argument #3 Ignored . Elite to AP Executive's "Fatal Abort" Service: If an error is found by AP Service Subroutine "PLDBF* or 'PLCHKl ; >- PAGE ;DSFINITION OF THE FUNCTION ID FOR THE AP -EXECUTIVε FUNCTION TABLE: FUNC SD820, QHORZ ;FUNCTION ID AND εNTRY POINT NAME. QHORZ: SET UP FOR CALL TO PLCHKl SETR Rl.l PARAMETER DESCRIPTOR TYPE SETR R2-3 # OF ARGUMENTS SETR R3>6 • OF WORDS IN ARC LIST JSR PLCHKl GO CHECK CORRECTNESS OF VALUES IN FCB. JMP FTLABT RETURNS HERE IF ERROR IF OK. RETURNS HERE JSR PLDBF FIND SOURCE DATA BUFFERS, ALLOCATE RESULT DBF IF NECεSSARY, SET UP ARGUMENTS FOR A FUNCTION ADDR. CALL. UPON ERROR, EXIT THROUGH AP EXECUTIVE'S FATAL ABORT ROUTINE. JMP FTLABT SET R15-R1 ; R15—>RESULT BUFFER ADDRESS. JSR PLDBF JMP FTLABT SET Rl 3.R1+1 ; R13—>HORZ. ODD CONV < Ho ) BUFFER ADDRESS. JSR PLDBF JMP FTLABT SET R14«R1+1 ; R1 —>HORZ. EVεN CONV ( He > BUFFER ADDRESS. SETR R1«*H0F STREG Rl ,R1S ;S8T BEX OF RESULT BUFFER SETR Rl-0 STREGI Rl .R1S.L0 ;SET NSN OF RESULT SET R12.R2 ; R12—>BUFFER LεNGTH. START: LDREGI R3.R13 ;GET FIRST Ho/Vo VALUE L-DREGI R4 ,R14 ;GET FIRST Hβ/Ve VALUε STRεGI Rl ,R1S ;OUTPUT ZεRO FOR FIRST VALUE sετ R12-R12-1 ;DFCR COUNT CHKO: SKIPLT R5»R3 ;SIGN CHECK FOR ODD VALUES JMP POSODD LDREGI R3 ,R13 CHKE: SKIPGE R5=R4 iSIGN CHECK FOR EVεN VALUεS JMP NEGEVN JMP POSEVN ;HεRε IF VALUE IS ODD AND POSITIVE POSODD: LDREGI R3.R13 ;FETCH NEXT VALUE AND COMPARE WITH PREVIOUS S IPLT R3-R3 JMP CHKE ;CHECK EVEN IF NO SIGN CHANGE SKIPGE R5-R5+R3 SET R11«R11-1 JMP SELODD ;ELSE sε εcT APPROPRIATE CODE FOR OUTPUT ;HERE IF VALUE IS EVEN AND POSITIVE POSEVN: LDREGI R4.R14 ;FETCH NEXT VALUE AND COMPARE WITH PREVIOUS SKIPLT R4-R4 JMP OUTZ ;OUTPUT ZERO, SINCE NO SIGN CHANGE SET R2»R13-l SET R11-R15 SKIPGE R5«R5+R4 SET R2»R2-1 SET Rl 1-Rll-l JMP OUTEVN ;ELSE SELECT APPROPRIATE CODE TO OUTPUT ;HERE IF VALUF IS εVEN AND NEGATIVE NECEVN: LDREGI R4.R14 ;FETCH NEXT VALUE AND COMPARE WITH PREVIOUS SKIPGE R4-R4 JMP OUTZ ;OUTPUT ZERO, SINCE NO SIGN CHANGE -^ ΪRl3 0?. < !?I Cϊ i I IT"-* -r.rn.mm. „„-. - £ s i ϊ.Ji . , t- . <-. lrf YΛ > ? WHO SET R11-R15 SET R2-R13-1 SKIPLT R5-R3+R4 SET Rll-Rll-1 SET R2-RΪ-1 JMP OUTEVN ;ELS8 SELECT APPROPRIATE CODE TO OUTPUT SELODD: SεT R2»R14-1 POINTER TO EVEN DATA GETS THE RIGHT STRENGTH LDREGI R5 ,R2 OBTAIN THE THREε CONSECUTIVE DATA VALUES LDREGI Re .R2 IN R5 , R', R7. SKIPGE R5-R5 SETR R5-0 ,-ZERO IF NEGATIVE SKIPGE »>R< SETR R6-0 SET R7-R4 SKIPGE R6-R4-R5 COMPARE TWO STRεNGTHS SET R7.R5 RS IS LARGER OUTODD : POSITIVE ODD ZεRO CROSSINGS SETR R5«%H3B CODE FOR HORZ POS WEAK ODD PIXEL SETR R8-S.D600 NOISE THRESHOLD FOR ODD SKIPGE R7-R7-R8 CHECK THRESHOLD JMP CHKE TOO LOW , NOT VALID SO CHECK EVEN LDREGI R ,R14 INCR EVEN PTR SINCE NO EVEN CHECK DONE STREG R5.R11 STRONG CODE IN OUT BUFFER JMP NB T OUTEV : SETR R»-c*K3λ -CODE FOR HORZ NEG EVεN STRONG FIxεL LDREG RS ,R2 ϊFETCH STRENGTH SETR R8«%D1000 ;NOISε THRESHOLD FOR EVEN SKIPGE R5-.RS-R8 ;CHECK THRESHOLD JMP OUTZ ;TOO LOW, SO WRITE OUT ZERO STREG R6 ,R11 ;STRONG CODE JMP NEXT OUTZ: SETR R8-0 STREGI R8,R1S ;WRITE OUT A ZERO...NO EDGE JMP NEXT1 NEXT: SKIPGE Rl 1«R11-R15 JMP OUTZ SET R15-R15+1 NEXT1 : DBNZ R12.CHKO ;REPEAT TILL ALL PIXELS TESTεD JMP NRMCND GO TO NORMALIZE THE RESULT DATA, IF FCB CONTROL BIT INDICATES SUCH REQUIRεMεNT. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR" FOLLOWED BY AN "RTN" . RTN -133- END .NLIST TTM ;PRODUCE LISTING IN WIDE STYLE. .ENABL LC ;RETAIN LOWER-CASE CHARACTERS AS SUCH. PROGRAM: HSTFNC: EDGε DETECTION FOR RAW IMAGE PART NUMBER: VBRSION DATE SEPTEMBER 6 , 1*>82 AUTHO : CHETANA BUCH HISTORY: DESCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UP AN AP-BASεD AP FUNCTION IN ORDER TO PERFORM "FDGE DETECTION" OPERATION BETWEEN THE RESPεCTIVE ELEMεNTS OF FOUR AP DATA MEMORY DATA BU FFERS WHICH CONTAIN THB VARIOUS CONVOLUTION RεSULTS OF THE LINε IMAGE WITH A M ASK. .TITLE KVZER - HSTFNC: EDGε DεTεCTION .IDεNT /V01/ ;IDεNTIFIER FOR THE OBJECT MODULE, SUBSTIT .PAGE ;ESTABLISH ASSEMBLY AND LISTING CONVENTIONS: .NLIST TTM PRODUCE LISTING IN WIDE STYLE. .DSABL GEL FLAG NON-EXISTENT-SYMBOL REFFRENCES AS ERRORS .ENABL LC RETAIN LOWER-CASE CHARACTERS AS SUCH. .CSεCT KVZER ;ESTABLISH A NAMED CSECT. .INTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KVZER ;EXTERNALLY DEFINFD GLOBALIZED SYMBOLS: .GLOBL KBXFCB AP MANAGER'S "FCB EXECUTION" SUBROUTINB. .GLOBL KWAIT AP MANAGER'S WAIT ROUTINE .GLOBL MGRM.S7 AP MANAGER'S "FATAL ERROR tt-t.7" EXIT ROUTINE. -GLOBL COMCTL AP MANAGER'S "FCB CONTROL WORD". ;AP FUNCTION ID'S REFERENCED: VZER. ΛD810. ; ID FOR "VERTICAL EDGE DETECTION" ;SYMBOL DEFINITIONS: ;NONE ;TERMINOLOGY: ; FCB - FUNCTION CONTROL BLOCK, READ BY THE AP EXECUTIVE FROM HOST MEMORY. .FACE ;>+HOST FUNCTION "KVZER" ;TH1S HOST FUNCTION CALLS UP A CORRESPONDING AP FUNCTION IN Hε AP400. ;THIS HOST FUNCTION VERSION ASSUMES THAT SOURCE DATA ALREADY RESIDεS IN FOUR AP ,-DATA MεMORY DATA BUFFERS, AND THAT THE RESULT DATA WILL BE PLACED IN ANOTHER ;AP DATA MEMORY DATA BUFFER. ,-THE CORRεSPONDING "EDGE DETECTION" AP FUNCTION SHOULD BE REFεRENCED FOR FURTHFR ; INFORMATION. ;CALL FROM FORTRAN VIA: SUBROUTINE CALL: CALL XVZER C DBIa, DBIb, DBIc, DBI , DBIi,DBI i ) OR INTεGER FUNCTION CALL, AS: IERR - KVZER ( DBI*, DBIb, DBIc, DBI , D Ble ) > ;WHERE: DBI» » ID OF AP DATA BUFFER TO HOLD SOURCE DATA. "DBI*" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF NEED NOT HAVE BEEN PREVIOUSLY ALLOCATED. IF NOT ALRBADY ALLOCATED, DBF WILL BE ALLOCATED; SIZE WILL EQUAL THAT OF SOURCE DATA BUFFERS. IF RESULT DBF WAS PREVIOUSLY ALLOCATED, IT MUST BE OF SIZE EQUAL OR GREATER THAN SOURCE DATA BUFFERS. DBIb - ID OF AP DATA BUFFER HOLDING SOURCE DATA SET "DBIb" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PREVIOUSLY ALLOCATED IN AP DATA MEMORY. DATA BUFFERS DBI ,DBIc ,DBId,DBIc MUST BE OF EQUAL LENGTH. DBIc -. ID OF AP DATA BUFFER HOLDING SOURCE DATA SET "DBIc" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PREVIOUSLY ALLOCATED IN AP DATA MEMORY. DBId -t ID OF AP DATA BUFFER HOLDING SOURCE DATA SET SAME RESTRICTIONS AS ABOVE APPLY. DBIe = ID OF AP DATA BUFFER HOLDING EVEN VεRT. CONV RESULTS. SAME RESTRICTIONS AS ABOVE APPLY. ; ETURNS TO FORTRAN WITH: ALL ARGUMENTS RETURNεD AS RECEIVεD. FUNCTION EXECUTION "IN PROGRESS" OR "COMPLETE", DEPENDING UPON CURRENT AP MANAGER "RETURN" STATUS . IF CALLED AS A FORTRAN FUNCTION. THE VALUE RETURNED WILL BE AS SPECIFIED FOR REGISTER "RO", RETURNED FROM AN ASSEMBLY-LANGUAGE CALL. ; UPON ERROR, A STANDARD AP MANAGER ERROR EXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUACE VIA: ; A FORTRAN-COMPATIBLE CALL SEQUENCE. ;RETURNS TO CALL+1: (ALWAYS) ALL CONDITIONS AS DESCRIBED FOR THE FORTRAN FUNCTION CALL FORM, ABOVE. RO « STATUS VALUE. (DEFINED BY AP MANAGER . > "KvzεR" DεεiNεs NO UNIQUE VALUES. Rl » UNDEFINED. R2 « UNDEFINED. R5 « UNDEFINED. ;UPON ERROR, WHEN CALLED FROM FORTRAN OR ASSEMBLY LANCUAGE : IF A FATAL ERROR OCCURS DURING EXECUTION OF THIS HOST FUNCTION OR DURING EXECUTION OF A ROUTINE WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGER OR AP DRIVεR) . THE AP MANAGER'S FATAL ERROR EXIT ROUTINE WILL BE CALLED. ; >- .PAGE KVZER: CMPB (R5). #4 ;CHECK FOR PROPER NUMBER OF ARGUMENTS. BNE ERRORX ;IF NOT CORRECT NUMBER. HANDLE AS A FATAL ERROR. TST CR5)+ ;STεP POINTER AHEAD TO FIRST ARGUMεNT ADDRεSS. TST FCBDON TEST FOR COMPLETION OF A PREVIOUS OPERATION. BNE It A ZERO "DONE" FLAG INDICATES PREVIOUS OPERATION STILL IN PROGRESS. JSR PC. WAIT ;WAIT FOR THE AP TO FINISH PROCESSING IS: CLR FCBDON REINITIALIZE THε "DONε" FLAG. . MOV COMCTL, FCBCTL RETRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SELεCTεD OPTIONS. PLACE IT IN FCB'S CONTROL WORD. MOV β<R5)s , FCBARL MOVE SOURCE DATA BUFFER ID "A" INTO FCB ARGUMENT LIST. STEP HOST- εMORY ADDRεSS POINTER AHEAD. MOV 9<R5>+, FCBARL+4 ;MOVE SOURCE DATA BUFFER ID "B" INTO FCB ; ARGUMENT LIST. STEP HOST MEMORY ADDRESS POINTER AHEAD. MOV βCRS>+, FCBARL+ΛDβ ;MOVE SOURCE DATA BUFFER ID "C" INTO FCB ARGUMENT LIST. MOV β(R5>+.FCBARL+ΛD12 ;MOVE SOURCE DATA BUFFER ID "D" INTO FCB ; ARGUMENT LIST. MOV βCR5)+,FCBARL+ΛDl« ;MOVE SOURCE DATA BUFFER ID "E" INTO FCB ; ARGUMENT LIST. MOV β(R5>+,FCBARL+AD20 .MOVE SOURCE DATA -BUFFBR ID "F" INTO FCB ARGUMENT LIST. (INCREMENTING R5 , ALTHOUGH UNNECESSARY, SAVES EXECUTION TIME AND ONE MEMORY WORD.) MOV •MGRARG, R5 SET UF ADDRESS OF ARGUMENT LIST FOR CALL TO AP MANAGER. JMP KEXFCB CALL UP THE AP MANAGER TO PROCESS THE FCB. A DIRECT BRANCH IS THε εQUIVALENT OF A "JSR", FOLLOWFD BY AN "RTS PC". "KEXFCB" WILL RBTURN ITS STATUS VALUε IN PDP-11 RECISTER RO AS WεLL AS IN LOCATION "STATUS" . MGRARG: BR 2. BRANCH AROUND ARGUMENT LIST. (THIS INSTRUCTION PROVIDES "NUMBER OF ARGUMENTS" COUNT FOR AP MANAGER; THE BRANCH IS NEVER ACTUALLY TAKEN.) .WORD FCBBLK ADDRESS OF FCB. .WORD STATUS ADDRESS FOR RεTURNεD STATUS. 2t ;THIS LABEL MARKS THE END OF THE ARGUMENT LIST. ERRORX: JMP MGRM67 TAKE AN AP MANAGER STANDARD FATAL ERROR EXIT. RETURN STATUS CODε -.57 TO INDICATE "IMPROPER NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS: .WORD ;TEMPORARY STORAGE LOCATION FOR RETURNED AF ; MANAGER STATUS. .PAGE .FUNCTION CONTROL BLOCK FCBBLK. FCBID: .WORD VZER ID OF THE AP FUNCTION. FCBCTL: .WORD 0 CONTROL WORD. FCBDON: .WORD 1 DONE FLAG. INITIALIZED TO "DONE" STATE. FCBLNK: .WORD 0 (HIGH-ORDER.) HOST MEMORY ADDRESS LINK TO NEXT .WORD 0 (LOW-ORDER.) FCB IN HOST MEMORY. (NONE.) FCBPLT: .WORD 1 FCB PARAMETER LIST TYPE. (DATA BUFFER ID'S. ) FCBNRG: .WORD 6 NUMBER OF ENTRIES IN ARGUMENT LIST. FCBLEN: .WORD ΛD12 LENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS. FCBARL: .WORD 0 ;RESULT DATA BUFFER ID "A" ARGUMENT. .WORD 0 ; FIRST WORD - DBF ID; SECOND WORD = 0. .WORD [SOURCE DATA BUFFER ID "E" ARGUMBNT. .WORD FIRST WORD * DBF ID; SBCOND WORD WORD 0 ;SOURCR DATA BUFFBR ID "C" ARGUMENT. WORD 0 ; FIRST WORD - DBF ID; SECOND WORD . WORD 0 ; SOURCE DATA BUFFER ID "D" ARGUMENT WORD 0 ; FIRST WORD » DBF ID; SεCOND WORD . WORD 0 ;SOURCε DATA BUFFBR ID "B" ARGUMENT. WORD 0 ; FIRST WORD - DBF ID; SECOND WORD . 0. WORD 0 WORD 0 .END PROGRAM: APFNC: EDGE DETεCTION PART NUMBER: VERSION DATE: SεPTEMBER 4, 1982 AUTHORS. CHETANA BUCH HISTORY: DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMS AN EDGE DETECTION EY BASICALLY DETECTING A ZERO CROSSING IN THE CONVOLVED RES ULTS * OF THE LINE OF RAW IMAGε DATA. ODD AND EVEN MASKS ARE USED BOTH HORIZONT ALLY AND VERTICALLY ON THE IMAGE DATA RESULTING IN FOUR DATA BUFFERS WHICH HAVE TO BE STUDIED FOR THE EDGE DETECTION. THE RESULT BUFFER CONTAINS A CODED WORD FOR FACH PIXεL. THIS AP FUNCTION IS NORMALLY CALLED UP BY THE AP EXECUTIVE, WHICH RETRIEVES THIS AP FUNCTION'S ID NUMBER FROM A FUNCTION CONTROL BLOCK RBAD FROM HOST MεMOR . TiTLε APFNC: εDcε Dετεcτi0N NAMε QVZER. 001 ;NAME AND VERSION FOR THE OBJECT MODULE. PAGE RADIX ;DEFAULT TO HEXADECIMAL RADIX. INTERNALLY DEFINED GLOBALIZED SYMBOLS: (IGLOBL) ENTRY POINTS: ;NONE SUBROUTINES: ;NONE GENεRAL SYMBOLS ;NONB DATA MεMORY LABBLS: -13 * 9- ;EXTERNALLY DEFINED GLOBALIZED SYMBOLS: (EGLOBL) ; ENTRY POINTS: ;NONE ; SUBROUTINES: EGLOBL PLCHKl, FTLABT, PLDBF, NRMCND ; GENERAL SYMBOLS: ;NONE ; DATA MEMORY LABELS: ;NONE ;SYMBOL DεFINITIONS: ;NONE ;TERMINOLOG : ,-sNONε PAGE PMORG ;START OF RELOCATABLB CODε IN PROGRAM MEMORY. ;)+AP FUNCTION "QVZER' This AP Function perfoxms *n edge detection. Thi is actually a zero crossing detection scheme. Call with: parameter list type 1. number of arguments parameter list length 12. word 9 argument tl « ID of result Data Buffer "A" word 10 argument tl « Ignored . word 11 argument #2 » ID of source Data Buffer "E". word 12 argument t2 ■ Ignored. word 13 argument t3 « ID of source Data Buffer "C". word 14 argument t3 - Ignored . word IS argument t4 ID of source Data Buffer SUCGTETUT E word t£ argument #4 Igno ed . word 17 argument tS ID of source Data Buffer word 1? argument #5 Igno e . ; Exits to AP Executive's "Fatal Abort" Service: If an error is found by 'AP Sβrrie* Subroutine 'PLDBF' or 'PLCHKl' ; >- PAGE ;DεFINITION OF THE FUNCTION ID FOR THE AP εXECUTIVE FUNCTION TABLE: FUNC *D810. QVZER ;FUNCTION ID AND ENTRY POINT NAME. QVZER: SET UP FOR CALL TO PLCHKl SETR Rl.l ; PARAMETER DESCRIPTOR TYPE SETR R2-4 ;t OF ARGUMENTS SETR R3s*D12 ; * OF WORDS IN ARG LIST JSR PLCHKl ; GO CHECK CORRECTNESS OF VALUES IN FCB. JMP FTLABT ; RETURNS HERE IF ERROR IF OK, RETURNS HERE SETR RlS'i ; FETCH: JSR PLDBF FIND SOURCE DATA BUFFERS, JMP FTLABT ALLOCATE RESULT DBF IF NECESSARY, SET R -Rl+1 SET UP ARGUMENTS FOR A FUNCTION ADDR. CALL. PUSH Rl UPON ERROR, EXIT THROUCH AP EXECUTIVE'S DBNZ R15,FETCH FATAL ABORT ROUTINE. POP R1S R15 --> ZER2 POP R14 R14 > ZER1 POP R13 R13 —> VE2 POP R12 R12 —) V02 POP Rll Rll —) VE1 POP RIO RIO > VOl SETR Rl>>rjHQF SET R14-R14-1 SET R15-R15-1 STREG Rl .R14.HI STREG Rl ,R15,HI SETR R1»0 STREGI Rl ,R14,LO STREGI Rl .R15.LO START: LDREGI R3 ,R10 ;CET FIRST VOl VALUE LDREGI R ,R12 ;GET FIRST V02 VALUF SETR R8-0 ;FLAG FOR EVEN/ODD TEST: SETR R?-=0 ;FLAG FOR SICN SKIPGE R3«R3 JMP NEG SKIPGE R4-R4 JMP ZεRO CHK: SKIPLT R8=R8_ CHECK IF EVEN OR ODD JMP CHKε IF ODD, CHK EVEN FINISH: SET Rt 4.R14+1 ELSE UPDATE POINTERS SET R15.R13+1 NEXT: DBNZ R2 , START ;AND CHECK NEXT VALUE JMP NRMCND CO TO .NORMALIZE THE RESULT DATA. IF FCB CONTROZ BIT INDICATES SUCH REQUIREMεNT. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR" FOLLOWεD BY AN "RTN" . RTN CHKE: LDREGI R3 ,R11 FETCH VE1 LDREGI R ,R13 FETCH VE2 SETR Rβ.-l FLAG EVEN DATA JMP TEST NEG SKIPGE R4=R4 JMF CHK ;NO SIGN CHANCE SKIPLT R8=R8 ;CHECK FO NFC ODD JMP CHKE SETR RT=-1 ;MARK FOR NEGATIVE * ZERO : SKIPLT R9»R9 ;CHK SIGN JMP NEGNO SKIPLT R3-.R3-t.R4 ;R3 IS -VE ;R4 IS +VE JMP EVEP A20: SKIPGE R8->R8 JMP EVEN SETR R9«0 CODE: LDREG R5 ,R13 ;CET CORRES EVEN STRENGTHS LDREC Rs. ,R11 SKIPGE R5-R5 SETR R5«0 SKIPGE Ri-R' SETR R---.0 SET R7-R6 SKIPGE Rά-Ri-RS ■ ,R7 IS MAX CR5.R6. SKIPNE R7-R7 "OR 'R7 JMP CHKE ;-Vε VALUE NOT VALID FOR ODD SETP. R6=««tD600 ;NOISE THRESHOLD SKIPLT R6-R6-R? JMP CHKE ;NOISE SETR R6«*H37 ,-VERT ODD PIXEL SKIPLT R9=R? JMP OUT STREGI R6 ,R14 SET R15-R15+1 JMP DONE -142- OUT¬ STREGI R- ,R15 SET R14-.R14+1 DONE - SET Rl l»Rll-rl SET R13-.R13+1 JMP NEXT A10: SKIPGE R8«R8 JMP EVEP SETR R9«-l JMP CODE EVEN: SET R4.R12-1 LDREG R5 , Ri SKIPGE R5.HS SET RSi'COMP'R! SKIPLT R4-R4-R3 JMF FINISH STREGI R< ,R1S SET R14-R14+1 JMP NEXT LDREG R5.Rl, SKIPGE R5=R5 SET R5»'COMP'R. SETR Ro-=%D1000 SKIPLT Rβ«Rsi-R5 JMF FINISH SETR R6. H34 LDREG R7 ,R14 SKIPNE R7-R7 'XOR'%H3? JMP FINISH STREGI Ri ,R14 SET R1E.R15+1 JMP NEXT NEGNO : SKIPGE R3>R3s-R4 JMP A10 JMP A20 END -14-3- .NLIST TTM IPRODUCE LISTING IN WIDE STYLE. .ENABL LC iRETAIN LOWER-CASε CHARACTεRS AS SUCH. PROGRAM: HSTFNC: BYTE- UNPACKIG PART NUMBER: VERSION DATE: SEPTEMBER 7, 1982 AUTHOR: CHETANA SUCH HISTORY: DESCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UP AN AP-BASED AP FUNCTION IN ORDER TO PERFORM "UNPACKING" .TITLE KUPAK HSTFNC: UNPACK DATA FROM BYTE TO WORD FORMAT .IDENT /VOl/ ; IDENTIFIER FOR THE OBJECT MODULE. .PAGE ^ESTABLISH ASSEMBLY AND LISTING CONVENTIONS: . IST TTM PRODUCE LISTING IN WIDE STYLE. .DSAEL GSL FLAG NON-EXISTENT-SYMBOL REFERENCES AS ERRORS. . ENABL LC RETAIN LOWER-CASE CHARACTERS AS SUCH. .CSECT KUPAK ESTABLISH A NAMED CSECT. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: GLOBL KUPAK ;EXTERNALLY DEFINεD GLOBALIZED SYMBOLS: .GLOBL KEXFCB ;AP MANAGER'S "FCB EXECUTION" SUBROUTINE. .CLOBL .KWAIT ;AP MANAGER'S WAIT ROUTINE .GLOBL MGRM67 ;AP MANAGER'S "FATAL ERROR «-67" EXIT ROUTINE. .GLOBL COMCTL ;AP MANAGER'S "FCB CONTROL WORD". ;AP FUNCTION ID'S REFεRENCED: UPAK« ΛD814. ;ID FOR "UNPACKING" ;SYMBOL DEFINITIONS: ;NONE -144- ;TERMINOLOGY: ; FCB - FUNCTION CONTROL BLOCK, READ BY THE AP EXECUTIVE FROM HOST ; MEMOR . .PAGE ; ,+HOST FUNCTION "KUPAK" .-THIS HOST FUNCTION CALLS UP A CORRESPONDING AP FUNCTION IN THE AP400. ;THIS HOST FUNCTION VERSION ASSUMES THAT SOURCE DATA ALREADY RESIDES IN ONE AP ;DATA MEMORY DATA BUFFERS, AND THAT THE RESULT DATA WILL BE PLACED IN RESULT ;AP DATA MEMORY DATA BUFFER WHICH WILL HAVE TWICE THE SIZE OF THE SOURCE. ;THE CORRESPONDING "UNPACKING" AP FUNCTION SHOULD BE REFεRENCED FOR FURTHER : INFORMATION. ;CALL FROM FORTRAN VIA: SUBROUTINE CALL: CALL KUPAK C DBIa, DBIb > OR INTEGER FUNCTION CALL, AS: IERR a. KUPAK C DBI*, DBIb > ; HERE: . OBla * ID OF AP DATA BUFFER TO HOLD RESULT DATA "DBIi" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. THIS BUFFER WILL BE TWICE THE SIZE OF THε SOURCE BUFFER. DBF SHOULD HAVE BEEN PREVIOUSLY ALLOCATED. DBIb -= ID OF AP DATA BUFFER HOLDING SOURCE DATA SET. "DBIb" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. ; ETURNS TO FORTRAN WITH: ; ALL ARGUMENTS RεTURNED AS RεCEIVED. : FUNCTION EXECUTION "IN PROGRESS" OR "COMPLETE", DEPENDING UPON CURRENT ; AP MANAGER "RETURN" STATUS. ; IF CALLED AS A FORTRAN FUNCTION, THE VALUE RETURNED WILL BE AS SPECIFIFD ; FOR RFGISTER "RO", RETURNED FROM AN ASSEMBLY-LANGUAGE CALL. ; UPON ERROR, A STANDARD AP MANAGER ERROR EXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUAGE VIA: ; A FORTRAN-COMPATIBLE CALL SEQUENCE. ;RETURNS TO CλLL+1: (ALWAYS) ; ALL CONDITIONS AS DESCRIBED FOR THE FORTRAN FUNCTION CALL FORM, ABOVE. EET -145- R0 » STATUS VALUE. (DEFINED BY AP MANAGER.) "KUPAK" DEFINFS NO UNIQUE VALUεS. Rl - UNDEFINED. R2 * UNDEFINED. R5 « UNDEFINED. UPON ERROR, WHEN CALLED FROM FORTRAN OR ASSEMBLY LANGUAGE: IF A FATAL ERROR OCCURS DURING EXECUTION OF THIS HOST FUNCTION OR DURING EXECUTION OF A ROUTINE WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGER OB AP DRIVER), THE AP MANAGER'S FATAL ERROR EXIT ROUTINE WILL BE CALLED >- .PAGE KUPAK CMPE (RS ) , *2 ;CHECK FOR PROPER NUMBER OF ARGUMENTS. .BNE ERRORX ;IF NOT CORRECT NUMBER, HANDLE AS A FATAL ERROR . TST (R5)+ ;STEP POINTER AHEAD TO FIRST ARGUMENT ADDRESS. TST FCBDON TEST FOR COMPLETION OF A PREVIOUS OPERATION. BNE 15 A ZERO "DONE" FLAG INDICATES PREVIOUS OPERATION STILL IN PROGRESS JSR PC,KWAIT ;WAIT FOR THE AP TO FINISH PROCESSING IS CLR FCBDON ;REINITIALIZE THE "DONE" FLAG MOV COMCT , FCBCTL RETRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SELECTED OPTIONS. PLACE IT IN FCB'S CONTROL WORD. MOV β(RS)+, FCBARL MOVE RESULT DATA BUFFER ID "A" INTO FCS ARGUMENT LIST. STEP HOST MEMORY ADDRESS POINTER AHEAD. MOV β(R5)+ , FCBARLι-4 ;MOVE SOURCE DATA BUFFER ID "B" INTO FCB ARGUMENT LIST. STEP HOST MEMORY ADDRESS POINTER AHEAD. (INCREMENTING R5 , ALTHOUGH UNNECESSARY, SAVES EXECUTION TIME AND ONE MEMORY WORD.) MOV .MGRARG, RS SET UP ADDRESS OF ARGUMENT LIST FOR CALL TO AP MANAGER . JMP KEXFCB CALL UP THE AP MANAGεR TO PROCESS THE FCB. A DIRECT BRANCH IS THE EQUIVALεNT OF A "JSR", FOLLOWFD BY AN "RTS PC". "KEXFCB" WILL RETURN ITS STATUS VALUE IN PDP-11 REGISTER RO AS WELL AS IN LOCATION "STATUS" . MGRARG. BR 2S BRANCH AROUND ARGUMENT LIST. (THIS INSTRUCTION PROVIDES "NUMBER OF ARGUMENTS" COUNT FOR AP MANAGER; THE BRANCH IS NEVER ACTUALLY TAKEN. ) .WORD FCBBLK ADDRESS OF FCB. .WORD STATUS ADDRESS FOR RETURNED STATUS. 25 : ;THIS LABEL MARKS THE END OF THE ARGUMENT LIST. ERROR : JMP MGRM6 * 7 TAKE AN AP MANACER STANDARD FATAL ERROR EXIT RETURN STATUS CODE -47 TO INDICATE "IMPROPER NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS: .WORD ;TEMPORARY STORAGE LOCATION FOR RETURNεD AP ; MANAGεR STATUS. .PAGE ;FUNCT: ON CONTROL BLOCK FCBBLK FCEID: .WORD UPAK ID OF THE AP FUNCTION. FCBCTL -WORD 0 CONTROL WORD FCBDON: .WORD 1 DONE FLAG. INITIALIZED TO "DONE" STATE FCBLNK: .WORD 0 (HIGH-ORDER. ) HOST MεMORY ADDRESS LINK TO NEX * ) .WORD 0 CLOW-ORDER.) FCB IN HOST MEMORY. (NONE.) FCBPLT: .WORD 1 ;FCB PARAMETER LIST TYPE. (DATA BUFFER ID'S.) FCBNRG. -WORD 2 .NUMBER OF ENTRIES IN ARGUMENT LIST. FCBLEN .WORD 4 ; ENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS FCBARL: .WORD 0 ;RESULT DATA BUFFER ID "A" ARGUMENT. .WORD 0 FIRST WORD » DBF ID, SECOND WORD 0. WORD 0 ;SOURCE DATA BUFFER ID ' E" ARGUMENT. .WORD 0 FIRST WORD a- DBF ID; SECOND WORD a 0. .END -147- ; PROGRAM: APFNC: UNPACKING OF DATA ; PART NUMBER: VERSION DATE: SEPTEMBER 7, 1982 ; AUTHORS : CHETANA BUCH ; HISTORY: ; DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMS UNPACKING OF DATA IN THE AP FROM BYTE FORMAT TO WORD FORMAT. ; THIS AP FUNCTION IS NORMALLY CALLED UP BY THE AP EXECUTIVE, WHICH ; RETRIEVES THIS AP FUNCTION'S ID NUMBER FROM A FUNCTION CONTROL BLOCK READ FROM HOST MEMOR . TITLE APFNC: UNPACK DATA NAME QUPAK, 001 ;NAME AND VERSION FOR THE OBJECT MODULE. PAGE RADIX H ;DEFAULT TO HFXADECIMAL RADIX. ; INTERNALLY DEFINED GLOBALIZED SYMBOLS: (IGLOBL) ; ENTRY POINTS: ;NONE ; SUBROUTINBS: ;NONE ; GENERAL SYMBOLS ;NONE ; DATA MEMORY LABELS: ;NONE ;EXTERNALLY DEFINED GLOBALIZBD SYMBOLS: (EGLOBL) ; BNTRY POINTS: -148- ; NONE SUBROUTINES: EGLOBL PLCHKl, FTLABT, PLDBF, NRMCND GENERAL SYMBOLS : ,-NONE DATA MEMORY LABELS: ;NONE ;SYMBOL DEFINITIONS: ;NONE ;TERMINOLOGY: ;NONE PAGE PMORG ;START OF RELOCATABLE CODE IN PROGRAM MEMORY. ,->+AP FUNCTION "QUPAK" ; This AP Function performs unpacking of data from a. source buffer.The resulting , buffer will be twice the sixe of the the source buffer. Call with: parameter list type 1, number of arguments 2. parameter list length 4. word 9 argument tl ID of result Data Buffer "A* word 10 argument #1 Ignored . word 11 argument #2 ID of source Data Buffer "B* word 12 argument 2 Ignore . Exits to AP Executive's "Fatal Abort" Service: If an error is found by AP Service Subroutine 'PLDBF' of 'PLCHKl PAGE DEFINITION OF THE FUNCTION ID FOR THE AP EXECUTIVE FUNCTION TABLE: FUNC SD81 , QUPAK ;FUNCTION ID AND ENTRY POINT NAME. -149- QUPAK: SBT UP FOR CALL TO PLCHKl SETR Rl«l PARAMεTER DESCRIPTOR TYPE SETR R2-2 » OF ARGUMENTS SETR R3-.4 * OF WORDS IN ARC LIST JSR PLCHKl GO CHECK CORRECTNESS OF VALUES IN FCB. JMP FTLABT ;RETURNS HERE IF ERROR ;IF OK, RETURNS HERE JSR PLDBF JMP FTLABT SET R15-R1 POINTS TO RESULT BUFFER JSR PLDBF JMP FTLABT Rl POINTS TO SECOND SOURCE BUFFER LDREGI RIO .Rl FETCH BEX/NSN STREGI R10.R1S NEXT. LDREGI R3 ,R1 ;FETCH NEXT WORD SET R4 * R3 SETR Rό-.ttHFF ;SET MASK SET R3«R3 'AND'Rά ;R3—>LS BYTE WORD SETR R5 * 8 SHIFT: SET R4»R .2 ;SHIFT RIGHT DBNZ RS .SHIFT SET R4-.R4 'AND'R6 ;R —>MS BYTE WORD STREGI R3 ,R1S STRBGI R4 ,R15 DBNZ • R2.NEXT JMP NRMCND GO TO NORMALIZE THE RESULT DATA, IF FCB CONTROL BIT INDICATES SUCH REQUIREMENT. A DIRECT BRANCH IS THE EQUIVALεNT OF A "JSR" FOLLOWFD BY AN "RTN" . RTN END .N IST TTM ;PRODUCE LISTING IN WIDE STYLE. . ENABL LC ;RETAIN LOWER-CASE CHARACTERS AS SUCH. PROGRAM: HSTFNC: OR-ING OF TWO DATA BUFFERS PART NUMBER: VERSION DATE: SEPTEMBER 7. 1982 AUTHO : CHETANA BUCK HISTORY: DESCRIPTION: THIS FORTRAN-CALLABLE HOST FUNCTION CALLS UP AN AP-EASED AP FUNCTION IN ORDER TO PεRFORM "OR-ING" OPERATION BETWEEN THE RESPECTIVE ELEMENTS OF TWO AP DATA MEMORY DATA BUF FERS .TITLE KORDB - HSTFNC: OR TWO DATA BUFFERS .IDENT /VOl/ IDENTIFIER FOR THE OBJECT MODULE. .PAGE ;ESTABLISH ASSEMBLY AND LISTING CONVENTIONS: .NLIST TTM ;PRODUCE LISTING IN WIDE STYLE. .DSABL GBL ;rLAG NON-E ISTENT-SYMBOL REFERENCES AS ERRORS. .ENABL LC ;RETAIN LOWER-CASE CHARACTERS AS SUCH. .CSECT KORDB ;ESTABLISH A NAMED CSECT. ;INTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KORDB .EXTERNALLY DEFINED GLOBALIZED SYMBOLS: .GLOBL KEXFCB AP MANAGER'S "FCB EXECUTION" SUBROUTINE. .GLOBL KWAIT AP MANAGER'S WAIT ROUTINE .GLOBL MGRM67 AP MANAGER'S "FATAL ERROR #-67" EXIT ROUTINE. .GLOBL COMCTL AP MANAGER'S "FCB CONTROL WORD". ;AP FUNCTION ID'S REFERENCED: ORDB-. ΛD812. ; ID FOR "OR-ING' ;SYMBOL DEFINITIONS: ;NONE ,T8RMINOLOCY: ; FCB - FUNCTION CONTROL BLOCK, READ BY THE AP EXECUTIVE FROM HOST ; MEMOR . .PAGE ;>s.HOST FUNCTION "KORDB" ;THIS HOST FUNCTION CALLS UF A CORRESPONDING AP FUNCTION IN THE AP400. ;THIS HOST FUNCTION VERSION ASSUMES THAT SOURCE DATA ALREADY RESIDES IN TWO AF ;DATA MEMORY DATA BUFFERS, AND THAT THE RESULT DATA WILL BE PLACED IN ONE OF THE SE ;AP DATA MEMORY DATA BUFFER. ;THE CORRESPONDING "OR-ING" AP FUNCTION SHOULD BE REFERENCED FOR FURTHER ; INFORMATION. .CALL FROM FORTRAN VIA: SUBROUTINE CALL: CALL KORDB ( DBIa, DBIb ) ' OR INTEGER FUNCTION CALL, AS: IERR at KORDB < DBI*, DBIb ) ;WHERE: DBI* « ID OF AP DATA BUFFER TO HOLD RESULT DATA AND CONTAINS SOURCE DAT "DBIi" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF NBεD NOT HAVE BEEN PREVIOUSLY ALLOCATεD . IF NOT ALREADY ALLOCATED, DBF WILL BE ALLOCATED; SIZE WILL EQUAL THAT OF SOURCE DATA BUFFERS. IF RESULT DBF WAS PREVIOUSLY ALLOCATED, IT MUST BE OF SIZE EQUAL OR GREATER THAN SOURCE DATA BUFFEHS. DBIt » ID OF AP DATA BUFFER HOLDING SOURCE DATA SET. "DBIb" MUST BE A SINGLE-WORD INTEGER VARIABLE OR CONSTANT. DBF MUST HAVE BEEN PRεVIOUSLY ALLOCATED IN AP DATA MEMORY. DATA BUFFEHS DBl ,DBIc ,DBId ,DBIβ MUST BE OF EQUAL LENGTH. RETURNS TO FORTRAN WITH: ALL ARCUMENTS RETURNED AS RECEIVED. FUNCTION EXECUTION "IN PROGRESS" OR "COMPLETE", DEPENDING UPON CURRENT AP MANAGER "RεTURN" STATUS . IF CALLED AS A FORTRAN FUNCTION, THE VALUE RETURNED WILL BE AS SPECIFIED FOR REGISTER "RO", RETURNED FROM AN ASSEMBLY-LANGUAGE CALL. 1 ClΛT WH -152- ; UPON ERROR, A STANDARD AP MANAGER ERROR EXIT WILL BE TAKEN. ;CALL FROM PDP-11 ASSEMBLY LANGUAGE VIA: ; A FORTRAN-COMPATIBLE CALL SEQUENCE. .RETURNS TO CALL+1: (ALWAYS) ; ALL CONDITIONS AS DESCRIBED FOR THE FORTRAN FUNCTION CALL FORM, ABOVE. RO « STATUS VALUE. (DEFINED BY AP MANAGER.) : "KORDB" DEFINES NO UNIQUE VALUES. ; Rl « UNDEFINED. ; R2 » UNDEFINED. ; RS - UNDEFINED. .-UPON ERROR, WHEN CALLED FROM FORTRAN OR ASSEMBLY LANGUAGE: IF A FATAL ERROR OCCURS DURING EXECUTION OF THIS HOST FUNCTION OR DURING ; EXECUTION OF A ROUTINE WHICH IT (IN TURN) CALLS (SUCH AS THE AP MANAGER ; OR AF DRIVER), THE AP MANAGER'S FATAL ERROR EXIT ROUTINE WILL BE CALLED. .PAGE KORDE : CMPE (R5), #2 ;CHECK FOR PROPER NUMBER OF ARGUMENTS. BNE ERRORX ; IF NOT CORRECT NUMBE . HANDLE AS A FATAL ERROR TST (R5)+ ;STEP POINTER AHEAD TO EIRST ARGUMENT ADDRESS. TST FCBDON TEST FOR COMPLETION OF A PREVIOUS OPERATION. BNE 11 A ZERO "DONE" FLAG INDICATES TREVIOUS OPERATION STILL IN PROGRESS. JSR PC, WAIT ;WAIT FOR THE AP TO FINISH PROCESSING IS : CLR FCBDON REINITIALIZE THE "DONE" FLAG. MOV COMCTL, FCBCTL RETRIEVE AP MANAGER'S COMMON CONTROL WORD IN ORDER TO UTILIZE CURRENTLY-SELECTED OPTIONS. PLACE IT IN FCE'S CONTROL WORD. MOV eCRS)-r, FCBARL MOVE RESULT DATA BUFFER ID "A" INTO FCB ARGUMENT LIST. STEP HOST MEMORY ADDRESS POINTER AHEAD. MOV β(R5)+, FCBARL+4 ;MOVE SOURCE DATA BUFFER ID "B" INTO FCB ARGUMENT LIST. STEP HOST MEMORY ADDRESS POINTER AHEAD. (INCREMENTING R5, ALTHOUGH UNNECESSARY, SAVES EXECUTION TIME AND ONE MEMORY WORD.) MOV •MGRARG, R5 SET UP ADDRESS OF ARGUMENT LIST FOR CALL TO AP MANAGER . JMP KEXFCB CALL UP THE AP MANAGER TO PROCESS THE FCB . A DIRBCT BRANCH IS THE EQUIVALENT OF A "JSR", -153- FOLLOWED BY AN "RTS PC". "KEXFCB" WILL RETURN ITS STATUS VALUE IN PDP-11 REGISTER RO AS WELL AS IN LOCATION "STATUS" . MGRARG: BR 2> BRANCH AROUND ARGUMENT LIST. (THIS INSTRUCTION PROVIDES "NUMBER OF ARGUMENTS" COUNT TOR AP MANAGER; THE BRANCH IS NEVER ACTUALLY TAKEN. ) .WORD FCBBLK ADDRESS OF FCB. .WORD STATUS ADDRESS FOR RETURNED STATUS. 25 : :TH1S LABEL MA ERRORX. JMP MGRM67 TAKE AN AP MANAGER STANDARD FATAL ERROR EXIT. RETURN STATUS CODE -47 TO INDICATE "IMPROPER NUMBER OF ARGUMENTS IN PARAMETER LIST". STATUS. . ORD 0 ;TEMPOHARY STOHACε LOCATION FOR RETURNED AP MANAGER STATUS. .PAGE .FUNCTION CONTROL BLOCK: FCBBLK: FCBID- .WORD ORDB ID OF THE AP FUNCTION. FCBCTL. .WORD 0 CONTROL WORD. FCEDON: .WORD . i DONE FLAG. INITIALIZED TO "DONE" STATE. FCBLNK: .WORD 0 (HIGH-ORDER.) HOST MEMORY ADDRESS LINK TO NE) .WORD 0 (LOW-ORDER.) FCB IN HOST MEMORY. (NONE.) FCBPLT: .WORD 1 ;FCB PARAMETER LIST TYPE. (DATA BUFFER ID'S. ) FCBNRG. .WORD 2 ;NUMBER OF ENT IBS IN ΛRGUMεNT LIST. FCBLEN: .WORD 4 ;LENGTH OF ARGUMENT LIST IN HOST MEMORY WORDS. FCBARL: .WORD 0 ;RESULT DATA BUFFER ID • A" ARGUMENT. .WORD 0 ; FIRST WORD * DBF ID; SECOND WORD .WORD 0 ;SOURCE DATA BUFFER ID "E" ARGUMENT .WORD 0 ; FIRST WORD « DBF ID; SECOND WORD > 0. .END -154- PROGRAM: APFNC: OR-ING TWO DATA BUFFERS PART NUMBER: VERSION DATE: SEPTEMEER 7. 1?82 AUTHORS : CHETANA BUCH HISTORY: DESCRIPTION: THIS AP-BASED AP FUNCTION PERFORMS A LOGICAL 'OR' BETWEE EACH ELEMENT OF TWO DATA BUFFERS. THIS AP FUNCTION IS NORMALLY CALLED UP BY THE AP EXECUTIVE, WHICH RETRIEVES THIS AP FUNCTION'S ID NUMBER FROM A FUNCTION CONTROL BLOCK READ FROM HOST MEMORY. TITLE APFNC: LOGICL-OR NAME QORDB, Q01 ;NAME AND VERSION FOR THE OBJECT MODULE. PAGE RADIX H ; DEFAULT TO HEXADECIMAL RADIX. INTERNALLY DEFINED GLOBALIZED SYMBOLS: (ICLOBL) ENTRY POINTS: ;NONE SUBROUTINES: ;NONE GENERAL SYMBOLS ;NONE DATA MεMORY LABELS: ;NONE EXTERNALLY DεFINED GLOBALIZED SYMBOLS: (EGLOBL) ; ENTRY POINTS: MPI -155- ;NONE SUBROUTINES: EGLOBL PLCHKl, FTLABT, PLDBF, NRMCND CENERAL SYMBOLS: ;NONE DATA MEMORY LABELS: ;NONE ;SYMBOL DEFINITIONS ;NONE ;TERMINOLOGY: ;NONE PAGE PMORG iSTART OF RELOCATABLE CODE IN PROGRAM MEMORY. )+AP FUNCTION "QORDB" This AF Function performs * logical or between two diti buffers. Call with: p*r*met r list type m 1, number of arguments a. 2, parameter list length > 4. word ? argument #1 * ID of source and result Data Buffer "A word 10 Argument tl * Ignαred. word 11 Argument # « ID of source Data Buffer "B". word 12 argument #2 a. Ignored . Exits to AF Executive's "Fatal Abort" Service: If an error is found by AP Service Subroutine 'PLDBF' or 'PLCHKl' . PAGB ϊDEFINITION OF THE FUNCTION ID FOR THE AP EXECUTIVF FUNCTION TABLE: -156- FUNC •AD81Z, QORDB ;FUNCTION ID AND ENTRY POINT NAME. QORDB: SET UP FOR CALL TO PLCHKl SETR Rial PARAMETER DESCRIPTOR TYPE SETR R2=2 t OF ARGUMENTS SETR R3«4 * OF WORDS IN ARG LIST JSR PLCHKl GO CHECK CORRECTNESS OF VALUES IN FCB. JMF FTLABT ;RETURNS HERE IF ERROH :IF OK, RETURNS HERE JSR PLDBF JMP FTLABT SET RU.Rl ; POINTS TO SOURCE/RESULT BUFFER JSR PLDBF JMP FTLABT ,-Rl POINTS TO SECOND SOURCE BUFFER SET R2.R2 + 1 ; ENGTH ( + FOR BEX/NSN OF BUFFER > OR; LDREG R14.RI1 • FETCH DATA FROM FIRST SOURCE EUFFER LDRECI R15.R1 -ALSO FROM SECOND SET R14-R14 'OR'RIS ;LOGICAL-OR STREGI R14 ,R11 ; STORE RESULT BACK IN SOURCE 1 BUFFESl DBNZ R2 , OR JMP NRMCND ;GO TO NORMALIZE THE RESULT DATA, IF FCE CONTROL ; BIT INDICATES SUCH REQUIREMENT. A DIRECT BRANCH IS THE EQUIVALENT OF A "JSR' FOLLOWED BY AN "RTN" RTN END -157- STAGE MOVEMENT AND IMAGE ACQUISITION <« *****X**tt***XX******«*ft*****Kft****«4«****1.-**JtJt^ STACET.MG - THIS MODULE LOADS ALL OF THE MODULES USεD IN "STAGET" IJIt<tJ<*ll><*<*<*>*llI«llllt>illlt<*<<<>lll*l*<tll><l<l<<tt><l><<llJJt>l> ext PDPID ext at x 1 ib ext DMISC ext VADD ext STGREG ext 22BADDR ext STGGRB ext STGCOM ext CMOTOR e t C5, 13 INSPLAN ext SQROOT SiVt STAGE <* INTEGER VECTOR ROUTINES *> IF < LOOKUP < 'VADD ) ) PRINT "VADD ALREADY LOADED" ENDFILE ENDIF .MAC ; VADD — ADD TWO VECTORS OF ANY LENGTH ; CALL: VADD ( IVEC1 . IVEC2 . LENGTH > ; CALCULATES: IVEC2 < I - : - IVEC1 < I ) + IVECZ ( I ) ENTRY VADD MOV <MSP,+ , RO GET THE LENGTH MOV (MSP)+ , Rl GET THE ADDRESS OF IVEC2 MOV (MSP)+ , R2 GET THE ADDRESS OF IVEC1 0« : ADD (R2>+ (R1.)+ ADD THE COMPONENTS AND INCREMENT THE POINTERS DEC RO DECREMENT COUNTER AND CHECK DONE BNE OS NEXT VSUB — SUBTRACT TWO VECTORS CALL: VSUB < IVEC ' l , IVEC2 . LENGTH ) ■ CALCULATES: IVEC2 ( I 5 :- IVEC2 ( I ) - IVECl < I , -158- ENTRY VSUB MOV (MSF)-t , RO LENGTH MOV (HSP)-f , Rl ADDRESS OF IVEC2 MOV (MSP)+ . R2 ADDRESS OF IVEC1 I S : SUB < R 2 > + {Rl ) + SUBTRACT COMPONENTS AND INCREMENT POINTERS DE C RO DECREMENT COUNTER AND CHECK DONE BNE I S NE 1 VMASK — MASK ALL THE ELEMENTS IN A VECTOR CALL- VMASK < IVEC , MASK , LENGTH ) CALCULATES: IVEC C I > :. IVEC ( I > and MASK ENTRY VMASK KOV (MSP)-t , RO LENGTH KOV (MSF>+ , , R2 ADDRESS OF IVEC COM Rl COMPLEMENT THE MASK. BIC DOES- • SRC and DST IS : BIC Rl (R2)+ AND THE COMPONENT WITH MASK AND INCH POINTER DEC RO DECREMENT COUNTER AND CHECK DONE BNE 2$ NEXT VMAX FIND THE INDEX OF THE MAXIMUM VALUE IN A VECTOR CALL: INDEX : - VMAX ( IVEC , LENGTH ) ENTRY VMAX MOV (MSP1+ , RO LENGTH MOV' (MSP) , Rl ADDRESS OF IVEC. KEEP ON STACK MOV Rl , R2 ASSUME 1ST ELEMENT. SAVE ADDRESS OF 1ST ELT MOV (Rl) , R3 SAVE VALUE OF 1ST ELEMENT 3S : CMP RS , (Rl) COMPARE CURRENT MAX TO COMPONENT BGE 41 IF MAX > COMPONENT LEAVE IT MOV (Rl) , R3 NEW MAX VALUE MOV Rl , R2 NEW ADDR OF MAX VALUE 4S : ADD * 2 , Rl INCRεMENT ARRAY INDEX DEC RO DECREMENT COUNTER AND CHECK DONE BNE 3S SS : SUB CMSP) , R2 ENTRY FOR VMIN ALSO. SUBTRACT ADDR OF MAX VAL MOV R2 , (MSP) FROM ADDR OF IVEC AND STORE DIFFERENCE ON STAC K ASR (MSP) DIVIDE RESULT BY 2 TO GET NUMBER OF WORDS NEXT VMIN — FIND INDEX OF MINIMUM VALUE IN A VECTOR CALL: INDEX :a. VMIN ( IVEC , LENGTH ) - 159- ENTRY VMIN KOV (MSP)-r , RO LENGTH MOV (MSP) , Rl ADDR OF IVEC. KEEP ON STACK MOV Rl , R2 ASSUME 1ST ELT. STOKE ADDR OF 1ST ELT KOV (Rl) , R3 STORE VALUE OF 1ST ELT. CURRENT MAX SS CMP R3 , (Rl ) COMPARE CURRENT MAX TO COMPONENT BLE a I'F MAX ) COMPONENT. LEAVE IT MOV (Rl ) , R3 NEW MAX VALUE MOV Rl , R2 NEW MAX VALUE ADDR 65 ADD • 2 Rl INCREMENT ARRAY POINTER DEC RO DECREMENT COUNTER AND CHECK DONE BNE SS JMP 85 CALCULATE INDEX AND RETURN VSDIV — DIVIDE A VECTOR BY A SCALAR CALL: VSDIV ( IVEC , SCALAR , LENGTH 5 CALCULATES: IVEC ( I ) : » IVEC ( I > / SCALAR ENTR VSDIV MOV (MSP)+ , R3 LENGTH MOV (MSFJ+ , R2 ; SCALAR MOV β 0 (MSP) , Rl ADDR 0 F IVEC STILL ON STACK. GET ELEMENT SXT RO IF (0 SET HIGH lά BITS TO -1 ELSE CLEAR THEM DIV R2 , RO 32 BIT DIVIDE. QUOTIENT IN RO , REMAINDER IN Rl MOV RO , -? 0 (MSP) STORE QUOTIENT BACK IN ELEMENT ADD * 2 <MSP> UPDATE THE ARRAY POINTER DEC R3 DECREMENT COUNTER AND CHECK DONE BNE ?S CLR (MSP)+ POP THE ADDRESS OF IVEC OFF STACK NEXT VSMUL — MULTIPLY A VECTOR BY A SCALAR CALL: VSMUL ( IVEC , SCALAR , LENGTH > CALCULATES: IVEC ( I > : » IVEC ( I > * SCALAR NTS Y VSMUL MOV (MSP)+ , " R3 LENGTH MOV (MSP)+ , R2 SCALAR S : MOV 9 0 (MSP) , Rl ADDR OF IVEC STILL ON STACK. GET ELEMENT MUL R2 , Rl MULTIPLY. ONLY 14 BITS SINCE SRC IS Rl MOV Rl , β 0 (MSP) PUT RESULT IN ELEMENT ADD # 2 , (MSP) UPDATE ARRAY POINTER DEC R3 DONE? BNE 9 t CLR (MSP)+ POP ADDRESS OF IVEC OFF STACK NEXT .LOCAL ; RESET LOCAL SYMBOLS ; VPOS — CONVERT ALL NEGATIVE ELEMENTS IN A VECTOR TO POSITIVE OMPI -160- SET ALL POSITIVE ELEMENTS TO IVAL . IF IVAL-=0 LEAVE ALONE CALL: VPOS < IVEC , IVAL « LENGTH ) CALCULATES: IF ( IVEC ( I > * * 0 ) IVEC ( I > : ; ; ENDIF IF ( IVAL OO ) IVEC ( I ) :» IVAL ENDIF ENTRY VPOS MOV (MSP) + , RO LENGTH MOV (MSP) + , Rl IVAL MOV (MSP) + , R2 ADDRESS OF IVEC OS TST (R2> TEST THE COMPONENT OF IVEC BPL IS IF >« 0 GO TO IS CLR (R2) SET ELEMENT TO 0 BR 2S LOOP IS TST Rl TEST IVAL BEQ 2S IF 0 IGNORE MOV Rl , (R2) SET ELEMENT TO IVAL 25: ADD • 2 . R2 UPDATE ARRAY POINTER DEC RO DONE? BNE OS NEXT VDOT — TAKE SCALAR PRODUCT OF TWO VECTORS CALL: PRODUCT :« VDOT ( IVEC1 , IVEC2 , LENGTH > CALCULATES: PRODUCT :» SUM-OVER-I ( ΣVEC1 ( I ) * IVEC2 ( I ) ) ENTRY VDOT INTEGER MOV (MSP>+ , R3 LENGTH MOV (MSP)+ , R2 ADDRESS OF IVEC2 CLR RO CLEAR SUM 3S : MOV CR2)+ , Rl GET ELT OF IVEC2 AND UPDATE ARRAY POINTER MUL 9 0 (MSP) , Rl ADDR OF IVEC1 IS STILL ON STACK. GET ELT OF IV EC! ADD Rl , RO ADD COMPONENT PRODUCT TO SUM ADD # 2 , (MSP) UPDATE IVEC1 ARRAY POINTER DEC R3 DONE BNE 31 MOV RO , (MSP) ; STORE SUM ON STACK NEXT .END -161- parameter WCR - 1724101c DMA word count register . parameter BAR - 1724121c Bus address register for DMA. parameter CSR - 172414k Control status register parameter DBR 172416k Data buffer register . long PHYADR Physical (22-bit) address of the buffer Integer OUTLN ( 256. ) define ATIOFAGE wi th M_IOPACE ATTRG ( "IOPAGE' lέ-OOOOK ) end <* Wait until DMA operation is complete, (Moni tors EUSY bit.) *> def ine WBUS?Y while ( peel: ( CSR ) AND 200k ) r epea t e define RDLN integer BUFF ( 1 ) xO .! yO yl PHYADR .■ 22ADDR ( BUFF > poise ( 130000k + X0 - 1 , DBR ) poke ( 114000k + Y0 . DBR ) poke ( -- XL / 2 , WCR ) ; poke ( — ( XL * YL ) , WCR > poke ( ls ord ( PHYADR ) , BAR ) poke ( 0 , DBR ) poke < msword ( PHYADR ) CSR ) end -162- iπteger MOTCH char buf ( 30 ) TERM ( 5 ) integer bufptr integer teαprO .mac label CMOTAST mov rO , β # ptr ( tempr0 ) mov • • ptr ( bufptr > , rO movb ( r ) + , (rO) c pb t 15k , (rθ)-t bnc 01 clrb (rO) mo # 21. , -(rp) mov * bytewd ( 2 33. ) , -trp) e t 3771c OS : mov 9 It ptr ( em O rO ine β # ptr ( bufptr mov # bytewd ( 1 115 -trp) return from ast emt 377k end make 'SGRBMOT Sattach 1410k CMOTAST 0 base NO_OP ; detterm define GRBMOT apush cich cich :-. MOTCH SGRBMOT apop end make 'wtse rsxcall bytewd ( 2 41. > make 'CLEFS rsxcall bytewd ( 2 31. ) define bf rl integer buff butp tr : * but CLEFS ( 21. ) wrl ( MOTCH buff ) wtse C 21. ) end parameter CRCHR : «• 15k record DEV_REC integer DEVNUM long LOLIMIT long UFLIMIT endrecord O ?I - 163- DEV_REC XAXIS YAXIS 2AXIS ith XAXIS DEVNUM :- ascii 1 with YAXIS DEVNUM :» ascii 2 with ZAXIS DEVNUM :« ascii 3 char BUFF ( 20 ) integer STEFSIZE define INITMOT MOTCH :« open < TERM , ' rwa ) poke ( 2 , fdb ( MOTCH > ) GREMOT end def ine MOTCOM command integer CHAR #tyo ( DEVNUM ) iter cmdcnt ityo ( CHAR ) nx targ loop Ityo ( CRCHR ) encode ( BUFF ) bfwrl ( BUFF ) end i Switches the box on define BXON MOTCOM ascii E •nd , Switches the box off define BXOFF MOTCOM ascii F * end define JON MOTCOM ascii J ascii 1 end define JOFF MOTCOM ascii J ascii 0 end « « — —,*—:-fS r — - m — — - 164- ; Stop the move define STP MOTCOM ascii S end define VBUSYM MOTCOM ascii R end Normal mode is single move mode. The motor accelerates to the programmed velocity , runs at constant velocity for a p edetermined period and decelerates and stops when total number of counts programmed by position have been sent define NORMALMODE MOTCOM ascii M , ascii N e d Continuous mode accelerates the motor to the programmed velocity and holds that velocity until stopped. define CCNTMODE MOTCOM ascii M , ascii C e Alternates the defined move in opposite directions until stop is pressed. define ALTMODE MOTCOM ascii M , ascii A end This routine reports relative position at the end of the move def ine RELPOS •tyo ( DEVNUM ) ttyo ' ascii P ) #tyo ( 40k ) encode ( BUFF ) BFWRL ( BUFF ) end Fcsition report back of the motor shaft during move. New position at every 4 msec, define CURPOS MOTCOM ascii V , ascii 2 end Absolute position relative to the last time the position counter was cleared. define ABSPOS ' -165- ttyo ( DEVNUM ) tt yo ( asc ii X ! ttyo ( ascii 1 ) *tyo ( 40k > encode ( BUFF ) EFVRL ( BUFF ) ; MOTCOM ascii X , ascii 1 end ; Clear the absolute position counter define CLEARIND MOTCOM ascii X , ascii 0 end ; Changes the report back ASCII strings into long integers. define CONVERT long bpoke ( 0 , bp ( bufptr - 1 ) ) inp : at bu f eol off wo d drop word dro eol on if ( ' literal ( tbuf ) ) endif CONVERT : . II al end define CONVERT long mvser ( BUFF , 10 ) rdl ( MOTCH , BUFF ) drop if ( llitβral ( BUFF ) ) CONVERT : * Ilval endif end Set up the lower limit for position def ine SETLO ABSPOS LOLIMIT :« CONVERT end Se up the upper limit for position, define SETUP ABSPOS UPLIMIT :- CONVERT end Set the acceleration of the motor shaft in rps/s def ine ACCEL command real N if ( cmdcnt «»0 ) ] :- 0.2 endif ttyo ( DEVNUM ) tt yo ( ascii A ) — - * print tp ascii 0 , #f & 3 , N , #n #tyo ( CRCHR ) encode ( BUFF ) ; wrl ( MOTCH , BUFF ) bfwrl ( BUFF ) ; rdl ( MOTCH , BUFF ) drop end ; Set the delay desired between two commands in seconds. <» define TIMEDELAY command real N if ( cmdcnt »«0 ) N :« 1.0 endif wtyo ( DEVNUM ) ttyo ( ascii T ) mvier ( BUFF , 10 ) print tp ascii 0 , »f 6 . 3 , N , #n ttyo ( CRCHR ) encode ( BUFF ) ; wrl ( MOTCH , BUFF ) bfwrl ' BUFF ) rdl ( MOTCH , BUFF ) drop end *) , Set th* velocity of motor in real values define VELOCITY command * ' real N if ( cmdcnt * »0 ) N :« 0.1 endif ttyo < DEVNUM ) ttys ( asci i V ) mvier ( BUFF , 10 ) print tp ascii 0 , #f i . 3 , N , »n #tyc ( CRCHR > encode ( BUFF ) ; wrl ( MOTCH , BUFF ) bfwrl ( BUFF ) ; rdl ( MOTCH . BUFF ) drop end Set the motor position in (+) ve or (-) ve direction with respect to the current position in terms of motor pulses. 25000 pulses /rev and 10 pulses t 1 micron. define POSITION command long N ttyo ( DEVNUM ' ) ttyo ( ascii D ) mvier ( BUFF , 10 ) print ti 0 , N , tn - ' ttyo ( CRCHR ) encode ( BUFF ) ; wr 1 ( MOTCH , BUFF ) bfwrl ( EUFF ) i rdl ( MOTCH , BUFF ) drop end Set scale for number motor pulses per least significant digit of position data. The value of scale factor is integer and varies from 1 to 2S5 inclusive. define SCALEFACTOR command integer NUM t yo ( DEVNUM ) ttyo ( ascii U > ttyo ( ascii S ) print ti 0 , NUM , #n ttyo < CRCHR > encode ( BUFF ) wrl ( MOTCH , BUFF ) rdl ( MOTCH , BUFF ) drop en Read the set scale factor . define READSCALE MOTCOM ascii V as c i i R end ; Start the i e define STT command TOTAL += xtnd ( STEPS12E ) if ( ( TOTAL ) UPLIMIT ) or ( TOTAL ( LOLIMIT ) ) BEEP print "LIMITS EXCEEDED" else MOTCOM ascii G , endi f end Executes normal mode define SETMOTOR command integer STEPSIZE if ( cmdcnt ««0 ) STEPSIZE :-. ASTEPSIZE endif BXON mvier ( BUFF , 10 > NORMALMODE ACCEL 1.0 VELOCITY 1 0 POSITION xtnd ( STEPSIZE ) end S f-~ r~- - rrτ. Sets to the absolute position desired. define SETABS integer STEPSIZE local long RELSTEP BXON ABSPOS ' CONVERT RELSTEP :» LLVAL - XTND ( STEPSIZE ) mvier ( BUFF , 10 ) NORMALMODE ACCEL 1.0 VELOCITY 1.0 POSITION RELSTEP <*. This program is an attempt to use an iterative method to determine square roots of real numbers. «> <* Calling sequence: SQUAREROOT := SORT ( ARGl ) *) real POSRAD real OLD NEW define SQRT real real RAD local real ACCUR POSRAD := FABS ( RAD ) ACCUR :» 0.000001 * POSRAD OLD :« 0.00 NEW : t 1.00 while ( FABS ( NEW * NEW - POSRAD ) >- ACCUR ) OLD :«. NEW NEV : at ( OLD + ( POSRAD / OLD ) ) / 2.0 repeat SQRT : * . NEW end ext FZVMOV ext V1DAUTO ext ERGPO≤ ext FVIDFOCUS ext FOCUS mvstr ( "staget" , promεtr ) integer STGCBF ( 15. ) integer STPFLAG define CONNECT_2_MASTER STPFLAG off INITREC begin RECEIVE ( STGCBF ) until ( STPFLAG ) end define RECONNECT SET ( SYNC2 ) begin RECEIVE ( STGCBF ) until ( STPFLAG ) end i n t eg e r TMP I CH TMPOCH define STOPCO integer TERM TMPICH :. cich TMPOCH :» coch cich :> open ( TERM , ' coch :« cich poke ( 2 , fdb ( coch ) ) ) at term STPFLAG on end define STRTCO de11 rm close ( cich ) cich :» TMPICH coch :-= TMPOCH STPFLAG off RECONNECT end define STGINI mvstr ( "TT2 : " , TERM > IN ITBOXX TPTF -r u t mvs r ( TT3: 1 TERM ) INITMOT with ZAXIS BXON BXON end define INITSTG ; STGINI OFFX :■ OL OFFY « OL ALPHA :-= Q.???835 BETA :» 0.018175 CALFLG OFF CONNECT_2_MASTER end $RESTART BASE INITSTG , RESTART FOR DEMO PACKAGE SAVE WFSTAGET NAME Z_MOVE.MG THIS PROGRAM MOVES THE MOTOR IN ANY DIRECTION THRO' THE STEPSIZE SPECIFIED IN THE PROGRAM INITZ *) define Z_MOVE STT end NAME INITZ.MG <* THIS PROGRAM INITI IZES MOTOR PARAMETERS. THE STEP SIZE HAS TO BE SPECIFIED. C INITZ ( STEPSIZE 5 ) «> define INITZ WITH ZA IS BXON vtβr ( BUFF 10 ) NORMALMODE ACCEL 1.0 VELOCITY 1 -Q end NAME : INITZ l.MG <* THIS PROGRAM INITILIZES MOTOR PARAMETERS. THE STEP S1ZE HAS TO BE SPECIFIED. INITZ ( STEPSIZE ) ) *> define INT1 with ZAXIS BXON αvzer ( BUFF 10 ) NORMALMODE ACCEL 2.0 VELOCITY 5.0 end NAME : INITZ2 -MG <* THIS PROGRAM INITILIZES MOTOR PARAMETERS. THE STEP SIZE HAS TO BE SPECIFIED. < INITZ ( STEPSIZE ) ) *) define INT2 with ZAXIS BXON vzer ( BUFF 10 ) NORMALMODE ACCEL 2.0 VELOCITY 7.5 en define UPFAST long STEP 10 INT1 STEP10 := ( LABS ( STEP10 ) ) POSITION STEP10 Z_MOVE end define DNFAST long STEPS INT2 POSITION — ( LABS ( STEF8 > ) if ( STEP8 ) 739900L ) pr int " ERROR1 " else Z_MOVE end i f en define UPTST INTEGER STEP1 STNUM INITZ STEP1 :-- < ABS ( STEP1 > ) POSITION xtnd ( STEP1 ) iter STNUM Z_MOVE loop end ' a - i ' -.' de inβ DNTST integer STEP2 STNM INITZ POSITION xtnd ( — ( ABS ( STEP2 ) ) ) iter STNM Z_MOVE loop end <* Set the bias, gain, and integration time. B SETPARM ( BIAS CAIN IT ) define SETPARM integer Bl Gl II SET.BIAS ( Bl ) SET.GAIN ( Gl ) B SET. IT ( II ) SET.SENS end define DARKFARM SET. IT ( 255 ) SET.BIAS ( 0 > SET.GAIN ( 10 ) SET.SENS ; GAINADJUST ; SET.SENS end define BRIGHTPARM SET. IT ( 24 ) SET.BIAS ( 0 ) SET.GAIN ( 1C ) SET.SENS ; . GAINADJUST : SET.SENS end *> integer MRXTs ( 0 ) .word bytewd ( 5 , 23. ) .wor d 23. .blkw 1 -word 1 .word 0 integer WTSE* ( 0 ) .word bytewd ( 2 , 41. > word 23. define DELAY integer DTIM MRKTS ( 2 ) :» DTIM * i RSXDIR ( MRKTS ) ioerr ' RSXDIR ( WTSEt ) ioerr end <* integer FLAGl STEP5 PR MAXVAL NSTEP PR2 FCFUN PCENT FRl integer OFFl LOCI RFLAG long Z0 PROFUNC := AVERFTR NAME . AUTOFC define COARSE local integer TEST FLAG6 CURX CURY FLAG8 INITZ STEPS :» 10 STEP5 :« ( ABS ( STEP5 ) ) POSITION xtnd ( STEPS ) POKE ( 1000k , DBR ) FLAGl OFF MAXVAL OFF CURX OFF CURY OFF FLAG8 OFF beg in FLAG6 OFF STT RDLN ( OUTLN1 , 128. , 383. , 256. , 256. WBUS?Y POKE ( 1000k , DBR ) CURY : m exec ( FCFUN ) pr int SLOPE with ZAXIS BXON ABSPOS PRINT CONVERT if ( CURY ) MAXVAL ) MAXVAL :« CURY endif mcre ent CURX PCENT iscal ( CURY . 100 . MAXVAL ) if ( PCENT < PR1 ) and ( FLAG8 »«0 ) ) BEEP DNFAST ( 10L ) DNFAST ( I00L ) DELAY ( 1 ) UPFAST ( 20L ) INITZ STEPS :» 10 STEPS :« ( AES ( STEP5 ) ) POSITION xtnd ( STEPS ) DELAY ( 1 ) PR2 :» iscal ( MAXVAL 90 100 MAXVAL OFF FLAG6 ON FLAGS on end i f tint 11 ( CURY >-. PR2 ) end define VERYFINE local integer PERCENT STOP CURX CURY STEPS at 3 INITZ POSITION xtnd ( STEP5 ) POKE i 1000k , , DBR ) MAXVAL OFF STOP OFF NSTEP OFF CURX OFF CURY OFF begin STT RDLN ( OUTLN1 , 128. . 38. 256. 256. ) WBUS'Y POKE ( 1000k , DBR ) CURY : * exec ( FCFUN ) if ( CURY > MAXVAL ) MAXVAL :» CURY end if PERCENT :» iscal ( CURY , 100 MAXVAL ) if ( CURY <> MAXVAL ) increment NSTEP if ( PERCENT < PR STOP ON endif end if increment CURX until ( STOP ) DNTST ( NSTEP 1 ) end define AUTOFC LOCAL long ZPOS COARSE VERYFINE ; WITH ZAXIS ; ABSPOS ; ZPOS :- CONVERT ; PRINT ZO ; if ( RFLAG »» 1 > ; if ( LABS ( ZO - ZPOS ) > 20L > ; SET ; POSITION ( ZO - ZPOS > ; STT ; DELAY ( 2 ) ; else ; ZO := ZPOS , endif i else ; ZO := ZPOS ; end i f ; PRINT ZO end STEP5 :a- 20 MAXVAL OFF NSTEP OFF FCFUN :« base SLOPE PR :■ 180. PR2 :« 1000 PR1 :« 75. OFFl :- 50 *> c*ι - *5 •" Z . kkalat integer BXCH DIROW COL long OFFX OFFY STX STY STXP STYP BOFFX BOFFY CORRX long XCOR YCOR VAFXCOR VAFYCOR STXCOR STYCOR CORRY real ALPHA BETA XPITCH YPITCH integer FXSIZE FYSIZE OVLX OVLY FXIND FYIND integer FVX integer FWY integer FRX integer FRY BOFFX -« OL BOFFY :« QL mac label $ ttys mo rO , 9 # ptr ( te prO > mov 9 tt ptr ( bufptr > , rO movb (rp)-t , (rO) cmpb * 15k (r0)+ bne 0$ clrb -(rO) mo # 21. , •(rp) mo tt bytewd ( 2 33 -trp) emt 377k OS mov β # ptr ( temprO ) . rO mc β # ptr ( bufptr ) mo t bytewd ( 1 115. ) , -(rp) return from ast emt 377k . end make '{grabs -.attach 1410k Sttys 0 base NO_OF det term def ine grabs apush cich c ich -» bach Sgrabs apcp e def ine bw 1 i teger but f buf r : ■ buf CLEFS ( 21. ) wrl ( bxch buff ) wtse < 21. > end initializes and opens a channel for ergolux communication - > define INITBOXX BXCH : = open ( TERM , • rwa ) poke ( 2 , fdb ( BXCK ) ) gr abs end <* routine to send an ASCII character at a time *> define BXCOM command integer CHAR iter cmdcnt ttyo ( CHAR ) nxtarg loop tttyo ( CRCHR ) encode ( BUFF ) bwrl ( BUFF ) end <* routine to move the stage to the home coordinates * > define HOME SXCOM ASCII H end . '. * routine to move the stage to the desired absolute coordinates MOVE ( x-coordinate , y-coordmate : both are long integers ) *5 define MOVE long XMOV YMOV tlyo ( ASCII M ) tttyo ( ASCII X ) mvzer ( BUFF , 10 ) print (SI 0 , XMOV , " , " , #N tttyo ( ASCII Y ) print #1 0 , YMOV , #N ttyo ( 15K ) encode ( BUFF > bwrl ( BXCH , BUFF 5 end <* routine to request the current location of the stage wr t the home coord inate * > define POSREO BXCOM ASCII P print STR ( BUF > end < * splits the transmitted position string into x-coordinate *> define SPLX long loc l integer ALX ( 10 ) •FIELD ( BP ( BUF ) + 2 , 7 , 7 ) ENCODE ( ALX ) if ( LLITERAL ( ALX ) ) SFLX :« LLVAL endi f end (* splits the transmitted position string into y-coordinate *> define SPLY long local integer ALX ( 10 ) •FIELD ( BP ( BUF > + 12 . 7 , 7 ) ENCODE ( ALX ) if ( LLITERAL ( ALX ) ) SPLY :- LLVAL end if end (* Attachement to the inspection pl n and status data base * ) define ATIPSDB VITH M_IPSDB ATTRC ( "IPSDER" , 14000OK ) ptr ( IPSDB_REC ) :a. WNDADR with 1NSP_PLN with INSP_DATA_BASE end <« transforms the stage coordinates into the wafer coordinate system *> define STWAFTR real POSX POSY VAFXCOR :at LFI ( ALPHA * POSX + BETA * POSY ) VAFYCOR :» LFIX ( — BETA * POSX + ALPHA « POSY ) end C* transforms the wafer coordinates into the stage eocrdinatcs * > define VAFSTTR real POSX POSY STXCOR :- LFIX ( ALPHA * POSX + ( — BETA « POSY ) ) STYCOR :« LFIX ( BETA * POSX + ALPHA * POSY > e d <* computes the x-coordinate of the desired die *> def ine DIEX REAL DIEX := ( FLOAT ( DIROV ) * XPITCH ) end <* computes the y-coordinate of the desired die *> def ine DIEY REAL DIEY :at ( FLOAT ( COL ) « YPITCH ) end ', * computes the x-coordinate of the desired feature *) define FWAX integer FWAX :» FWX end <* computes the y—coordinate of the desired feature *) define FUAY integer FWAY : = FWY end ι r. computes the x-coordinate of the desired fr me *) def ine FRAX integer local integer C C := FRX FRAX :=> C * FXIND * C ( FXSIZE * < 100 - OVLX > ) / 100 ) end <* computes the y-coordinate of the desired frame *) def ine FRAY integer local integer C C : - FRY FRAY := C + FYIND « ( ( FYSIZE * ( 100 - OVLY > ) / 100 ) end <* computes the x-coordinate of the desired frame in a given feature in a given die * > define FRAMX loc l real ALX integer AFX AXX ALX « DIEX APX » FWAX AXX a. FRAX XCOR : . xtnd ( APX + AXX ) + LFIX ( ALX ) end <* computes the y-coordinate of the desired frame in a given feature in a given die »> define FRAMY local real ALX integer APX APY ALX :» DIEY APX :» FVAY APY .« FRAY YCOR :-= xtnd < APX + APY ) + LFIX ( ALX ) end <** defines a backlash correction cn the coordinates depending on the direction of move * > STXP :« OFFX STYP :» OFFY def ine BLCORR local integer LDIR LDIR1 LD IR2 LDIR3 LDIR1 ON LDI 2 GN if ( STX )» STXP ) LDIR off else LDIR on end i f if ( LDIR <) LDIR1 ) LDIR1 := LDIR if ( STX < OL * STX :- STX - BOFFX else STX : * STX + BOFFX endif endif i f ( STY >= STYP ) LDIR3 off else LDIR3 on endif if ( LDIR2 <) LDIR3 ) LDIR2 :> LDI 3 if ( STY < OL ) STY ;» STY - BOFFY else STY := STY + BOFFY endif en i f STXP :» STX STYP := STY end <τ moves the stage to the desired frame *> define STFRAM local long POSX POSY real XMOV YMOV with INSF_DATA_BASE STAGE_ERR « TRUE FRAMX XMOV :.. LFLOAT ( XCOR ) FRAMY YMOV :» LFLOAT YCOR VAFSTTR ( XMOV YMOV STX : « — STXCOR + OFFX + CORRX STY :« — STYCOR + OFFY + CORRY print STX , STY , STXCOR , STYCOR BLCORR MOVE ( STX , STY ) POSREO POSX -.' SPLX POSY :•= SPLY if ( ( POSX <> STX ) AND ( FOSY (> STY > STAGE, ERR FALSE endi f end <* The stage moving function to be called f om the Master *> define STAGEK loc l integer SITE FRAM ATIFSDB STAGE_BUSY :« TRUE SITE - DES_SITE FRAM : a DES_FRAME with DES_RET DIROW :at ROW COL :« CLMN print DIROW , COL with INSP_PLN wi th HEADER XPITCH :» DIE_X YPITCH :«: DIE_Y with LAYERS ( DES_LλYER ) with DTL_LAYER_REV ( »_REVS - 1 ) with L_RETICLE with RETICLE_EIE with D_PATTERNS ( DES_PATTERN ) FWX :» X FWY : * - Y ith F_ORG FRX := X FRY :« Y with F_DESCR with F_SZ FXSIZE » X FYSIZE - Y with F_OLAP OV . LX : - X OVLY :«. Y with INSP_FR ( SITE ) with FRAMES C FRAM ) FXIND :« ROV FYIND :.. CLMN STFRAM STAGE_BUSY := FALSE with CUR_RET ' ROV .-a. DIROW CLMN :» COL CUR_SITE :■ DES_SITE CUR_FRAME : «- DES_FRAME DREGION e d (* defines a correction to the eocrdinatcs due to the error in positioning *) define ERRCORR local long POSX1 POSY1 POSX2 POSY2 CORRX :. OL CORRY := OL STAGEM POSREQ FOSX1 :* SPLX POSY1 :- SPLY print "Manually align the feature" pause POSREQ POSX2 :-= SPLX P0SY2 :• SPLY CORRX :« POSX2 - FOSX1 CORRY :« POSY2 - POSY1 end <* STAGE CALIBRATION procedure *) integer CALFLG CALFLG on define INITOFF ATIPSDB print "Manually define home, press 'DEFINE HOME' button" print "Manually position origin of die (0,0)" print "Press COMP ON at the stage control panel" pause POSREQ OFFX := SPLX OFFY :•= SPLY end define CALSTG 1ocal long POSX1 FOSY1 long D Dl if ( CALFLG ) INITOFF print "Move to last die in X direction" print "Press COMP ON at stage control panel" pause POSREQ POSX1 :-* SPLX POSY1 :« SPLY D :- POSX1 - OFFX Dl :. POS l - OFFY ALPHA :•= LFLOAT ( — D ) / SQRT ( LFLOAT ( D ) * LFLOAT ( D ) + Λ LFLOAT ( Dl ) * LFLOAT ( Dl ) ) , BETA :» LFLOAT ( — Dl ) / SQRT ( LFLOAT ( D ) * LFLOAT < D ) + Λ LFLOAT ( Dl ) * LFLOAT ( Dl > ) print «F 12 i , "alpha: " , ALPHA , "beta: " , BETA print OFFX . OFFY endi f end (* Switch the illumination according to the cuirent and desired set in IPSDB *> define ILLSW ATIFSDB if ( CUR_ILLUM (> DES_ILLUM ) CUR_ILLUM :«- DES_ILLUM DREGION ATIOPAGE POKE ( 200K , CSR > ; switch the illumination DELAY < 3 ) POKE ( 0 , CSR ) ; ma e it stable. i No e: no handshaking with the hardware DELAY ( 40 ) Va i t to make sure switch happens before we return en i f DREGION end <« Switch the magnific tion according to the current and desired set in IPSDB *) define LENSW ATIPSDB if ( CUR_MAGNF <> DES_MAGNF ) CUR_MACNF :- DES_MAGNF DREGION ATIOPAGE POKE ( 400K , CSR ) ; switch the magnification DELAY ( 1 ) POKE ( 0 , CSR ) ; make it stable. ; Note: no handshaking with the hardware endif DREG I ON end integer SLPOFF SLPSCL .MAC entry SLOPE integer mov • 128. rO - 256 points, index mov β m ptr ( SLPOFF ri asl rl sub r 1 , rO mo * ptr C OUTLN -(ms ) ; store pointer to the array add rO , (msp) , point to last elt in array clr r3 ; clear maximum OS : add β # ptr ( SLPOFF (msp ) movb β 0 (msp) . r2 ; get OUTLN1 ( rO + 1) bic » 177400k , r2 ; clear high byte from movb dec (ms ) sub β # ptr ( SLPOFF (msp ) ; decrement pointer ovb 9 0 (msp) , rl ; get OUTLN1 ( rO - 1 ) bic « 177400k , rl ; clear high byte sub rl r2 , get slope ts t r2 bpl II ; see i f negat i e neg r2 ; yes , make positive emp r3 r2 ,- see if > than current max bge 2t mov r2 r3 ; yes, store new max 2S dec rO bne OS aov r3 (ms ) return maximum slope next end <* DEFINE PEAK INTEGER LOCAL ' INTEGER TEMPI PEAK OFF ITER 25<S . MVBYWD ( OUTLN1 , I , OUTLN , &4 ) TEMPI :- OUTLN ( VMAX ( OUTLN , 64 ) ) OUTLN ( VMIN ( OUTLN , & Λ ) ) PEAK :« PEAK + TEMPI LOOP ( .4. ) PEAK :« URSHIFT ( PEAK , 1 ) END *> SLPSCL := 1. SLPOFF := 1. COMPARISON BETWEEN REFERENCE AND EDGES i * ft***************** MATCHT.MG THIS MODULE LOADS ALL OF THE MODULES USED IN "MATCHT" *ft**ftX***X«ftX*^ *T ) ext PDPID Assembly language mneumonics. ex t DMISC Miscellaneous utility routines. ext MCHREG Region mapping utilities for MATCHT. ext MCHCOM Intcrtask communica ion utilities for MATCHT ext CS, 1IINSPLAN Inspection Data Base record structure ext 22BADOR 22 bit address supppcrt. ext GRABIM Frame grabber support. ext . MODELT Model record structure. ext OPLINE Routine to 'open* a line between tw. paints ext MDLMTCH Matching and Image Registration routines. mvstr ( "matcht" , promstr ) integer MCHCBF ( 15. ) Intertask communication buffer. integer STPFLAG Fl g to indicate no communic tion. integer TMPICH TMPOCH Temporaries for input and output channels <» Start communic tion wi h the master task *; define CONNECT_2_MASTE INITREC begin RECEIVE ( MCHCBF ) until ( STPFLAG ) end <* Restart communication with the master task. *) define RECONNECT SET ' SYNC2 ) begtn RECEIVE ( MCHCEF ) until ( STPFLAG ) end <* Stop communication with master task and allow input frcm a terminal STOPCO ( 'TTn ) *) define STOPCO integer TERM TMPICH :» cich TMPOCH :» coch cich :» open ( TERM , 'rwa ) coch :a cich ~ poke ( 2 . fdb ( cich ) ) 11er STPFLAG on end x Restart communi ion after a STOPCO has been executed, def ine STRTCO de 11e m close ( cich > cich := TMPICH coch :- TMPOCH STPFLAG off RECONNECT e <* Ini t i a 11 xa t ion routine for MATCHT. *> define MATCHINIT with M_MODEL ATTRG ( "MODELR" . 160000k ) with M_EDGE ATTRG ( "EDGΪMG" , 1 0000k > CONNECT_2_MASTER end .restart : = base MATCHINIT save WFMATCHT parameter WCR 172410k DMA word count register . parameter BAR 172412k Bus address register for DMA. parameter CSR 172414k Control status register . parameter DBR 172414k Data buffer register. long PHYADR ; Physical (22-bit) address of the buffer, make 'MRKTt rsxcall bytewd ( 5 23. ) <* Delay function using Mark Time directive. DELAY_TIME is the number of seconds times 10. e.g. DELAY_TIME > 10. is a delay of 1 second. DELAY ( DELAY_TIME ) *> define DELAY integer DEL MRKTt. ( 23. , DEL * & , 1 , 0 ) WAIT ( 23. ) end (* Wait until DMA operation is complete. (Monitors BUSY bit.) « > def ine WBUS'Y while < peek ( CSR ) AND 200k ) r e p e t en <» Read a line from the frame grabber. RDFCLN ( BUFFER XO XL Y0 YL ) »> def ina RDFGLN integer BUFF ( 1 ) XO XL Y0 YL PHYADR := 22ADDR C BUFF ) poke ( 130000k + X0 - 1 , DBR ) poke ( 114000k + Y0 , DBR ) poke ( — XL / 2 , WCR ) ; poke < — ( XL * YL ) , WCR ) poke ( 1 sword ( PHYADR ) , BAR poke ( 0 , DBR > poke ( Sf βrd ( PHYADR ) ♦ 1 CSR ) tnd <* Get an image from the frame grabber into a memory region, define GETIM local integer BUFPTR with M_MODEL ATTRG ( "IOPAGE" , 140000k ) poke ( 1000k , DBR > DELAY ( 1 ) poke ( 0 , DBR ) ATTRG ( "EDGIMG" , 140000k ) WNDOFF off MAPW ( WNDB ) ioerr iter 256. REMAP ( i ) d op BUFPTR :» WNDADR do 128. 15? . WBUS?Y RDFGLN ( BUFPTR 128 256. i + 3 1 ) BUFPTR +« 254. loop loop ( 32. ) VBUS?Y DREGION with M_MODEL DREGION end define COPYIM local integer EDGADR wi th M_MODEL ATTRG ( "MTCHIM" , 160000k ) WNDOFF off MAPW ( WNDB ) ioerr with M_EDGE ATTRG ( "EDGIMG" , 140000k ) # —» -r— *—- * -" * ~r "-"' * 7 C ■ - •■ ■-- , - j ' ' * EDGADR :« WNDADR WNDOFF off MAPW ( WNDB ) ioerr iter 254. with M_EDGE REMAP ( i ) drop with M_M0DEL REMAP ( i > drop mvwds ( EDCADR , WNDADR 4094. loop ( 32. ) DREGION' wi th M_EDGE DRECION end MODEL RECORD Type of point Code Right Angle Corner 4!X!Y Endpoint 0!X wh re X is the orientation of the point and Y i s the direction as foilows : * > parameter MAX_#_ENT :- 20 Maximum » of permissible entities, parameter #POINTS : » 25 Maximum # of points permitted within an ent i t . record P0INT_RΕC integer XI Yl Coordinates of first corner point. integer CURTYPE Type of the line between 1st and 2nd point. integer XJ YJ Coordinates of second point. integer NXTTYPE Type of the next line (between 2nd and 3rd) dummy -3 endrecord reeord ENTITY integer »PTS t of points. POINTJSEC 21 ( eFOINTS ) See record POINTS. end ecord record FRAME_REC integer FRMt Frame • integer #ENT t of ent i t ies . ENTITY El ( MAX_#_ENT ) integer H 1 HX2 HY1 H 2 Horizontal landmark points. integer VX1 VX2 VYI VY2 Vertical landmark points. integer HX3 HX H 3 H 4 Horizontal landmark points. integer VX3 VX4 VY3 V 4 Vertical landmark points. ndrecord Store the current model under a given filename. STORE_MODEL 'FILENAME ) define STORE_MODEL integer NAME local integer OUTCH OUTCH :» open ( NAME , ' t > wrs ( OUTCH , FRAME , size FRAME_REC ) close { OUTCH ) end *> <* Load the current model from a previously stored file. GET_M0DEL ( 'FILENAME ) *) define GET_MODEL integer NAME local integer INCH char PNAME ( 30. ) wi th M MODEL ATTRG ( "MODELR" , 140000k ) ptr ( FRAME_REC ) :- WNDADR mvstr ( ' dm4: -5,3. , PNAME ) concat ( PNAME , NAME ) INCH :» open ( PNAME , 'r ) rds ( INCH , WNDADR , size FRAME_REC ) drop close ( INCH ) DREGION ' end long CURPNT Coordinates of the current point .mac integer LNTMP ( 0 ) . bIkw 8. .WORD ptr ( LNTMP ( 3 ) ) Line Temporaries: LNTMP ( 0 ) . NPTS Major Direction Length (Count) LNTMP ( 1 ) . := DMN Change in minor direction. LNTMP ( 2 ) DMJ Change in major direction. LNTMP ( 3 ) . a. YINC Y increment if major, else 0. LNTMP ( 4 > I C X increment if major, else 0. LNTMP ( 5 ) * YINC Y incr ement . LNTMP ( 4 ) m XINC X inc emen . LNTMP ( 7 ) FRAC accumul ed frac ion LNTMP ( 8 ) - * • ptr ( INC ) Pointer to current increments. <* Set up the endpoints of the line and initialize the current point (CURPNT) . Initialize the LNTMP array. FIRSTPT ( XI Yl X2 Y2 ) * > entry FIRSTPT ' aov « LNTMP , rO Get pointer to LNTMP array. sub (msp) , ι3 Form Yl - YO . bge 0$ I f negat i e : neg r3 make it positive. and ov # -1 , rl form -1 as increment. br It Else : 0 s : mov * 1 ., rl form +1 as incremen . It mov rl , 4 (rO) Store increment in LNTMP ( 3 ) mov rl , 10. (rO) and LNTMP ( 5 ) . mov ( (mmssρp))s+- ,, δβ ** ptr ( CURPNT ) Store in CURY sub (msp ) r2 Form XI - XO . bge 21 If negative: neg r2 make it positive and mov » -1 rl form -1 as increment . br 3* Else: 2> mov * 1 , rl form +1 as increment . 3$ : mo rl , 8. (r 0) Store increment in LNTMP ( 4 ) mov rl , 12. (rO) and LNTMP ( 4 ) . mov (msp)+ , 8 # ptr ( CURPNT ) + 2 - Store in CURX. emp r2 r3 Compare DX to DY. bit 4$ If DX > DY: mov r3 2 (rO) Place DY in LNTMP ( mo r2 r3 Copy DX int o r3. clr 4 CrO) Don't change Y on major "seal e br SI Else: 4ϊ mov r2 , 2 ( rO) Place DX In LNTMP ( 1 ). clr 8. (rO) Don't change X on major scale. 5$ mov r3 , 4 (rO) Place major in LNTMP < 2 ) mo r3 , (rO) Initialize counter — LNTMP ( 0 ) ine (rO) Include the endpoints. neg r3 Form — < MAJOR / 2 ) asr r3 mo r3 , 14. (rO) Place in LNTMP ( 7 ) (fraction) . ne t . local <* Update the contents of CURPNT to point to the next point in the line If there is a next point, TRUE is returne , else FALSE is returned . LOGICAL :« NXTPNT *> entry NXTPNT integer aov » LNTMP rO Get pointer to LNTMP array dec CrO) Decrement counter. clr - (ms ) push a zero (false) br 21 and return. OS # ptr ( CURPNT ) r2 Get pointer to CURPNT 3 **" "- Γ * " aov 14. (rO) , rl Get pointer to XINC. add 2 (rO) , 14. (rO) Add minor change to fraction. bi .11 If overflow. sub 4 (rO) , 14. (rO) Subtract major change f om fractic: add * 4 , rl Point to major and minor increments 1S add (rl >+ , ( r2 ) + Add proper X increment to CURX. add (rl ) , (r2 ) Add proper Y increment to CURY. mov # -1 , - (msp > Push a -1 (true) 2S n«κ t and r eturn . , end <* Update the contents of CURPNT after moving a given number of points. -1 is returned if successful . If not successful , the number of successful increments before ending is returned. IVAL := NXTPNTS *_POINTS > define NXTPNTS integer integer IIPNTS NXTPNTS on iter #PNTS if ( not NXTPNT NXTPNTS exit end i f loop end integer CORLEN CORVID Length and width of corner masking. long PNTINC Point increment to add to CURPNT. integer DX1 DY1 DX2 DY2 Deltas for best fit of line to image. integer MDLEV Grey level to write for model pcints. integer TOTAL BEST Totals for finding best fits. integer REGX REGY Registration error in X and Y. integer XWIND YVIND Registration window size in X and Y. XWIND : . 4 YWIND :» 4 long VMASK ( 0 ) Masking values for vertical lines. .blkw 8 . long wdlo ( 0 , 1 ) . long wdlong ( 0 , -1 ) . long w 1 ong ( 0 , -1 ) . long wd 1 ong ( 0 , 1 ) long KMASK ( 0 ) Masking values fcr horizontal lines. .blkw 8 .1ong wd I ong ( 1 , 0 ) . long wd I ong ' 1 , 0 ) .1 ong wdlong ( -1 , 0 ) . long wdlong C -1 , 0 ) MDLEV :« 252. ; Make these points look like evens. CORLEN :=. 5 CORWID :» 3 .mac <* Add two longs as if they were two sets of two integers. LVAL :« LI+ ( LVAL1 , LVAL2 > *) entry List- long add (msp>+ ,. 2 (msp) add (msp)-» , 2 (msp) next <* Subtract two longs as if they were two sets of two integers. LVAL :« LI- ( LVAL1 , LVAL2 ) *> entry LI- long sub (msp)-t- , 2 (msp) sub (πsp)+ , 2 (msp) next . end <* Set the size of the registration window. WINDOW ( XSIZE . YSIZE ) »> define WINDOW integer XW YW XWIND :« XW YWIND • « YW end <* Test the current line to be vertical LOGICAL :» VERTICAL *> define VERTICAL ifunc ( abs ( YJ - Yl ) ) abs ( XJ - XI ) ) end (* Fix the model by adding in the registration error FI MDL ( REG_X . REG_Y > «) define FIXMDL integer REGX REGY iter »ENT with El ( i ) iter #PTS with 21 { i ) XI +« REGX Yl +» REGY I oop loop end <* Test a model line for matches against the image. Place total number of matches in TOTAL. TESTLN ( XI Yl X2 Y2 *_SKIPS ) *) def ine TESTLN integer Xi Yl «FTS long REGINC if ( #PTS ) CURPNT :« w l ong ( Yl , XI > iter #PTS ♦ 1 if ( MRDPIX ( CURPNT ) ) ' increment TOTAL endif CURPNT : - LI+ ( CURPNT , REGINC ) loop endi f end <* Return the number of points to skip for a model line. IVAL :-> GETPTS ( P0INT_1 , POINT_2 ) «) define GETPTS integer integer PT1 PT2 if ( PT2 > PT1 ) GETPTS :« limit ( ( PT2 - PT1 ) / 10 , 1 , 10 ) else GETPTS l imi t C < PT2 - PT1 ) / 1 0 •10 en if end <* Register the image with the model Fir the model when registratior i com Iet *> define REGISTER local inteςer HlitPTS V1#PTS integer H2fPTS V2#PTS long H1PTINC V1PTINC 1ong H2PTINC V2PTINC with M_MODEL ATTRG t "MODELR" , 1 0000k > with M_EDGE ATTRG ( "MTCHIM" , 140000k ) BEST off REGX off REGY off H1#FTS ... G G EETTPPTTSS (( ( HϊH .XXX11 , , HH 22 )) H2IPTS :» C G .EETTPPTTSS (( ( HIH -IXXX33 ,, HHX4 )) V1*PTS :-= C G EETTPPTTSS (( ( VV * . /YYY11 , , VVYY22 )) V2#PTS := C G EETTPPTTSS (( ( V * V ✓YY33 . . VVYY4 )) H1PTINC :* -- wwddll oonngg (( 0 0 . H HllββPPTTSS ) H2FTINC =a wwddlloonngg (( 0 0 , H H22IIPPTTSS ) V1PTINC := wdl ong < V1#PTS , 0 > V2FTINC :* wdlong ( V2#PTS , 0 ) H1#PTS := C HX2 - H 1 ) H1#PTS H2UPTS .= ( HX4 - HX3 ) H2#PTS VlttPTS :« ( VY2 - VY1 ) V1#PTS V2#PTS : ( VY4 - VY3 ) V2tPTS do — XWIND . XWIND ' do — YWIND , YW1ND TOTAL off TESTLN ( HXi + j . HY1 + i , HltPTS , H1PTINC ) TESTLN ( HX3 «- j , HY3 + 1 , H2#PTS . H2PTINC ) TESTLN ( VX1 ♦ 1 , VY1 + i , V1*PTS . V1PTINC ) TESTLN ( VX3 + i , VY3 + i , V2#FTS , V2PTINC ) if ( TOTAL ) BEST 3 BEST :« TOTAL REGX :- i REGY :« i end if loop loop FIXMDL ( REGX , REGY ) print REGX , REGY DREGION with M_M0DEL DREGION ATTRG ( "IPSDBR" , WNDADR > ptr ( IPSDB_REC ) : » WNDADR wi th INSP_DATA_BASE REG_X :» REGX ^^ A ζT REG_Y REGY DR EG I ON en d >" Get the best match of a model line to an image line. Place results in the variables DX1, DY1, DX2 , and DY2. GETBEST ( XI , Yl , X2 ' , Y2 ) «> define GETEEST integer XI Yl X2 Y2 local integer ttSKIPS tSKIPS :« limit ( max ( abs ( X2 - Xl ) , abs ( Y2 - Y1 ) ) / 10 , 1 , 10 > BEST off do -1 1 TOTAL off if ( VERTICAL ) FIRSTPT ( XI + i , Yl X2 i . Y2 ) lse FIRSTPT ( XI , Yl + i X2 Y2 i ) end i f begin if ( MRDPIX ( CURPNT ) ) increment TOTAL endif until ( NXTPNTS < #SKIPS > <> -1 ) if ( TOTAL ) BEST > BEST : - TOTAL if ( VERTICAL ) DX1 := i DX2 : = i DY1 off DY2 off else DX1 off DX2 off DY1 : - i DY2 :» i end if end i f loop end <» Look for pixels adjacent to the line to match to. If there are adjacent pixels, delete them from the image. NOADJ returns TRUE if no adjacent pixels were found; otherwise, it returns FALSE. LOGICAL :- NOADJ *> define NOADJ integer NOADJ on if ( MRDPIX ( Lit ( CURPNT , PNTINC ) ) ) TESTVAL ) MWRPIX ( LI+ ( CURPNT . PNTINC ) , 0 NOADJ off end i f if ( MRDPIX ( LI- ( CURPNT , PNTINC ) ) ) >= TESTVAL ) MWRPIX ( LI- ( CURPNT , PNTINC ) . 0 > NOADJ of endif end <* Mask the outside of a corner. The area masked is CORWID z CORWID. *> define OUTERMASX local long FIRSTPT TMPPNT FIRSTPT :■ LI- ( CURPNT , VMASK ( CURTYPE > ) iter CORWID FIRSTPT :» LI- ( FIRSTPT , HMASK < CURTYPE ) ) TMPPNT :» FIRSTPT iter CORWID MWRPIX ( TMPPNT , 0 ) TMPPNT :» LI- ( TMPPNT . VMASK ( CURTYPE ) ) loop loop end <* Mask a corner using the increment supplied. CORMASK ( PNTINC ) *> define CORMASK long CURINC local long TMPPNT TMPPNT :» CURPNT iter CORWID + 1 MWRPIX ( TMPPNT , 0 ) TMPPNT :« LI+ ( TMPPNT , CURINC ) loop TMPPNT :« CURPNT iter CORWID TMPPNT :» LI- ( TMPPNT , CURINC ) MWRPIX ( TMPPNT , 0 ) loop end <* Match a model line to the image. Also perform' corner masking. MATCHLN ( XI , Yl , X2 , Y2 ) *) define MATCHLN integer XI Yl X2 Y2 1oca! long TMPPNT long NXTINC FIRSTPT ( XI Yl X2 Y2 ) if ( VERTICAL ) PNTINC :« VMASK ( CURTYPE > NXTINC :« VMASK ( NXTTYPE ) else PNTINC :» HMASK ( CURTYPE ) * -- NXTINC :- HMASK ( NXTTYPE > endif OUTERMASK iter CORLEN CORMASK ( PNTINC ) if ( not NXTPNT ) return en if loop if ( LNTMP ( 0 ) > CORLEN ) begin if ( MRDPIX ( CURPNT > ) ; >« TESTVAL ) MWRPIX ( CURPNT , 0 ) else if ( NOADJ > MWRPIX ( CURPNT , MDLEV ) endif end i f NXTPNT drop until ( LNTMP ( 0 > -,*. CORLEN > endif begin CORMASK ( NXTINC ) until ( not NXTPNT ) e d <* Execute the matching process for every line in the model def ine MATCH with M_MODEL ATTRG ( "MODELR" . lάOOOOk ) wi th M_EDGE ATTRG ( "MTCHIM" , 140000k ) iter #ENT wi h El ( i ) iter #PTS - 1 with ZI ( i ) GETBEST ( XI Yl XJ YJ ) MATCHLN ( XI + DX1 . Yl + DY1 XJ + DX2 YJ + DY2 loop loop DREGION with M_MODEL DREGION nd DEEECT ANALYSIS ; * ***«*******•****«*«**» DEFECT. G - THIS MODULE LOADS ALL OF THE MODULES USED IN "DEFECT" ***Λ***rT*******ΛΛ* * > ext PDPID Assembly language mneuemonics. ext MIXLIB Mixed-mode arithmetic support. ext DMISC Miscellaneous utilities. ext DEFREC Region mapping utilities. ext DEFCOM Intertask communication utilities. ext POINTS Analysis of disagreement pixels ext C3.13 INSPLAN Inspection Data Base record structure. eεt CONFIRM Store defects or confirm repeating defects. integer DEFCBF ( 15. ) DEFECT intertask communic tion buffer integer STPFLAG Flag to indicate stopped communication. integer TMPICH TMPOCH Temporaries for input and output channels. <* Start communication with the master task. *> define CONNECT_2_MASTER INITREC be in RECEIVE ( DEFCBF > un.il ( STPFLAG ) end <* Restart communica ion with the master task. define RECONNECT SET ( SYNC2 > begin RECEIVE ( DEFCBF ) until ( STPFLAG ) end <* Stop communica ion, and allow input f r om a t ermi na l STOPCO ( *TTn ) * > define STOPCO integer TERM TMPICH := cich TMPOCH :» coch cich := open ( TERM , rwa ) coch :■ cich poke ( 2 , fdb ( cich ) ) at term STPFLAG cn end < * * Restart communication after a STOPCO. «) define STRTCO DETTERM e1 ose ( c ich ) cich : - TMPICH coch :« TMPOCH STPFLAG off RECONNECT end (* Perform both disagreement analysis and defect storage/conf irmation. def ine DETECT BLOB STORE end <* Initialization for DEFECT *> define DEFECTINIT CONNECT_2_MASTER end mvstr ( 'defect , promstr ) Srestart := base DEFECTINIT save UFDEFECT integer BANDSIZE Sixe of "don't care" band around image integer #BLOB Allowable number of blobs. *BLOB :•= ISO. BANDSIZE :« 25. integer XO XL YO YL Image limits. XL :* 254. YL :» 256. record RASPT_REC integer PTCNT "Number of points found. integer POINTS ( 256 Point positions. endr ecor RASPT_REC RASPTS with RASPTS record BLOB^REC integer BLBID ID cf this blob. integer BLBTOT Total points. long XBCOM X center of mass totals. long YBCOM Y center of mass totals. integer MINXO MAX l Minimum and Maximum X values integer MINYO MAXYl Minimum and Maximum Y values. endrecord record FINAL_REC integer CURLINE Y 1 ine number . integer CURBLOE ID of blob that new point is added to. integer CURPT X position of current point . integer NXTBLB Pointer to the free blob stack ID. integer FREEBLOBS ( #BLOB ) integer BLOBMAP ( ( #BL0B + 15 ) / 16 ) BLOB_REC BLOBS ( #BLOB ) endrecord FINAL_REC FINAL with FINAL <« Record for accessing the image lines with the mapped region. *> record LINES_REC char TOP 256. char CEN 256. char BOT 2S6. endrecord <* Convert a raster line into point encoded data. RAS2PT ( INFUT_BUFFER . OUTPUT_BUFFER , LENGTH ) entry RAS2PT mov (msp)+ , rO Count -> rO . mov (msp )+ , r 1 Output buffer pointer -) rl . mo v (msp) , 2 Input buffer pointer -> r2. clr (msp ) Clear temporary point counter. ■O V r 1 , -(rp) Store output pointer on rp stack. clr r3 Clear pixel counter. ts t (rl ) + Bump pointer to output buffer . OS - tstb • (r2 )+ Test the point. beq is If it is no xero: ; bi tb # 1 , -(r2) Low order bit is Q if even, 1 if odd. , bne 2S If even : mov r3 , ( r 1 )+ Copy pixel number into POINTS array. ine (msp > Increment point counter . ; 2 % : clrb (r2> + Zero the image point. IS : ine ra Increment pixel counter . dec rO Decrement count. bn e OS Loop bac . mov (rp)-t , rl Restore output buffer pointer. mo v (msp ) + , ( r l > Store point count in PTCNT. nex t < Se all points that art at VAL2 to VALl in the vector. VECSET ( BUFFER . VALl , VAL2 , LENGTH ) entry VECSET nov (msp ) + , r 0 Count in r0. mov (msp)s- , rl Tes t value in rl ov (ms ) + , r2 Value to set in r2. mov (msp )s- , r3 Buffer pointer in r3. add rO , r3 Point r3 to end of buffer. *-S : cmpb -tι3) , rl Compare point to VAL2. movb r2 , (r3) set to VALl. SS dec rO Decrement count . bne 94 Loop back. next ( * Returns the first value of three that is non-zero , or zero if all zero. IVAL :» 3MAX ( VALl , VAL2 , VAL3 ) «> ent ry 3MAX integer mo (msp) + rl VAL3 in rl . mov (ms )+ rO VAL2 in rO. ts t (msp ) Test VALl bne 5S If non-zero, return VALl ts t rO Else test VAL2. bne 4t If zero : mov rl (msp ) return VAL3. br 5$ Else : 4S mov rO (msp ) r e t u rn VAL 2 . 55 nex t ( * Ad d a po i n t t o a b l o b . entry ADDBLOB mov β t ptr ( BLOB_REC ) , rO mov @ # ptr ( FINAL_REC ) , rl CURBLOB :» BLEID mov So BLBID (rO) , So CURBLOB (rl) BOT ( CURPT ) := CURBLOB mov So CURPT (rl) , r2 mov 9 * ptr ( LINES_REC ) , r3 add r2 , r3 aovb So CURBLOB (rl) , So BOT Cr3) ; increment BLBTOT ine So BLBTOT (rO) ; MAXYl :« CURLINE so So CURLINE (rl) , So MAXYl (rO) ; XBCOM :a« li dd ( XBCOM , CURPT ) add r2 , ( So XBCOM + 2 > (rO) adc So XBCOM (rO) , YBCOM := liadd ( YBCOM , CURLINE ) add So CURLINE (rl) , ( So YBCOM + 2 ) (rO) adc So YBCOM (rO) next end Blob records are assigned out of a pool of available space FREEBLOBS i s a stack, with pointer NXTBLOB, and, for redundancy, BLOBMAP i s a bitmap of used blob records, define CETBLOB integer if ( NXTBLB ««0 > print "OUT OF BLOBS" endif GETBLOB :» FREEBLOBS ( NXTBLB ) setbi t ( GETBLOB BLOBMAP ) vzer ( BLOBS ( GETBLOB ) , s i zew BLOB_REC ) decrement NXTBLB end <" Return a blob to the stack of free blobs. RETBLOB ( BLOB_ID > *) define RETBLOB integer ARGl increment NXTBLB FREEBLOBS ( NXTBLB ) :» ARGl clrbit ( ARGl BLOBMAP ) end < * Start a new blob. *> define NEVBLOB local integer TEMPI TEMPI :ae GETBLOB Get a new blob recorb with BLOBS ( TEMPI > BLBID :» TEMPI Setup THIS ID MINXO CURPT MAXXl CURPT MINYO CUR INE ADDBLOB end (* Merge two blobs into one blob. *> define MERCEBLOB local integer TMPTOT long TMP COM TMPYCOM in t eger TMPXO TMPX1 i teger TMPYO TMPY1 if ( BLBID mm CURBLOB ) Ring situ tion return end i f TMPTOT :« max ( CURBLOB BLBID ) CURBLOB : at rain ( CURELOΞ BLBID Merge into lower blob ID pr int ta ascii . , τ VECSET ( TOP , CURBLOB , TMPTOT 25o VECSET ( CEN , CURBLOE , TMPTOT 254. VECSET ( BOT , CURBLOE . TMPTOT CURPT + 1 ) with BLOBS ( TMPTOT ) ; Sa e dy ing blob info in TEM? mvwds ( ptr ( BLBTOT ptr ( TMPTOT ) , 9 RETBLOB ( BLBID ) with BLOBS ( CURBLOB ) BLBTOT * - TMPTOT XBCOM +«. TMPXCOM YBCOM +» TMPYCOM MINXO :» Bin ( MINXO , TMPX0 ) MAXXl := * max t MAXXl TMF 1 ) MINYO : - min ( MINYO , TMPYO ) KAXY1 := max ( MAXYl TMPY1 > end <* Test the two points above the current point for a value. Returns TRUE if either has a value. *) define UPTEST integer UPTEST : - max ( CEN ( CURPT ) , TOP ( .CURPT ) ) if ( UPTEST ) with BLOBS ( UPTEST ) ADDBLOB end if end <* Test 2 points to the left in each of three rows for a value, define LEFTTEST local i eger BLID do 1 2 BLID :« 3MAX ( EOT ( CURPT - i > CEN ( CURPT - i ) TOP < CURPT - T if ( BLID > exit endif . loop if ( BLID ) with BLOBS ( BLID ) MAXXl m max ( MAXXl . CURPT ) ADDBLOB end i f end <* Test 2 points to the right in each of two rows for a value. «> define RIGHTEST local integer BLID do 1 2 BLID :» max ( CEN ( CURPT + i ) , TOP ( CURPT s- i ) ) if ( BLID ) exit endif 1 oop if ( BLID ) with BLOBS f BLID ) if ( CURBLOB >0 ) MERGEBLOB else MINXO :» mm ( MINXO , CURPT > ADDBLOB end t f endif end <* Convert from point encoded format to blob ormat . *; define PT2BLOB local integer TEMPI increment CURLINE ; Get next raster line iter PTCNT ; Do for each point found in this raster line CURPT :« POINTS ( i ) ; Set up current point . CURBLOB on ; No current blob at start, if ( not UPTEST ) LEFTTEST RIGHTEST en if if ( CURBLOE <0 ) NEVELOB endif ; New blob found loop end <* Set up the disagreement analysis, define INITBLOB mvier ( FINAL , sixew FINAL-REC * NXTBLB o f CURLINE :« BANDSIZE - 1 do 1 . #BLOB - 1 _, O.M RETBLOB ( i ' 3 Put all the blob-recs on the stack loop WNDOFF -rff MAPV ' WNDB ) ptr ( L1NES_REC ) :« WNDADR mvier ( TOP , BANDSIZE * 128. ptr ( LINES_REC ) +« BANDSIZE 256. - 768. end (* Execute the analysis for a given number of lines. DOLINES ( #_LINES ) *> define DOLINES integer ttLINES local integer WBNDSZ LASTFT VBNDSZ :« 2/ ( BANDSIZE ) LASTPT :« 256. - BANDSIZE iter ILINES ptr ( LINES_REC ) + * 256. mvier ( BOT , WBNDSZ > mvier ( BOT + LASTPT , WBNDSZ ) RAS2FT ( BOT RASPTS LASTPT ) PT2BLOB if ( NXTBLE < 10 ) BEEP print "TOO MANY BLOBS" ; ; exit endif loop end <* Perform the entire disagreement analysis, *> def ine BLOB wi th M_EDGE ATTRG ( "MTCHIM" , 160000k ) INITBLOB DOLINES ( 24. - BANDSIZE ) do 64. , 832. VNDOFF : m i MAPW ( WNDE ) ptr ( LINES_REC ) WNDADR + 1280. DOLINES ( 16 ) loop .( 64. > WNDOFF : m 896. MAPW ( WNDB ) ptr ( LINES_REC > :» WNDADR + 1280 DOLINES ( 24. - BANDSIZE ) avxer ( BOT , BANDSIZE * 128. ) DREGION end en f i 1e (* CALCULATE THE CENTER OF MASS OF A BLOB. THE UN-NORMALIZED TOTALS ARE IN XBCOM AND YBCOM X.Y .» BLBCOM ( BLOB-ID ) *) define BLBCOM long integer ARGl wi th BLOBS ( ARGl > BLBCOM : =- wdlong ( lidiv ( XBCOM BLETOT ) lidiv < YBCOM BLETOT ) ) end integer TOOMANY ; Flag to indicate too many defects integer COMTHRESH DELTHRESH ; Repeating defect threshholds. integer TOTTHRESH FLTTHRESH ; Valid defect threshholds COMTHRESH := 3 ; COM's may be within COMTHRESH pixels DELTHRESH .« 5 , DEL's may be within DELTHRESH pixels. TOTTHRESH :» ? ; Must have at least TOTTHRESH pixels. FLTTHRESH :» 2 ; DELX and DELY at least FLTTHRESH + 1 pixels. <* Store the defects in the defect buffer (Primary mode) * ) define STOREDEFS #_DFCTS off iter #BLOB if ( getbit ( i , BLOBMAP ) ) with BLOBS ( i ) if ( BLBTOT >» TOTTHRESH ) if ( MAXXl - MINXO >- FLTTHRESH > if ( MAXYl - MINYO >» FLTTHRESH ) with DEFECTS ( #_DFCTS ) XCOM :» lidiv ( XBCOM , BLBTOT ) - REG_ YCOM :« lidiv ( YBCOM , BLBTOT ) - REG. DELX :« 2/ ( MAXXl - MINXO + 1 ) DELY :« 2/ ( MAXYl - MINYO + 1 ) increment *_DFCTS if ( *_DFCTS »« MAX_DEFECT ) BEEP print "TOO MANY DEFECTS" end i t endi f endif endi f endif loop end <* Add a defect to the defect buffer, given a pointer to the DEFEC". record to be added. ADD_DEFECT ( DEFECT_PO INTER ) * > define ADD_DEFECT address DEFPTR with F_DEFCTS ( CU _FRAME ) mvwds ( DEFPTR , DEFECTS ( #_DFCTS ) , siie DEFECT ) increment *_DFCTS if ( #_DFCTS »= MAX_DEFECT )• TOOMANY on endif end Check every defect found against the previous defects to locate- repeating defects. (Confirm mode) *> de t ine CHECKREPT loc l DEFECT_EUFFER FRIM_DEFS integer TXCOM TYCOM integer TDELX TDELY mvwds ( F_DEFCTS < CUR_FRAME ) , PRIM_DEFS ≤isew DEFECT BUFFER ) TOOMANY off *_DFCTS off wi if ( getbit ( i , BLOBMAP ) ) with SLOBS ( i ) if ( BLBTOT * TOTTHRESH ) if { MAXXl - MINXO >» FLTTHRESH ) if ( MAXYl - MINYO >. FLTTHRESH ) TXCOM :χ lidiv ( XBCOM » BLBTOT ) REC_X TYCOM = lidiv ( YECOM , BLBTOT REG_Y TDELX m 2/ ( MAXXl - MINXO + 1 TDELY m 2 1 ' MAXYl - MINYO + 1 iter * DFCTS with PRIM_DEFS with DEFECTS ( i. ) if ( abs ( XCOM - TXCOM ) <= COMTHRESH ) if ( abs ( YCOM - TYCOM ) = COMTHRESH > if ( abs ( DELX - TDELX ) <•= DELTHRESH ) if ( abs ( DELY - TDELY ) (* DELTHRESH ) ADD_DEFECT ( DEFECTS ( i ) ) e it endif end i f endif endif loop if ( TOOMANY ) BEEP print "TOO MANY DEFECTS' exit endif endif endif endif end i f loop end '* Store the defects found, whether primary of confirm mode. define STORE with M_EDGE ATTRG C "IFSDBR" , 1600001: ) ptr ( IPSDE_REC ) :* WNDADR with INSP_DATA_BASE with INSP_PLN with LAYERS ( MOD_LAYER ) with DTL_LAYER_REV ( #_REVS - 1 ) with L_RETICLE wi h RETICLE_DIE with D_PATTERNS ( MOD_PATTERN ) with !NSP_FR i MOD_SITE ) with F_DEFCTS ( MOD_FRAME if ( I-MODE «« PRIMARY ) STOREDEFS else CHECKREPT end i f DREGION end

Claims: What is claimed is: 1. Apparatus for the automatic inspection of a semiconductor wafer surface comprising means for illuminating the wafer surface, scanning means for forming in a storage S array a representation of the spatial distribution of illumination energy intensity reflected from the surface, edge analysis means for automatically analyzing the reflected energy spatial distribution represented in said array for determining edge boundaries occurring on said wafer surface, reference means for providing a reference pattern description of said wafer surface, comparison means for comparing the edge boundaries determined by said analysis means with said reference pattern description for determining the location of boundary disagreements between the analysis means edge boundaries and the reference pattern description, and means for generating an information output describing said boundary disagreements. 2. The apparatus of claim 1 wherein said illumination means comprises dark field illumination means for illuminating said wafer surface with dark field illumination. 3. The apparatus of claim 2 wherein said scanning means comprises a sensor array having a plurality of photoresponsive elements arranged in a linear pattern, each said element being responsive to illumination incident thereon. means for mounting said linear sensor array for receiving energy reflected from said wafer surface, means for focusing said reflected illuminated surface onto said sensor array elements, means for reading from said sensor array and for storing data in said storage array corresponding to said spatial distribution representation. 4. The apparatus of claim 1 wherein said edge analysis means comprises means responsive to said scanning means for generating a second spatial distribution representing local differences of the reflected illumination intensity across said wafer surface, means responsive to said second spatial distribution for locating potential edge boundaries in said second spatial distribution, means for storing said located potential edge boundaries when said potential boundaries have a strength which exceeds an edge threshold level, and means for spatially filtering said located and stored edge boundaries for forming more continuous edge boundary patterns. 5. The apparatus of claim 4 wherein said storing means and said storage array are the same memory element. 6. The apparatus of claim 4 wherein said illumination means comprises a dark field illumination means for illuminating said wafer surface with an oblique illumination from all directions, and said generating means further comprises means for spatially smoothing said first spatial distribution, means for convolving said first * spatial distribution along a first axis separately with a peak detecting spatial function and a step detecting spatial function, means for convolving said first spatial distribution along a second axis orthogonal to said first axis separately with said peak detecting and said step detecting functions, and means for generating from said orthogonal covolvutions said second spatial distribution. 7. The apparatus of claim 1 wherein said reference means comprises a data reference source describing a wafer surface pattern, and means for generating from said data source a data list of reference edge boundaries on said wafer surface. 8. The apparatus of claim 7 wherein said data source further comprises an activity data source for identifying the spatial extent of active areas on said semiconductor wafer. 9. The apparatus of claim 7 wherein said reference means further comprises means for identifying activity volumes on said semiconductor wherein a defect will adversely affect operation of a circuit associated at least in part with said volume. OMPI 10. The apparatus of claim 1 wherein said comparison means comprises means for locating corresponding edge boundaries of said reference pattern description and said analysis means edge boundaries for effecting alignment of the reference and the analysis edge boundaries, means for identifying non-corresponding edge boundaries of said reference pattern and said analysis means edge boundaries, and disagreement means responsive to said identifying means for analyzing said identified non-corresponding edge boundaries for determining boundary disagreements on said wafer surface. 11. The apparatus of claim 10 wherein said disagreement means further comprises means for classifying said boundary disagreements into a plurality of boundary disagreement classes. 12. The apparatus of claim 11 wherein one of said classes is a class of killer defects. 13. The apparatus of claim 10 wherein said identifying means further comprises means for locating corner edge intersections in said reference pattern, and means for providing a disagreement tolerance at said corner edge intersections for maintaining a correspondence between a squared reference corner and a rounded wafer corner. 14. The apparatus of claim 1 wherein said generating means comprises OMPI eans for selecting a boundary disagreement, and means for repositioning said wafer surface for visual inspection of said wafer surface at said selected boundary disagreement. 15. The apparatus of claim 1 further wherein said wafer surface has a repeating reticle pattern thereon and said apparatus further comprises means for automatically comparing boundary disagreements for at least two of said patterns to determine the presence of a repeating boundary disagreement, and means responsive to a said repeating disagreement for classifying said repeating disagreement boundary as a reticle defect. 16. A method for the automatic inspection of a semiconductor wafer surface comprising the steps of illuminating the wafer surface, forming in a storage array a representation of the spatial distribution of illumination energy reflected from the surface, automatically analyzing the reflected energy spatial distribution represented in the array for determining edge boundaries occurring on the wafer surface, providing a reference pattern description of the wafer surface, comparing the edge boundaries determined during said analyzing step with the reference pattern description and determining the location of boundary disagreements between the reference pattern description and the edge boundaries detected during the analyzing step, and generating an information output describing the boundary disagreements. 17. The method of claim 16 wherein said illuminating step comprises the step of illuminating s * aid wafer surface with a dark field illumination for highlighting edge boundaries on said surface. 18. The method of claim 17 wherein said forming step comprises the steps of mounting a linear sensor array element for receiving a said reflected energy from the wafer surface, providing the array element with a plurality of photosensitive elements arranged in a linear pattern, each element being responsive to the illumination incident thereon, focusing the reflected illuminated surface onto the array element, and reading and storing signal values from said array element in said storage array, said signal values corresponding to said reflected energy spatial distribution. 19. The method of claim 16 wherein said analyzing step comprises the steps of generating a second spatial distribution representing local differences of the reflected illumination across the illuminated wafer surface, locating potential edge boundaries in said second spatial distribution depending upon said local differences, storing the located potential edge boundaries when a said boundary has a strength value which exceeds an edge threshold level, and spatially filtering the located and stored edge boundaries for forming a more continuous edge boundary pattern. 20. The method of claim 19 further comprising the steps of illuminating said wafer surface with a dark field illumination for highlighting edge boundaries on said surface, and said generating step further comprises the steps of spatially smoothing said first spatial distribution, convolving said first spatial distribution along a first axis separately with a peak detecting spatial function and a step detecting spatial function, convolving said first spatial distribution along a second axis orthogonal to said first axis separately with said peak detecting and step detecting functions, and generating from said orthogonal convolutions said second spatial distribution. 21. The method of claim 16 further comprising the steps of providing a data source for describing an expected wafer surface pattern, and generating from the data source a list of reference edge boundaries properly expected to exist on said wafer surface. 22. The method of claim 21 wherein the providing step further comprises the step of identifying -216- the extent of active semiconductor areas on the semiconductor wafer. 23. The method of claim 21 wherein said providing step further comprises the step of identifying activity volumes of said semiconductor wherein a defect will adversely affect operation of a circuit associated at least in part with a said volume. 24. The method of claim 16 wherein the comparing step further comprises the steps of locating corresponding edge boundaries of the reference pattern descirption and the analyzed edge boundaries on the wafer for providing effective alignment between the reference and analysis edge boundaries, identifying non-corresponding edge boundaries of the reference pattern and the analysis edge boundaries, and analyzing, in response to the identifying step, the identified non-corresponding edge boundaries for determining boundary disagreements on the wafer surface. 25. The method of claim 24 wherein the comparison step further comprises classifying the boundary disagreements into a plurality of boundary disagreement classes. 26. The method of claim 25 wherein one of the classes is a class of killer defects. 27. The apparatus of claim 22 wherein the identifying step comprises the steps of O Pi locating corner edge intersections in the reference pattern, and providing a greater disagreement tolerance at th corner edge intersection before identifying a corner edge as a I non-corresponding edge. 28. The method of claim 16 wherein said generating step comprises the steps of selecting a boundary disagreemnt, and repositioning the wafer surface for visual inspection of the wafer surface at the selected boundary disagreement. 29. The method of claim 16 wherein the wafer surface has a repeating reticle pattern thereon and the method further comprising the steps of automatically comparing boundary disagreements f at least two repeating patterns to determine the presence of a repeating boundary disagreement, and classifying any repeating boundary disagreement a reticle defect.

Inventors: BRAUNER RAUL A, ESRIG PAUL, LIFF HAROLD, ULLMAN SHIMON, BRAUNER, RAUL, A., ESRIG, PAUL, LIFF, HAROLD, ULLMAN, SHIMON
Applicants: CONTREX INC, CONTREX INC.
Application year: 1982
Main classification: G01B11
IPC codes: G01B11, G01N21, G06T7, H01L21