Inter-Office MemorandumToTaft, Boggs, HuntDateMarch 30, 1978Strollo, StewartFromLarry StewartLocationPalo AltoSubjectAlto-1822 InterfaceOrganizationSSLMicrocode & Emulator InterfaceXEROX Filed on: [Maxc1]AISwSpec.pressAbstractThe Alto-1822 interface is now substantially working. This memo describes what is hoped to be thefinal interface specification. The bit patterns used to control it are unlikely to change again.Naturally, the emulator interface depends on the 1822 microcode. Included here is the microcodewritten for the 1822 test program, which may provide a plausible base for other situations.General NotesHardware:The Alto-1822 interface is a processor bus device requiring a single Task. It is designed to conformto the requirements of BBN Report 1822. As such it is suitable for Arpanet or Packet Radio Netuse. The interface is a full duplex device with no buffering beyond 16 bit input and output shiftregisters. 1822 specifies a bit-by-bit handshaking protocol intended to allow interconnection ofmachines with different word lengths - data transfer may pause for essentially arbitrary intervals (i.e.seconds) between any two bits.Performance:The input and output data transfer sections of the interface are controlled by PROM based finitestate machines clocked by the Alto at 170 ns intervals. With zero delays at the IMP end the inputand output sections can each transfer a bit every six cycles - just under 1 Megabit per second.Actual transfer rates will be somewhat less. In loopback mode the throughput is about 680 Kb/s.Hardware - Microcode InterfaceControl of the hardware is accomplished through the emulator SIO instruction and various TaskSpecific F1's and F2's. The SIO/wakeup/branch logic is controlled by a PROM based finite statemachine. Included here is a rather low level description of what the various functions and SIO'sdo. It is recommended that the reader look at the next section, describing the emulator interface ofthe test microcode before starting off to write his own!SIO functions:The interface task wakeup logic responds to bits 5 and 6 of the Bus during execution of an SIO(Task 0 STARTF):]gpj c8q]rX-q7Br ]a ]q]r -q7Br Yq]r-q 7Br]WSsr M) Irt Fr;' EHur CJ A[ =qtX 9u 6r14 5NL 3P 2D3. 0 [ /: +u (rS 'L %W $ ` tX r] 4+ #>  a 8 u r;# dt=ZAlto-1822 Interface, Software Interface2SIO #3000 sets wakeup and arranges for the IBRNCH function to put '01' on NEXT[6-7].In the attached microcode, this operation is used to start the 'Control' microcode.This wakeup is cleared by ISWAKCSIO #2000 sets wakeup and arranges for the IBRNCH function to put '00' on NEXT[6-7].In the attached microcode, this operation is used to start the 'Start Input' microcode.This wakeup is cleared by ISWAKCSIO #1000 enables the output hardware in such a way that wakeup is set and theIBRNCH function will put '10' on NEXT[6-7]. In the attached microcode, thisoperation is used to start an output data transfer. This wakeup is cleared by IOCLR.Task Specific Functions:IBRNCH (F2-13):Gates two bits from the Control PROM to NEXT[6-7].'00' - caused by SIO #2000 'Input Start''01' - caused by SIO #3000 'Control''10' - caused by output hardware data request and (indirectly) by SIO #1000 'Output Start''11' - caused by input hardware data availableISWAKC (F2-14):Clears wakeups generated by SIO #2000 and SIO #3000 onlyIPOSTF (F1-14):Gates hardware status to the Bus.Bit 15: IMP Relay WAS off, it may still be off.Bit 16: IMP Ready Relay is OPEN (off)Bit 17: Host Ready flipflop is OFF (and so is the relay)Other bits are left as 1's.ISETCS (F2-11):Decodes the Bus to set and clear various controls in the interface.#000000 - Does nothing#000001 - Master Reset. Clears all wakeups, turns off all data transfers, but does not affectthe relay.#000002 - Set Last Word. Used after an IWRITE, this will set the 'LastWord' flipflop,causing 'LastHostBit' to be transmitted at the end of the current data word.#000003 - Try Clearing ImpWasDown. If the Imp is now READY, this will clear the'Imp Was Down' status bit. Otherwise it won't.#000004 - Turn on Hardware LoopBack#000005 - Turn off Hardware LoopBack#000006 - Turn on Host Ready Relay#000007 - Turn off Host Ready Relay#002000 - Turn on Discard Flipflop (see IPTMOD)#001000 - Turn off Discard FlipflopOther bit patterns are undefined.IPTMOD (F2-10):Gates the 'Discard' flipflop to NEXT[7]. In the attached microcode this operation is usedduring Packet Discard Mode to dispatch to a different section of input data transfermicrocode.IOCLR (F1-15): fr'GbA`4_\/AZWY%V@FT<S6U O}u LrJ2I(G|$EZDr. A?54u rd =I( :d272524u% 12.-&+"* ( ' % "u r] >= Y2t( 2(2j(u r$2`( u r(2V(& 12 L( =g\Alto-1822 Interface, Software Interface56turn on Host Ready relay7turn off Host Ready relay2000turn on packet throwaway mode1000turn off packet throwaway modePacket Throwaway Mode:By executing an SIO-set control function, the user may set the receiver hardware into "PacketThrowaway Mode". On each SIO-start receiver call (until the throwaway mode is cleared), themicrocode will read in a packet (i.e. until the next Last Imp Bit) and throw it away. Although it isnot used, the input buffer must have some space in it.Zero buffer length:On output, there is no longer any initialization microcode - the SIO reaches down into the outputfinite state machine and makes it think it was running already. The FSM then requests a normaloutput data wakeup to get the first word. Thus if the buffer size is zero, on that first wakeup themicrocode will conclude that transmission is done and return normal end status - without havingdone anything. On input, while a zero length buffer probably represents a programming error, themicrocode will return a bad status. If the receiver were actually started with a zero size buffer, thecondition would not be noticed until the first input data wakeup. At that time, the microcodewould have no choice but to throw away the input word and return a buffer overflow error - theentire packet would be messed up. With the current microcode, you can request input into a zerolength buffer, get an error status back, and restart the operation with a non-zero buffer withoutlosing data.Microcode timingA copy of the newest microcode is attached. The code uses one S register. I include here a tableof timing information. A '+' indicates a TASK.OperationMicrocyclesEmulator control/status call15Emulator input request(Buffer length zero)17Emulator input request(Buffer length non-zero)12Emulator output request 0Input wakeup(Buffer Overflow)20Input wakeup(Normal)18Input wakeup(Last word)18+10(wierd kludge)Input wakeup(Normal throwaway)13Input wakeup(Last throwaway)13+10Output wakeup(Normal)18Output wakeup(Last word)18Output wakeup(Normal end)19 fr'G2b(Xu r2`(u r2_(2]( Yu Vr-0 Ul8$ S5u r! Rb6 NuX Kr!@ J?'8 HB" G5 Q E] D+9. BH A!B ?"> >Iu #3 "L B BC ! + .xw $- xw , xw 4 8[KAlto-1822 Interface, Software Interface8%4,4,0,IIFINS,IIDPST;IIDATA:MAR_ L_ 2+T;Start fetchMTEMP_ L,IPTMOD;save cb ptr,test modeT_ MD;get pointer [IIACPT,IIDISC]IIACPT:L_ MD-T;past end of buffer?MAR_ T,SH=0;start data fetchL_ ONE+T,:IIDMOR;[IIDMOR,IIDFUL]IIDMOR:MD_ IREAD;Read and branch on last word. ;Except on the last word, this ;clears the wakeupIICLNU:MAR_ MTEMP,:IIDCON;[IIDCON,IIDLST]IIDCON:IIENBL,TASK;enable receiverIDCON:MD_ M,:IMLOOP;update ptr,restartIIDLST:TASK;this TASK only works ;because the hardware doesn't really clear the ;wakeup until the next IREAD in this caseMD_ M;update pointerL_ ISDON;IIDPST:SINK_ IREAD;clear wakeup (again)IIFINS:T_ 10,:IPOST;IIDISC:L_ T, T_ IREAD,:IICLNU;throwaway word,branch if lastIIDFUL:SINK_ IREAD;overflow statusL_ ISOVF,:IIFINS;[IIFINS,IIDPST];Main output loop;IWRITE loads the output shift register from the bus, ; clears the (hardware generated) wakeup if there was one, ; and starts the output hardware;IOCLR resets the output hardware. This is how you clear the ; wakeups without restarting the output hardware; 2-way branches using NEXT9 (both caused by SH=0)!1,2,IODMOR,IODEND;!1,2,IONLST,IOLST;IODATA:MAR_ L_ 4+T;start pointer fetchMTEMP_ L;save cb ptrT_ MD,IOCLR;get pointer, clear wakeupL_ MD-T;past end of buffer?MAR_ T,SH=0;start data fetchL_ M-1,:IODMOR;[IODMOR,IODEND]IODMOR:IWRITE_ MD,SH=0;send data,last?MAR_ MTEMP,:IONLST;start update [IONLST,IOLST]IOLST:SINK_ 2,ISETCS;set last word functionIONLST:L_ ONE+T,TASK,:IDCON;finishIODEND:T_ 11+1,:INEND;offset of post loc fr'G bxw _xw . ].\ . Z.Y .W{. Tq . R Qg O. L . KS . HI. F- E?ywB5. @ ?+ . = :. 7 .6 . 3x /w5 .t? ,% )= (`6 %V2 #xw "Lxw Bxw .. 8 ... .. .. . . . :;w\ TIMESROMAN  TIMESROMAN TIMESROMAN LOGO TIMESROMAN  TIMESROMAN  HELVETICAGACHA GACHA  GACHA  $#'-j/0 .0 aiswspec.memoStewartUnknown