Page Numbers: Yes X: 527 Y: -.5" First Page: 124
Heading:
Dorado Hardware ManualEthernet Controller14 September 1981
Ethernet Controller
An Ethernet is the principal means of communication between a Dorado and the outside world. An Ethernet is a broadcast multi-access packet switched network which can connect up to 256 stations separated by as much as 1 kilometer with a 3 mHz channel. The ’Ether’ is a passive coaxial cable to which each station is connected through a transceiver that is high-impedance when receiving, low impedance when driving.
Readers unfamiliar with the general concepts behind the Ethernet should refer to "Ethernet: Distributed Packet Switching for Local Computer Networks," by R. M. Metcalfe and D. R. Boggs, CACM, 19(7):395-404, July 1976; or to Design and Performance of Local Computer Networks, by John Shoch, published by University Microfilms, August 1979.
Read this chapter with Figure 16 in view.
Ethernet Packets
Ethernet data are encoded in packets. Packets are preceded by a low signal (i.e., silence) on the Ether; they begin with a one-bit prefixed by the transmitter, called the start bit. Bits in the packet are phase encoded, where the bit cell time is nominally 340 ns; phase encoded signals have one data transition per bit cell and its direction (low-to-high = 1) is the value of the bit. Midway between these there may be a setup transition, so that the next data transition can be in the correct direction.
Packets end when no transitions are detected for more than 1.5 bit times and the Ether is low. Collisions are transmissions that overlap in time and cause malformed and undecodable bits. Transmitters jam the Ether with a continuous high for several bit times after participating in a collision. Collisions are of four types: too many transitions, in which two transitions occur within .25 bit times; too few transitions, in which a transition occurs between 1.25 and 1.5 bit times after the last one; end-of-packet (EOP), in which no transitions occur for more than 1.5 bit times and the Ether is low; and jam, which is the same as EOP except that the Ether is high.
In a well-formed packet that does not experience a collision, the start bit is immediately followed by an 8-bit destination host number, then an 8-bit source host number. This is followed by an indefinite number of 16-bit data words, a 16-bit checksum, and finally silence.
Even when transmitted without a source-detected collision, a packet may fail to reach its destination; packets are delivered only with high probability. Stations requiring a lower residual error rate must follow mutually agreed upon communication protocols.
When the sender of a packet detects a collision, some method is needed to arbitrate (without communication) its use of the Ether with other stations contending for it. The algorithm used on the Ethernet, called the ’binary exponential backoff collision algorithm,’ is discussed in the above references. It involves waiting a random interval and then reattempting transmission. The (ideal) distribution of the random intervals depends upon many factors.
Remarks
From the method of collision detection, it follows that in a noise free Ether with ideal transmitters and receivers, a bit cell time between 0.75*T and 1.25*T, where T is the nominal bit cell time (340 ns), can be decoded correctly.
Phase encoding has the undesirable property that only 50% of the transmission medium’s theoretical bandwidth is utilized. A number of reasonably simple encodings are known that more nearly approach the theoretical limit, though phase encoding is simple to implement. If at some time we were willing to abandon compatibility with the existing Ethernet, we should reconsider the use of phase encoding.
A promising alternative to phase encoding is bit-stuffing, which averages 67%, 86%, or 93% of theoretical bandwidth for 0th, 1st, and 2nd order codes. This encoding outputs data bits in a cell time equal to 1/2 of the phase-encoded cell time; when 1 (0th order), 2 (1st order), or 3 (2nd order) data bits have been output without a transition, then a non-data transition is inserted into the bit stream. The 1st order encoding (86%) could be implemented with a few changes to the current controller.
Controller Overview
The Ethernet controller is a slow IO device packaged with the disk controller on the DskEth logic board. These two devices require more edge pins than are available in an MSA-IO slot, so the board must be mounted in a Fast IO slot (see Figure 2).
It would be possible to package two Ethernet controllers on one logic board using different task and TIOA assignments for each. This might be appropriate if Dorados are ever used as Ethernet gateways.
A cable connects the controller to a transceiver outside the Dorado enclosure; this transceiver is almost identical to the ones used for Altos and other computers, the difference being that it uses +12 volts rather than +15. Dorado transceivers are painted bright red and have large block lettering saying "Dorado only". Plugging in the wrong type of transceiver will not damage anything; it just won’t work. The cable between the controller and the transceiver contains twisted-pair signals for receiver data, transmitter data, collision, +5 v, and +12 v.
The controller has independent transmitter and receiver sections. Because these two sections are completely independent, the Dorado can receive its own transmissions. This is an important aid in hardware and software debugging and simplifies the device driver, which need not check for sending to itself. Furthermore, the receiver can receive consecutive packets separated by the minimum inter-packet spacing (510 ns). This means that the Dorado can receive, without loss, streams of packets directed to it by mulitple hosts and packets that immediately follow broadcasts. This capability is important for servers and other high-performance applications.
The controller uses two tasks, one for the transmitter (EOT for Ethernet Output Task) and one for the receiver (EIT for Ethernet Input Task). The receiver task is higher priority. To permit two instruction/wakeup loops, a wakeup request is removed whenever the Next bus says the task is about to run. This simple strategy can be fooled into removing a request when NextLies occurs, but this is harmless since the required service rate is low. To avoid a spurious wakeup, a wakeup is not requested again until after the task has blocked. A debugging control bit can be set which prevents wakeups even when all other conditions are satisfied.
The transmitter and receiver each have 16-word x 20-bit Fifos. The bits are 16 data + 2 parity + 2 spare (the receiver uses one of the spare bits). Each Fifo has read and write pointers, multiplexed into the address inputs of the storage chips, to select the next location to be read or written; these pointers are zeroed by IOReset. A Fifo is empty when the pointers are equal and full when (WritePtr+1) mod 16 equals ReadPtr. There are bus registers between the Fifos and IOB. Service requests from the Ether side of a Fifo are given priority. The Fifos are synchronous to t1.
The basic clock for transmitting and receiving data from the Ether, called EtherClk, originates from a 23.5 MHz crystal oscillator (i.e., the period is 42.5 ns or 1/8 of the 340 ns bit cell time). The memory system’s Pendulum clock (period 16 ms) is also used to time retransmissions after a collision, as discussed later.
The receiver runs continually; its phase decoder (PD) samples the Ether every EtherClk; a finite state machine (FSM) driven by the samples detects the presence or absence of packets on the Ether, zero/one transitions, and collisions. Another FSM accumulates the status of the packet and controls a shift register that assembles 16-bit words from the incoming data. Words in the shift register are written into the receiver’s Fifo together with odd parity on each byte; the status is written into the Fifo after the last word of each packet and marked to distinguish it from data words. This allows the receiver to handle back-to-back packets; firmware decides what to do with each packet as it is read from the Fifo. EtherClk is used for receiver stages through the shift register; data in the shift register is synchronized to the Dorado system clock as it is written into the Fifo.
When the transmitter is turned on, it attempts to send one packet and then must be restarted by firmware. The EOT fills the Fifo; the transmitter FSM loads the shift register from the Fifo and supplies a serial bit stream to the phase encoder (PE). Transmitter status is read directly from the controller status registers (unlike receiver status, which travels through the data path). Data is synchronized to EtherClk between the output of the shift register and the input of the PE. A collision may be detected by either the transceiver or the PD. The occurrence of a collision is captured, synchronized, and used to abort the outgoing packet after jamming the Ether briefly.
The controller has a number of features to help debugging. All of the interesting internal state is available via the IOB and the muffler system. The transceiver can be disconnected and PE output internally connected to PD input under firmware control. Task wakeups can be disabled permitting the controller to be driven entirely from emulator-level software. The internal clock can be single-stepped. These features permit the construction of a simulation program which compares its predictions with what the controller is actually doing.
Receiver
Most of the receiver runs continuously, tracking traffic on the Ether. The PD reports what it sees to the receiver FSM, which assembles packets in the shift register and buffers them in the Fifo. As words emerge from the Fifo into the bus register, they are either discarded or generate a wakeup request under control of the wakeup logic. Following the last data word of each packet as it travels through the Fifo are the CRC word and a status word. IOAtten branches when a status word is present in the receiver bus register. Data and status are synchronized to the Dorado clock between the output of the shift register and the input of the Fifo.
The peculiar placement of status bits in Figure 16 eases emulation of the Alto Ethernet controller.
The PD is a FSM which takes in raw phase-encoded serial data and produces phase decoder events and carrier. Phase decoder events are ’saw a zero bit’, ’saw a one bit’, and ’saw a malformed bit’. Carrier indicates that the PD is seeing transitions on the Ether (i.e. the Ether is in use). Since the PD is completely digital, it can be single-stepped for debugging. Receiver collision detection, a by-product of this decoding technique, works as well as transceiver collision detection.
The receiver control is another FSM that takes in PD output and produces control and status signals. RxSRCtrl controls the shift register and the bit counter. The bit counter decrements when a data bit is shifted into the shift register and resets to -1 when the status is parallel loaded into the shift register. RxSRFull’ is low when the next shift will make the register full. RxEOP travels in parallel with each Fifo word and is true if the word is an ending status word. This bit is called EthData.18 when it is in the bus register where it can be tested with IOAtten.
Writing data or status from the shift register into the Fifo has priority over loading the bus register from the Fifo. Byte parity is computed at the shift register output and travels with the data through the Fifo and the bus register, down IOB and into the processor where it is checked.
The optimum point at which to synchronize received data with the Dorado clock system would be at the input to the PD, where there is only one signal to synchronize, except that this would make proper operation of the PD depend upon the Dorado clock period. The next best sync point is the PD output where the number of signals has only grown to three. The problem here is that the PD can produce events faster than they can be synchronized to the Dorado clock without buffering. Consequently, synchronization takes place after the shift register where the number of signals exceeds 20. This is not as unfortunate as it seems because status and data use the same paths and can share a single synchronizer, RxSRDump, which produces RxFifoWE’ each time RxFSM pulses RxSync’. This leaves only RxCollision and PDCarrier which must be synchronized for the transmitter. RxCollision shares a synchronizer with XcCollision, and PDCarrier’s is a simple level synchronizer.
A receiver data-late occurs when the receiver FSM requests a Fifo write and the Fifo is full. In this case the write does not happen and the data is lost. RxDataLate is cleared after an end-of-packet status word is successfully written into the Fifo. This status has the data late error bit set so that the EIT is notified that the preceding packet was bad.
EIT wakeup requests occur when the bus register contains an interesting word (provided that the EIT is currently blocked, as discussed earlier). Words are interesting if they emerge from the Fifo into the bus register while RxOn and RxBOP are true and NoWakeups is false. RxBOP is set after the status word for a packet is discarded, so that the next word out of the Fifo (presumably the first word of the next packet) can generate a wakeup. It is reset by the EIT to discard the remaining words of a rejected packet (usually because the address didn’t match). The receiver may be reset at any time by clearing RxOn. No more wakeups are generated and every word is discarded as it emerges from the Fifo. When RxOn is next set, the receiver will continue to discard words until it has discarded a status word. It will then set RxBOP, and the next word (first word of the first packet after turning on the receiver) will cause a wakeup.
Transmitter
When the transmitter is turned on, it attempts to send one packet and then must be restarted by firmware. At the request of the wakeup logic, the EOT fills the Fifo using Output←B to the bus register. The transmitter FSM loads the shift register from the Fifo and supplies a serial bit stream to the PE. Transmitter status is read directly from the controller status registers (unlike receiver status, which travels through the data path). Data is synchronized to the Ether clock between shift register output and PE input.
EOT wakeups occur when the bus register is empty, TxOn is true, and TxEOP, TxCntDwn, and NoWakeups are false (provided that EOT is blocked, as discussed earlier). After delivering the last word of a packet, EOT wakeups are disabled by setting TxEOP. While counting down a collision retransmission interval, firmware can disable wakeups until the next tick of Pendulum by setting TxCntDwn. The transmitter may be reset at any time by clearing TxOn, which stops wakeup requests and shuts down the PE within 2 bit times.
The binary exponential backoff collision algorithm must be implemented in firmware. The controller merely provides a way to generate a wakeup on the next rising edge of Pendulum, making the grain size of countdown intervals 16 ms for the Dorado (compared to 38 ms for Altos and Novas). Note that setting TxCntDwn prevents a wakeup; for one to actually occur when Pendulum clears it, the bus register must be empty and TxEOP must be false. Pendulum is considered to be a foreign signal so it is synchronized before being applied to the reset input of TxCntDwn.
Loading the shift register from the Fifo has priority over writing into the Fifo from the bus register. Byte parity is computed in the processor and travels with the data down IOB into the bus register, and through the Fifo to the shift register where it is checked.
The transmitter control is a FSM which takes in start, end, and abort signals and produces control signals. TxSRCtrl controls the shift register and bit counter. The bit counter decrements when a data bit is shifted into the shift register and resets to -1 when the next word is parallel loaded into the shift register. TxSREmpty’ is low when the next shift will make the register empty. TxData wire-or’s the start bit at the beginning of each packet. TxGone clears TxEOP to cause a wakeup at the end of each packet. The transmitter starts when the Fifo is full or, if the packet is less than 15 words long, when TxEOP is true. The transmitter ends normally when the Fifo is empty and TxEOP is true. The transmitter aborts when a collision, Fifo parity error or data late occurs. TxAbort can be tested with IOAtten.
A transmitter data late occurs when the TxFSM requests a Fifo read and the Fifo is empty but TxEOP is false. The PE sends one random bit and then stops. The resulting packet has an illegal length and probably a bad CRC.
The PE inverts and latches TxData at the start of each bit cell and inverts the latched value 1/2 bit time later. TxGo, synchronized to the beginning of a bit cell, enables the PE. The PE assumes that a data bit is available long before it is needed and acknowledges each bit after latching it by generating TxGotBit.
A collision may be detected by either the transceiver or PD. The occurrence of a collision is captured, synchronized, and used to abort the outgoing packet. The output of the first stage of the TxCollision synchronizer is wire-or’ed with PD output to jam the Ether after a collision. The jam lasts for one or two bit times, being the delay through the TxCollision synchronizer, TxFSM, and TxGo synchronizer.
Clocks
The controller needs a clock with a nominal frequency of eight times the Ether bit rate. The SingleStep control bit selects either the 23.53 mHz crystal oscillator or single Dorado clocks injected under program control. The clocks for the Ether-synchronous parts of the controller are constructed from this basic clock.
The slowest Dorado clock period at which the transmitter works is 42.5 ns. Disabling the Dorado system clocks while TxOn is true causes a transmitter data late. If TxGo is true, the packet is chopped off, causing an incomplete transmission and probably a runt bit. When the clock is reenabled, the PE sends a few fragmentary bits and then the data late aborts the packet.
The slowest Dorado clock period at which the receiver works is 85 ns. Disabling the Dorado system clocks causes a receiver data late. The next packet that arrives after the clock is reenabled reports the data late.
Task Wakeups
The controller is designed for two completely independent tasks, with the receiver higher priority. Two IOAs select data and status/control registers. IOAtten may be tested to decide whether a wakeup request is just for another word or something special (ending status for the receiver, or PE aborted for the transmitter).
Task wakeups must, on the average, be serviced within 5.44 ms. The transmitter and receiver each have 17 words of buffering (bus register + 15 Fifo + shift register) so the variance can be quite large—accumulated delay of up to about 90 ms is tolerable, while longer delay will cause a data late error.

