(This page represents work in progress, and is itself under construction.  Don't rely on it very much yet!)

Contents

Background

As explained on the Saturn Launch Vehicle Digital Computer (LVDC) page, the LVDC was the digital computer that guided Apollo's Saturn rockets, while other types of computers (principally the Apollo Guidance Computer, or AGC for short) guided the Command Module and Lunar Module.  An extensive collection of AGC software survives, for many of the Apollo missions.  However, only a tiny amount of LVDC software has become available to us:  namely, one LVDC flight program for a proposed but unflown mission known as AS206-RAM.  But also, we have the software for something called the PTC ADAPT Self-Test Program ... which for brevity we refer to as the PAST program.  The PAST program is the focus of this particular page.

The Programmable Test Controller (PTC) was test equipment which contained a slightly-modified LVDC CPU and whose purpose was to test the CPU design as well as to provide debugging capabilities for the software.  The PAST program itself, meanwhile, was software that ran on the PTC and consisted primarily of such test procedures.  Thus while from the viewpoint of the Apollo era the PTC's CPU was not precisely an LVDC CPU, and the PAST program was not precisely LVDC software, from a viewpoint 55 years later (when I'm writing this), it's much more convenient to think of the PTC is as being an LVDC and the PAST program as being LVDC software.

The reason this is significant is that while the Virtual AGC Project is excited to be able to provide LVDC software publicly (to the extent that the U.S. regulatory environment allows us to do so), the main purpose is to provide working software emulations of the original Apollo-era flight computers, including the LVDC, which are capable of accurately running that original flight software.  The existence of the original PAST program — even more so that the existence of the original flight programs — advances this goal by helping us to validate the software emulation of the CPU.  That's because successfully running a test program in the emulator gives us much more confidence that the emulation works properly than merely running a flight program would.  After all, even though a flight program may run, how could we be fully confident that it runs correctly?  Whereas the PAST program provides its own pass/fail criteria for correctness, so successfully running the PAST program according to its own internal criteria is a pretty decisive judgement on the correctness of the emulator as well.

In terms of emulating the PTC, what this means is that we distinguish between emulation of the PTC's CPU and the remainder of the PTC — i.e., its front panel and other support electronics.  The same dichotomy exists between emulating the LVDC as a CPU, and emulating its "peripherals", such as the LVDC Manual Exerciser (LVDCME, which is like the PTC's front panel but specialized for use with a true LVDC) or the Saturn rocket.

The only available PTC documentation does not necessarily answer all the questions one has in terms of creating the PTC emulation, although in some limited respects the LVDCME documentation can fill in some of those gaps, due to the great similarity between the two.

One-Time Setup

The PTC emulator comprises two programs that run on your local computer:  the LVDC/PTC CPU emulator and the PTC front-panel emulator.  The former is a program which typically has to be built from its source code before being run on your computer, while the latter is a program that is written in the Python language and does not need to be built but does require that Python 3 be installed on your computer.  You should consult the LVDC page for instructions as to how to acquire/build the CPU-emulation software.

Additionally, the source code of the PAST program itself needs to be "assembled" into an executable form which can be used by the emulator.  You can either do this yourself with the instructions on the LVDC page, or else you can use the pre-built version of it that's already available in our software repository.  In the discussion that follows, we'll assume the latter since it's automatic without you making any additional effort, but you can adapt the instructions if you choose the former.

The net result of all this is that somewhere on your local computer, depending on your choices above, you'll find a folder called "yaLVDC", in which you'll find these files:

Starting Up the PTC Emulation

Assuming you've successfully performed the one-time setup from the preceding section, you can run the emulations like so:
  1. Open up two separate command-line prompts.
  2. At each of the command-line prompts, 'cd' to the yaLVDC folder described in the preceding section.
  3. At one of the command lines, execute this command:  "./yaLVDC --ptc --cold-start --run --assembly=PROGRAM".  This starts the LVDC/PTC CPU emulation running the PROGRAM program.  For the sake of discussion, let's suppose that PROGRAM is "PROC9".  The specific program to run depends on which particular set of test procedures you want to try, but PROC9 (the PTC Self-Test Program) is the one for test procedure 9, and by far the most-comprehensive test.  Later on, there will be a table that lists the specific PROGRAM for each test procedure.
  4. At this point, the PROGRAM is just running freely in the emulated CPU, without any input from the PTC front panel.  Don't do anything additionally at this command line (such as hitting a keyboard key), since that would pause the emulation and give you access instead to yaLVDC's native LVDC/PTC debugger.  If that happens accidentally, just type the command PANEL or CONTINUE into yaLVDC's native debugger to resume the emulation.
  5. At the second command line, execute this command:  "./yaPTC.py".  This starts the PTC front-panel emulation.
