Getting It Right

Something had to be done to get the project on track. The team was reorganized, and, in spite of looming deadlines, made smaller. Chris was not replaced. Fred moved off to a different project. Willis and Henry moved off to a different 777 support role, working with the C compiler that was used for a small portion of the 777 code. Peter, an additional consultant from DDC-I, was added. Tom officially took over as project lead. The team divided the work not previously done, identifying the unique features of the processor that affect code generation and the runtime implementation. The frontend of the compiler could be used without change. Only a very small amount of the code generation and a minimal amount of the runtime are necessary to compile and run "Hello World". Though it was close, the first deadline was met.

Following this, some team members began the detailed design and implementation of the storage management, task management, and exception management of the runtimes. Others continued with more code generation.

Waleen did the design and implementation of storage management. At a high level, many of the algorithms could be similar to those used for the I960. The biggest challenge was that this was being written in assembly language, so a complete rewrite needed to be done. Waleen also had to learn the assembly language.

A low-level body of code called the User Configurable Code (UCC) allows for the writing of a very small portion of code to allow interfacing of the runtime with the actual hardware. Some examples of code in the UCC are low-level code for I/O, code to manipulate timers, and code to handle traps and interrupts. This was designed and implemented at this stage. Ajit worked on the UCC.

For the most part, the task-management algorithms could be used as they were from the I960. The challenges had to do not with the Ada tasking constructs, but with general handling of independent threads of control, such as how to do a context switch and handle interrupts. Since handling interrupts and doing context switches are very close to the hardware handling that is done by the UCC, Ajit also worked on this portion.

I worked on the design and implementation of the exception management. The general form and purpose of the algorithms did not have to be changed, but the low-level implementation involved a lot of architectural differences. This portion of the code was written in C. A C compiler for the AMD 29050 was available from Metaware, but there was no source-level debugger. An instruction set simulator provided the ability to run programs and to do machine-level debugging. It was possible to have the compiler generate mixed source and assembly listings, so this was used to relate the source code to the generated machine code for debugging. The lack of source-level debugging can be cumbersome, but with practice, the listings and machine-level debugging provided an adequate development environment. As a side benefit, I was forced to learn quite a bit about the machine language. This was helpful later when I did some work on portions of the code generator.

Cynthia continued working on linker issues and the other members of the team areas of code generation for additional constructs.

As part of the standard for Ada (Ada 83), a suite of tests called the Ada Compiler Validation Capability (ACVC) was defined. In order to be validated, a compiler and associated runtime must pass all the applicable tests of the ACVC for its environment. After the first deadline of being able to run "Hello World", subsequent deadlines of passing increasing percentages of ACVC tests were defined.

One defined deadline was to pass 80% of the non-tasking ACVC tests. When this deadline was met, the first release of the system was made to the users for the 777 team. Some groups were far from ready to begin coding at this stage, but others were ready to do some prototyping. One particular group led by Joel was especially anxious since he had heard rumors of Ada inefficiencies. Though many of the so-called inefficiencies can be met by turning off the default, language-defined runtime checks after initial development, the group was concerned. Immediately upon getting the first release of the compiler, they did an analysis of the output of the produced machine language. They concluded that the performance of the compiler was not good enough. In spite of the fact that we told them that the emphasis on this release was not on performance, and that subsequent releases would have much more optimization, they began to look for alternatives. They didn't really have much choice since Honeywell had committed to using Ada and there were not other compilers. They decided that for much of their code they would use Ada's machine code insertion mechanism. When this is done, the user essentially writes assembly language and the compiler merely assembles it. This would technically meet the mandate to write the code in Ada, but give the desired performance. After about the fourth release of the compiler, the HADS team revisited the original code from this team and found that the compiler generated much more efficient and smaller code than the "assembly" version. This is not surprising, and was shown to be true in a number of published studies. A high-level language compiler—and in particular an Ada compiler—can keep track of and take advantage of more global knowledge than a programmer can keep in his head. The compiler developers are also generally more knowledgeable of architecture features that can be used. The HADS team had to continually "sell" the product.

The project had one great piece of good luck related to the AMD 29050 processor, which was the existence of a very good and complete simulator. This meant that the team could develop and test while the actual hardware was in the early prototype phase. It turned out that any code that would run on the actual hardware would run on the simulator as well. There were only a couple of timing-related areas where code that was not legal on the actual hardware would run on the simulator. The simulator was a big factor in letting the team stay on schedule.

Though some deadlines were close, the HADS team met all deadlines on the way to producing a compiler that passed 100% of the ACVC tests. After meeting this goal, the work was far from done. For example, Ada defines and allows for a number of implementation-dependent features. These include things like the ability to precisely describe the layout of data structures such as records and arrays. Features appropriate for the AMD 29050 and for the 777 project needed to be implemented. Also, the promised optimizations needed to be added. Since the UCC portions of the project were finished, and the Ada tasking was working, Ajit left the project to work for one of the 777 project teams.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset