Monday, January 23, 2023

Separated disk side logic from the memory, cartridge image and user interface logic

ISOLATED DISK ORIENTED LOGIC

I pulled apart the logic that pertains to the IBM 1130 disk drive. This section will respond to the control signals from the disk controller inside the IBM 1130, those that cause arm movement, activate reads or writes and transfer data. These are cleanly isolated from all the remaining logic of the Virtual 2315 Cartridge system. 

The interface is three control signals, a word address, a cylinder address, a sector address and two data signals. We can request a read, request a write, and see a response that the transfer requested is complete. We have a word to output and the word read as the two data signals. 

The word address is just the relative word number of the 321 in this sector. Only one other item is needed for full addressing of a data word from the cartridge image and that is the head number. Our platter has two sides, with a head riding on each one. None of the logic in the disk oriented section is involved with the head number, thus it is not handled here. 

In this logic there are four major sections:

  • Model the current sector based on the incoming Sector and Index marks from the physical drive
  • Model the bit position inside a sector based on the rotation of the actual disk drive
  • Produce clock and data bits for the read head to detect based on the word fetched from memory
  • Extract words from the clock and data pulses sent to the write head, saving them in memory

The format of a sector, starting with the trailing edge of the sector mark, is delineated into the Zero, Sync and Words areas, with 321 words written sequentially in the Words area. These are all positioned exactly in time where they would occur with the disk platter rotating in the physical drive. 

The Zero area is a steady stream of zero value bit cells written for 250 microseconds. This ensures that the receive circuitry can separate the clock and the data value bits. Each bit cell is divided into two 720 nanosecond intervals, the first always has a pulse to indicate the clock. The second of each cell has a pulse if the bit value is 1 but there is an absence of a pulse to signify a bit value of 0. Thus the zeros are send with a pulse in the first 720 ns and no pulse for the second 720ns. The detection circuitry locks on the pulses as clocks since there are no data value pulses during the Zero area.

The next word is 20 bits long, a single bit value of 1 followed by 19 0 bits. This is the word that lets the receiving circuitry know how to separate the long string of bits into words, since the initial 1 indicates the boundaries for words going forward. 

The remainder of the disk sector is 321 words long, each word being 20 sequential bits. The IBM 1130 word size is 16 bits, but for disk an additional four bits of error detection code is appended. When reading a word, the parity of the sequence of twenty bits is tested to detect if an error was encountered rendering the word just read corrupt. 

VERIFICATION ACTIVITIES

I set up a testbench for simulation which produces the control signals that we would expect to come in from the physical disk drive. First among them are the pulses from Sector and Index marks which show us when the platter has reached certain points in its rotation. As well, we see a signal produced when the disk is up to speed and the drive believes the heads are loaded down to fly just above the platter surface. 

Using these, the logic will produce the sector number that is passing under the head, switching as the Sector marks are encountered. Out logical cartridge has four sectors dividing up one rotation, although physically there are eight sector marks around the circumference. Our logic ignores every odd sector mark and thus mirrors the way the disk controller logic generates the sector number shared with the IBM 1130 computer. 

Knowing the rotational speed of the drive, 1500 RPM, the length of a sector in time can be calculated. It is 10 milliseconds, since one rotation takes 40 milliseconds at this speed. During each sector we divide up the time into 1.44 microsecond bit cells, giving us 6, 944 full bit cell positions. Our sync word plus 321 data words require 6,440 bit cells, the rest is the Zero area at the front and safety padding at the rear.

The specification for the controller requires it to produce zero bits for 250 microseconds, twenty bits of a sync word and 321 words of 20 bits each. The bit cell is 1.44 microseconds long, thus this sequence consumes 9,524 microseconds for the sector. Adding in the 250 us of the Zero area means that 9,774 microseconds are needed to write the full sector, and we have 226 us of safety time before the next sector begins. 

If the disk is rotating more than 1,534 RPM our padding will be consumed and our last word runs into the start of the next sector. The physical drive circuitry controls the rotational speed, which is enough inertia to smooth out short term fluctuations and allows a servo mechanism to provide good control. If for some reason the speed rises above the threshold of an error or falls too far below the target, the heads are pulled off the drive, an error is signaled and the drive must be cycled to restart operations. 

My testbench is used to generate sector and index marks including at slightly varied speeds to ensure we can generate all the bit cells to read a full sector reliably. My first testing is only generating the pulses to be fed into the read head circuitry. Later I will model the CPU controller sending the clock pulses and data bit signals produced while doing a write to a sector, ensuring I properly capture each written word of a sector and pass it over the interface to be written to memory. 

I am in the midst of verifying the timing of every pulse produced by the logic, ensuring that the Zero area is the right length, the bit cells are the proper duration, and then that the Sync and Word area words are properly emitted. 

No comments:

Post a Comment