These two programs talk to each other using what I call "virtual wire".  That's a networking system in which yaLVDC is a "server" and yaPTC.py is its client.  By default, the assumptions of this system are appropriate for the case of yaLVDC and yaPTC.py running on the same computer as our instructions have implied, but there's nothing to stop you from running them on two entirely separate computers if you find it convenient to do so.  Hopefully, a message will appear that says:
Connected.
At any rate, once started, yaPTC's simulated control panel should then appear, and it will look something like the screenshot to the right (click to enlarge).

The interface is graphical, so further interaction with the emulation involves observing whether the emulated indicator lamps turn on or off, clicking on controls representing pushbuttons or toggle switches, etc. All of the numerous black or white rectangular boxes you see in the screenshot are indicator lamps which are white when lit or black when not lit.  Some of them, additionally are either momentary or latching pushbuttons that can click with a mouse.

For instance, consider the PROG ERR indicator, located approximately midway down at the far right of the interface.  It lights up under control of the PAST program, after the program has found an error when running its self-tests.  But once the PROG ERR lamp lights, the PTC CPU (and hence the PAST program) has no programmatic way to turn the lamp off.  Instead, the PROG ERR indicator is a momentary pushbutton in addition to being an indicator lamp; originally, to reset the PROG ERR lamp (i.e., turn it black), you were supposed to physically press the PROG ERR pushbutton.  In the case of the emulation, that means you instead mouse-click PROG ERR on the emulated panel.

Both yaLVDC and yaPTC.py have a few additional command-line options that could prove to be of use sometimes.  Those for yaLVDC are described on the LVDC page, while those for yaPTC.py are:

Familiarization

Before getting into the details of how to work with the PAST program's test procedures in the emulation, you may want to have a little familiarity with the PTC's physical layout.  I suppose, in theory, that you could run the self tests entirely from yaLVDC's native debugger without using the PTC's panels and other peripheral devices, but the test procedures are not written in a way that facilitates that, so it would be much harder to do so.  And it wouldn't be as fun.

The photo to the left gives you an overview of some of the portions of the PTC main console used in the emulation.  The Tape Reader and Mode Control Panel, though shown, isn't actually needed by the emulation, since the software is loaded from yaLVDC's command line rather than from a tape drive.  The Tape Reader, by the way, accepted a punched tape, not a magnetic tape.  One of the test procedures refers specifically to a short paper tape, although perhaps longer mylar tapes may have been used when the PAST program was read. 

On the other hand, among the items truly needed by the emulation, the C. E. Panel apparently hadn't been installed when the photograph was taken, so our handy caption just points to an empty space.  How the C. E. panel fits into the indicated space in the PTC cabinet isn't clear to me, but that's life!  Hopefully the photo gives you an idea of the general layout, in spite of its deficiencies.

We do know that the printer (photo to the right) was an IBM 1443, and that the plotter was a Calcomp 565.

The PTC's typewriter peripheral isn't depicted in any photos I've found, nor have I been able to determine its model number.  It printed stuff and had a keyboard, so what more is there to know about its visual appearance, really?  I would hazard a guess that it was a modified IBM Selectric Typewriter, for whatever an uninformed guess from me is worth.

To run the test procedures in the PAST program, the principal PTC interfaces you have to interact with are the three control panels, which are obviously a bit too small to see in the photo above, so below you'll find a more-detailed representation of those.  Clicking on any of them should give you enlarged view.  Not everything you see is reproduced in the emulation precisely as-is, because not all of it is relevant to emulation of the PTC's CPU or running the PAST program's self-test procedures.  For example, the emulated PTC has no power supplies, so emulating the Power Control area of the Processor Display Panel (bottom of far-right image) would be rather pointless.





Now, the purposes of all the various controls on these panels may not be obvious to you at first glance, nor is the original PTC documentation very forthcoming about how many of them work.  At least, they were not obvious to me.  But I'm nevertheless going to resist the temptation of providing a detailed writeup of the individual controls here, because such a description would be even too dry and unreadable even for me ... which as you can tell from the remainder of this website would have to be pretty darn dry and unreadable indeed!  And I know this for certain, because I started adding such a writeup, and found I had to remove it immediately afterward in order to retain any semblance of sanity.  If there's a clamor for such descriptions in the future, I'll try again later to add something helpful along those lines.

