Monday, March 10, 2025

Set up instrumented version of Virtual 2315 Cartridge Facility for further virtual mode testing

BUILT FPGA BITSTREAM USING ICECUBE2 TOOLCHAIN AND COMPILED PICO CODE

I used a Raspberry Pi to compile the Pico code and the Icecube2 software on a laptop to build the bitstream. These are versions that will display enough information for me to be certain what cylinder, head and sector is being attempted. 

LOADED THE UNITS WITH THE NEW CODE

Inserting a RPi PICO into a USB connection while holding down the BOOTSEL button opens a disk folder on the laptop. I simply copy the proper load file from the compilation and the PICO is updated.

Using the Lattice Diamond software and its programmer hardware plugged into the JTAG port on the Virtual 2315 Cartridge Facility (V2315CF), I uploaded the bitstream into the flash PROM so that the FPGA will boot up with the new version of the logic.

However, the logging did not take place. I will be debugging this further although it is only a secondary priority. 

USB SERIAL CABLE CONNECTED TO DEBUG PORT PINS ON V2315CF BOX

A debug port on the back will steam out diagnostic information at 460800 baud over a USB serial cable to the Putty terminal program running on my laptop. This will let me view the key diagnostic information including the new data giving cylinder, head and sector information for every disk access from the IBM 1130. 

Using Hexedit, I looked at the contents of the virtual disk drive file from the IBM 1130 simulator that I used to create my virtual cartridge file on the microSD card. I noted the contents of several key sectors that I will be reading and updating with the V2315CF as part of my testing. 

RUNNING A SERIES OF SEEK COMMANDS TO ENSURE PROPER BEHAVIOR

I set up the interrupt routine so that it would display and clear the disk DSW sense bits and exit the interrupt level. This way I can set up the code to test things using wait instructions after the XIO (eXecute Input Output) instructions as a way to cut down on the work spinning the 1130 mode dial, flipping toggle switches to set addresses and pushing Run to single step through each test instruction. 

With command logging active on the debug console, I performed a seek of 3 cylinders going forward from the home (cylinder 0) position. That was converted into a forward move of 20 mils and a second forward move of 10 mils once the first is complete. The disk drive only moves 1 or 2 steps at a time, while the controller takes a relative cylinder count and converts it to a string of 2 step moves plus a final 1 step if the count is odd. The XIO type Control specifies direction and count. 

I saw the two seeks at the V2315CF box but due to lack of instrumentation didn't directly see the final cylinder address set at 3. I then performed three backward seeks of 1 cylinder, which would iteratively perform 10 mil reverse movements resulting in the Home bit turning on in the DSW sense bits only after the final one. 

Next, I executed a maximum seek distance of 202 cylinders forward. The Seek lamp was on for several seconds, longer than the time it takes to perform 101 seeks of 15 millisecond duration each. 

A reverse seek of 201 cylinders took about as long, involve a final 10 mil step, and brought us back to cylinder 1 so that Home is still not set. Then I performed a 1 cylinder seek that ended with the arm at Home. The controller handled that as a 20 mil (2 step) seek since it doesn't know the current address, but the V2315CF should 'mechanically' stop at cylinder 0 and report Home. 

Seeking appears completely satisfactory. That will wrap up the detailed testing of seek functionality. 

RUNNING SOME INITIATE READ COMMANDS TO VERIFY THE DATA READ

The disk drive uses XIO Initiate Read commands to read a specific sector at the cylinder where the head is currently situation. In the command we specify which of the two heads to use and which of the four sectors on that side of the disk we want to read. We point at an I/O buffer whose first word is the count (321) of words to read for the sector. 

I started with the Home position and read head 0, sector 0 to compare it to the known pattern from the virtual disk image file. The sector data should look like this:

0000 
0658 
0658 
0658 
1234
. . . .

What I saw was with the two halfwords flipped:

0000 
5806 
5806 
5806 
3412

. . . .

Next I read head 1, sector 0 and compare the data pattern which should be:

0004
009B
0000
00AB
. . . .

Once again, the two halfwords were flipped. 

0400
9B00
0000
AB00
. . . .

There is a sector I have previously examined at cylinder 10, head 1, sector 2 which I reached by first performing a seek forward by 10, then did a read of head 1 sector 2. The data should be:

0056
6124
6D00
7800
C0F3
4C20
. . . .
C00B
4C20

My data is not flipped completely, as each halfword is in the correct bit order, they are just interchanged. I did this in the conversion program I wrote to produce cartridge images for the V2315CF from disk images used with all the IBM 1130 simulator programs. I fixed the utility programs so this will be corrected when I next read or write data. 


No comments:

Post a Comment