Muffler Input
All muffled signals on the DskEth board are accessible to Dorado firmware. The method by which a particular signal is selected and read out is discussed in the "Muffler Input" section of the "Disk Controller" chapter. Signal addresses 1208 to 1778 for the Ethernet controller are enumerated below. Unless it is obvious, signals which are specific to the receiver or transmitter have Rx or Tx respectively somewhere in their names.
Table 26: Ethernet Muffler Signals
Word
Bit
NameMeaning
ERX0
120
PDNew1/8 bit time sample of PD input signal
121
PDOldPDNew delayed one sample time
122:125
PDCnt[0:3]Number of samples since last data transition
126
PDCntCtrlIncrements or clears PDCnt
127
ReportCollisionsControl register bit that enables PD collision reporting
130
RxBOP"Beginning Of Packet" enables receiver data wakeups
131
EthData.18Marks status word terminating a packet
132

133
RxCRCErrorOutput of receiver CRC checker
134
RxDataLateReceiver Fifo overflowed
135
RxBusRegFullWord in BusReg can be read with Pd←Input
136
RxFifoFullReceiver Fifo is full
137
RxFifoEmptyReceiver Fifo is empty
ETX
140:142
TxState[0:2]State of transmitter FSM
143
TxEOPTransmitter data wakeups are disabled
144
TxBusRegFull’Word is waiting to be written into the transmitter Fifo
145
TxGoneTransmitter FSM is shut down
146
TxSREmpty’Transmitter shift register is empty
147
TxCntDwn’Transmitter wakeups disabled until next pendulum clock
150
TxCRCEnblShift/compute control for transmitter CRC
151
TxGoEnable PE
152
TxDataSerial data input to PE
153:154
TxSRCtrl[0:1]Transmitter shift register control
155
PEOutputPhase Encoder (PE) output
156
TxFifoFullTransmitter Fifo is full
157
TxFifoEmptyTransmitter Fifo is empty
ERX1
160:162
RxState[0:2]State of receiver FSM
163
RxCollisionReceiver-detected collision
164
PDCarrierThe Ether is in use
165:166
PDEvent[0:1]PD output (no event, collision, 0, and 1)
167
RxSRFull’Receiver shift register is full
170
RxEOPMarks status word terminating a packet
171
RxSync’True for one cycle triggering write of SR into Fifo
172
RxIncTransReceiver incomplete transmission
173
RxCRCResetResets receiver CRC chip
174
RxCRCClkClocks receiver CRC ship
175
RxDataSerial data output from RxFSM
176:177
RxSRCtrl[0:1]Receiver shift register control
IOB Registers
TIOA equals 158 selects the IOB registers (called EthD). The transmitter bus register is loaded by Output←B and the receiver bus register is read with Pd←Input. At end-of-packet, after the last data word, the receiver delivers first the CRC word and then a status word containing the following bits:
RxCollisionReceiver-detected collision occurred (can happen only if ReportCollisions has been set in the control word).
RxDataLateReceiver data-late occurred—one or more words of the last packet were lost.
RxCRCErrorCRC was incorrect in last packet.
RxIncTransLast packet did not end on a word boundary.
Control Register
TIOA equals 168 selects either the (write-only) control register (EthC), discussed here, or the (read-only) status register (also called EthC), discussed in the next section. The control register has three fields: transmitter, receiver, and test. Bits in a field are decoded only if the command-enable bit for the field is true. Control bits with a single quote as their last character are true when zero.
TxCmdEnbl’enables decoding of transmitter commands.
TxOnenables the transmitter. The transmitter may be reset at any time by clearing this bit. Cleared by IOReset.
TxEOPdisables transmitter wakeups. EOT sets this bit after outputing the last word of a packet. It is cleared by the controller when the PE shuts down after an abort or normal end. Cleared by TxOn=0.
TxCntDwndisables transmitter wakeups. Set by EOT to time a retransmission interval after a collision; cleared by the controller when the next rising edge of Pendulum occurs (period = 16 ms). N.B. the binary exponential backoff is done by firmware. Cleared by TxOn=0.
RxCmdEnbl’enables decoding of receiver commands.
RxOnenables the receiver, which may be turned off at any time by clearing this bit. Cleared by IOReset.
RxBOP’disables receiver wakeups. Cleared by EIT to discard the currently arriving packet; set by the controller when the first word of the next packet is available. Cleared by RxOn=0.
TestCmdEnbl’enables decoding of test commands
LoopBackdisconnects the transceiver, loops PE output to PD input, and enables TestColl’. Cleared by IOReset.
SingleStepdisables the 23.53 mHz oscillator. Changing this bit can produce a runt clock. Reset the transmitter first and expect an occasional bad receiver status. Cleared by IOReset.
NoWakeupsdisables all controller wakeups. Cleared by IOReset.
TestClockinjects a single Dorado clock pulse (t3 of the Output instruction) into the EtherClk logic. SingleStep must already be set.
TestColl’injects a single Dorado clock pulse (t3 of the Output instruction) into the collision synchronizer. LoopBack must already be set.
TestDatawire ORs with PD input. LoopBack must already be set and TxOn must already be false. Do not issue TestClock in an instruction that changes TestData. Cleared by IOReset.
ReportCollisionsallows the PD to report malformed bits as collisions. Cleared by IOReset.
Status Register
TIOA of 168 also selects the (read-only) status register. The bits in this register are the most interesting to the microcode. Less interesting state is available from the mufflers.
Host Addrthe host address set by pullups on the backplane.
RxOnthe receiver is enabled.
TxOnthe transmitter is enabled.
LoopBackthe interface is looped back.
TxCollthe current output packet was aborted by a collision.
NoWakeupsall wakeups are disabled.
TxDataLatethe current output packet was aborted by a data late.
SingleStepthe 23.53 mHz oscillator is disabled.
TxFifoPEthe current output packet was aborted by a parity error.