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):ÿî]ïg¡pôjî ¶ïc8qî]rôXî-¤qî7Br î]ïa³î ¶ï]üqî]r î-¤qî7Brî ¶ïYqî]rî-¤q î7Brî]ïW�îüïSìsrî ·ïMÿð)î ·ïIrtî ·ïF�rô‚ð;ôƒð'î ·ïEô×ðHurôØ î ·ïCƒô™ðJôšî ·ïAþô€ð[î ·ï=qtôX î ·ï9¸uî ·ï6Órô…ð1ô†ð4î ·ï5Nô˜ô™ðLî ·ï3Éô¥ðPô¦î ·ï2DôÈð3ôÉð.î ·ï0¿ô€ ô�ð[î ·ï/:ô€î ·ï+�u î ·ï(œrô¢ðSô£ î ·ï'ô�ðLô�î ·ï%’ô¼ðWô½î ·ï$ ô€ð`î ·ï€tôXî ·ï›rô²ð]î ·ïô—ð4ô˜ð+î ·ï‘ô¢ð#ô£ð>î ·ï ô„ô…ðaî ·ï‡ô€ð8î ÀïÎu î Àïérô§ð;ô¨ð#î Àïdô€ÿtü=çZåùAlto-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):î ·ïfðrô€ð'îGïî­ïbô�ðAôŽî–ï`™ôºð4ô»î–ï_ô€î­ï\/ô�ðAôŽî–ïZªô�ðWî–ïY%ô€î­ïV@ôçðFôèî–ïT»ôÕð<ôÖî–ïS6ô€ðUî ÀïO}uî ÀïL˜rî¶ïJ†ð2î­ïIð(î­ïG|ð$î­ïE÷ðZî­ïDrð.î ÀïA�î­ï?5ð4uî ÀïÎrðdî ·ï=Ið(î ·ï:dî2ï7î£îî2ï5úî£îî2ï4uî£îð%î ·ï1�î2ï.«î­ï-&î­ï+¡î™îð"î­ï* î™îî­ï(— î™îî­ï' î™îî­ï%�î ·ï"¨u î ·ïÃrð]î ·ï>ð=î ·ïYî2ïtî( î2ïïî(î2ïjî(u rî£ïåð$î2ï`î( u rî£ïÛð(î2ïVî(ð&î£ï Ñð1î2ï 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ÿî ·ïfðrô€ð'îGïî2ïbî(ôXu rî2ï`™î(u rî2ï_î(î2ï]�î(î ·ïYÖuî ·ïVñrôÉð-ôÊð0î ·ïUlô¼ð8ô½ð$î ·ïSçô‰ð5u rð!ôŠî ·ïRbô€ð6î ·ïN©uôXî ·ïKÄrô˜ð!ô™ð@î ·ïJ?ô›ð'ôœð8î ·ïHºô•ðBô–ð"î ·ïG5ô¨ ô©ðQî ·ïE°ôŽð]ô�î ·ïD+ôŒð9ô�ð.î ·ïB¦ôºô»ðHî ·ïA!ô�ðBôžî ·ï?œô‘ð"ô’ð>î ·ï>ô¸ðIô¹uî ·ï<’rô€ î ·ï8Lpôjî ·ï4Lrô“ð@ô”ð"î ·ï2Çô€ð/î ·ï/î ·ï.Öþî Ëï/î Ëï.ÖþÇî ’ï/î ’ï.Öþ¥î7ï/î7ï.Öþ„î»ï/î»ï.Öþ¥î`ï/î`ï.ÖþoîÏï/îÏï.Öþcî2ï/î2ï.Öþ»îíï/îíï.ÖþÇî´ï.Öþ îÀï.Öþ@î2ï/î2ï.ÖþVî3Vï/î3Vï.Öþcî3¹ï/î3¹ï.Öþ›î4Tï/î4Tï.Öþ„î4Øï/î4Øï.Öþ»î5“ï/î5“ï.Öþ›î6.ï/î6.ï.Öþ°î6Þï/î6Þï.Öþ›î7yï/î7yï.Öþcî7Üï/î7Üï.Öþ¥î8�ï/î8�ï.Öþ„î ·ï+UôXî2î ·ï)Ðî `vôGî2rî ·ï(KôXî `vôGî2rî ·ï&ÆôXî `î ·ï%A î `vôGî2rî ·ï#¼ôX î `vî2rî ·ï"7 î `vôG î2rî=Sv î ·ï ²rôX î `vôG î2rî ·ï-ôX î `vôG î2rî ·ï¨ôX î `vî2rî ·ï# î `vôG î2rî ·ïžôX î `vôGî2r$ ·W=gM³ýAlto-1822 Interface, Software Interface6Microcode; Larry Stewart March 25, 1978 11:37 PM#AltoConsts23.mu;; Address definition for Emulator main loop in ROM$START $L004020,000000,000000 ; Start of emulator main loop; Task Specific Function Definitions$IREAD $L000000,070017,000100 ; F1-17Input data$IWRITE$L020016,000000,124000 ; F1-16Output data$IOCLR $L016015,000000,000000 ; F1-15Clear hardware output wakeup$IPOSTF$L016014,066014,000100 ; F1-14Post (gate status to bus)$ISWAKC$L024014,000000,000000 ; F2-14Clear SIO generated wakeup$IBRNCH$L024013,000000,000000 ; F2-134-way branch on wakeup$IIENBL$L024012,000000,000000 ; F2-12Start read (turn on RFNIB)$ISETCS$L024011,000000,000000 ; F2-11Set control functions from bus$IPTMOD$L024010,000000,000000 ; F2-102-way branch on throwaway mode;R (S) registers$ICBPTR$R76;Control Block Pointer$MTEMP $R25;Temporary storage$AC1 $R2;Emulator register$NWW $R4;Interrupt system reg; Task constants$ISDON $777;done$ISOVF $1377;buffer overflow (input only)$ISIBLZ$1777;block length zero (input only); Initialization for putting this code in the RAM, including ; 'silent boot' code!17,20,LOC0,IMLOOP,,,,,,,,,,,,,,;;Silent Boot code, branches to ROM immediatelyLOC0:SWMODE;:START;;Main loop. Task waits here when not processing anything.;IBRNCH gates two bits onto NEXT6 and NEXT7 ; 00 - Start input 01 - Set Control ; 10 - Output data wakup 10 - Input data wakeup; 4-way branch using NEXT6,NEXT7 (Caused by IBRNCH)%14,14,0,IISTRT,ICTST,IODATA,IIDATA;IMLOOP:T_ ICBPTR,IBRNCH;test wakeup conditionsL_ ISDON,:IISTRT;[IISTRT,ICTST,IODATA,IIDATA];Common Post routine ; Expects offset of post location in Tî ·ïfðrô€ð'îGïî ·ïa×pî ·ï^ÍwôØð(î ·ï[Ãî ·ïX¹ð2î ·ïU¯ð;î ·ïR¥ð$î ·ïO›ð%î.· î ·ïNð%î.· î ·ïL‘ð%î.·î ·ïK ð%î.·î ·ïI‡ð%î.·î ·ïHð%î.·î ·ïF}ð%î.·î ·ïDøð%î.·î ·ïCsð%î.·î ·ï@iî ·ï=_ î.·î ·ï;Ú î.·î ·ï:U î.·î ·ï8Ð î.·î ·ï5Æî ·ï2¼ î.·î ·ï17 î.·î ·ï/² î.·î ·ï,¨ð<î ·ï+#î ·ï)žxwî ·ï&”ð.î ·ï%î¾î¾ï#Šî ·ï €xð:î ·ïvwð+î ·ïñð+î ·ïlð7î ·ïbð3î ·ïÝxwð#î ·ïÓxwî¾î.·î¾ïNî.·î ·ïDxî ·ï ¿wð*‚ · xî ·ï#Ñð3î ·ï"Lî ·ï ÇðBî ·ïBðCî ·ï½ð!î ·ï³ð+î ·ï.xwî ·ï$ð-î ·ïŸxwî ·ï•ð,î ·ïxwî ·ï ð4à · ¿8‡[KáAlto-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ÿî ·ïfðrô€ð'îGïî ·ïbxwî ·ï_xwî¾ôØ î.· î¾ï]�î.·î¾ï\ î.·î ·ïZ…î¾î.·î¾ïY î.·î¾ïW{î.·î ·ïTqî¾ î.·î ·ïRìî¾î ·ïQgî¾î ·ïOâî¾î.·î ·ïLØî¾ î.·î ·ïKSî¾ î.·î ·ïHIî¾î.·î ·ïFÄî¾ð-î ·ïE?î¾ywî¾ïB5î.· î¾ï@°î ·ï?+î¾ î.·î ·ï=¦î¾ î ·ï:œî¾î.·î ·ï7’î¾ î.·î¾ï6 î.·î ·ï3xî ·ï/ùwð5î ·ï.tð?î ·ï,ïð%î ·ï)åð=î ·ï(`ð6î ·ï%Vð2î ·ï#Ñxwî ·ï"Lxwî ·ïBxwî¾ î.·î¾ï½î.· î¾ï8 î.·î¾ï³î.·î¾ï. î.·î¾ï©î.·î ·ïŸî¾î.·î¾ïî.·î ·ï•î¾î.·î ·ïî¾î.·î ·ï î¾î.· · :;w\Ð TIMESROMAN  TIMESROMAN TIMESROMAN LOGO TIMESROMAN  TIMESROMAN  HELVETICAGACHA GACHA  GACHA  ê$#'è-ÿÿj/0 .“0Þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ aiswspec.memoStewartUnknown