A couple of brief remarks may be worthwhile, though.  On the center panel, normally abbreviated as MLDD, you'll notice that many of the controls appear in pairs, half labeled COMPUTER and the other half labeled COMMAND.  The former are indicator lamps directly reporting the status of the CPU while the latter are combination lamps/pushbuttons which the technician operating the test panel used to configure settings.  For example, in the topmost area of the MLDD, the INSTRUCTION address area, the COMPUTER lamps tell you the current instruction address at which the CPU is paused, while the COMMAND pushbuttons allow you to select a probably-different address, which could subsequently be used as a breakpoint.  On the left-hand panel, normally abbreviated as CE — and no, I've found no explanation anywhere of what "C. E." stands for — you'll see an ACCUMULATOR area, which for some reason has 58 indicators even though the ACC register as we know it from all of the earlier discussion on this page, has only 26 bits.  Or at most 28, if you include parity bits.  The answer appears to be that while the 26 (28) bits are all you can access from software, internally to the CPU, the accumulator has many more bits, all of which are visible from the PTC front panel.

Performing the Test Procedures

At any rate, the test procedures described here are derived from chapter V of the PTC documentation

The first few calibration procedures and test procedures covered there are of no particular use to us, since they relate to irrelevant hardware characteristics of the PTC itself rather than to its CPU or software.  For example, the PTC had physical power-supply circuitry which needed to be adjusted and checked for proper voltage levels.  The emulated PTC has no such thing, and therefore obviously requires no calibration or checks.   Moreover, various of the test procedures require loading specific test programs into the PTC CPU, and since we don't have the code for most of those test programs, the associated test procedures are only partially useful. 

With those thoughts in mind, here's a brief summary of how this affects the utility of the test procedures available in the PTC documentation.  Also, to save the trouble of poring through the original PTC documentation, I've cloned the relevant test procedures into a more-convenient form, correcting typos where I saw fit, and providing my own comments as to how the instructions have to be interpreted in order to use them in our emulation.

As mentioned earlier, one of the things you have to do to run the test procedures on the emulated CPU is to start the emulated CPU using the command "./yaLVDC --ptc --cold-start --run --assembly=PROGRAM", and I promised that the specific value of PROGRAM would be given later; that's one of the things in the table below.  The PAST program itself is used in only one of the procedures, procedure #9.

Test Procedure #
Title
PTC Documentation Figure
Required Program Load
Assessment of Utility
Link to the Corrected Test Procedure
Comment
1
Power Checks 7-2
(none)
Useless; relates to non-emulated hardware. n/a

2
Timing Adjustments
7-3
(none)
Useless; relates to non-emulated hardware. n/a

3
Tape Reader Controls and PTC and Printer Timing Checks
7-5
(none)
Useless; relates to non-emulated hardware. n/a

4
Memory Loader Automatic Checks
7-6
(none)
Useless; relates to non-emulated hardware. n/a

5
Memory Loader Manual Checks 7-7
tape p/n 6001247
PROGRAM=PROC5-7
Partially useful.
Procedure
We don't actually have a program listing for the test software from the original tape, or any documentation for that program.  The test program specified is one that I intend to write myself, though I have not yet done so.  Test procedure #5 seems to work fine if the program PROC9 is used instead; procedures 6-8, however, will fail if that is done.
6
Data Display Checks 7-8
tape p/n 6001247
PROGRAM=PROC5-7
TBD
TBD
See the comment above.
7
Central Processor Manual Checks 7-9
tape p/n 6001247
PROGRAM=PROC5-7
TBD
TBD
See the comment above.
8
Central Processor Memory Automatic Check 7-10
tape p/n 6001232
PROGRAM=PROC8
TBD
TBD
See the comment above.
9
Self-Test Program Checks 7-11 tape p/n 6001236
PROGRAM=PROC9
The test procedure is 100% useful. TBD
The PROC9 program is essentially the PAST program.  However, there's a handful of steps in the test procedure that I have simply been unable to comprehend, after much effort in attempting to do so.  For those few steps, the corresponding lines of code in the software have been commented out and replaced by an equal number of instructions which have no effect, thus preserving memory addresses but bypassing the failing steps.




This page is available under the Creative Commons No Rights Reserved License
Last modified by Ronald Burkey on 2020-07-06.

Virtual AGC is hosted
              by ibiblio.org