D0MIDAS MANUAL3 January 1980byEdward R. FialaXerox Palo Alto Research Center3333 Coyote Hill Rd.Palo Alto, CA. 94304Filed on: [Ivy]D0Midas.PressSources on: [Ivy]D0MidasManual.DmThis manual describes a largely machine-independent loader/debugger for microprocessors originally developedfor the Maxc2 computer and since used for the Dorado, D0, and M68 microprocessors. This manual isspecialized for the D0 version of Midas.This manual is the property of Xerox Corporation and is to be used solely for evaluative purposes. No partthereof may be reproduced, stored in a retrieval system, transmited, disseminated, or disclosed to others in anyform or by any means without prior written permission of Xerox.(~Jp [E( %>&q )J9 r$15U/"j-")+y$s$y#$+yHb y Uy(y~by!Oy?y8cKabD0 Midas ManualEdward R. Fiala3 January 19802TABLE OF CONTENTS l.Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.Storage Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.Starting and Exiting from Midas . . . . . . . . . . . . . . . . . . . . . 4 4.Midas Display and the Mouse . . . . . . . . . . . . . . . . . . . . . . 5 5.Name-Value Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6.Command Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7.Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 8.Command Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 9.Syntax of Command-file Actions . . . . . . . . . . . . . . . . . . . .1310.Registers and Memories Known to Midas . . . . . . . . . . . . . .1511.The IM Memory and Virtual Addresses . . . . . . . . . . . . . . .1612.Registers and Memories that Contain Microinstructions . . . .1713.Task-Specific Registers . . . . . . . . . . . . . . . . . . . . . . . . . . .1814.Memory System Registers and Memories . . . . . . . . . . . . . .1915.Loading Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1916.Dump and Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2017.Break, UnBreak, ClrAddedBPs, ClrAllBPs, and ShowBPs . . .2118.Go, SS, and Continue . . . . . . . . . . . . . . . . . . . . . . . . . . . .2119.When Registers Are Read/Written--Restrictions on Continuing . . . . . . . . . . . . . . . . . . . . . . . . .2220.Hardware Failure Reporting . . . . . . . . . . . . . . . . . . . . . . . .2321.Testing Directly From Midas . . . . . . . . . . . . . . . . . . . . . . .2322.Command Files Used With "Read-Cmds" . . . . . . . . . . . . . .26LIST OF TABLESTable l:Command Menu Actions . . . . . . . . . . . . . . . . . . . . . 8Table 2:Command File Name-Value Actions . . . . . . . . . . . . .12Table 3:Command File Command Actions . . . . . . . . . . . . . . .13Table 4:Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15Table 5:Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15Table 6:Test Data Pattern Actions . . . . . . . . . . . . . . . . . . . . .24Table 7:Test Items in the Name-Value Display . . . . . . . . . . . .24Table 8:Command Files . . . . . . . . . . . . . . . . . . . . . . . . . . . .26Figure l:Midas Display fu!q4] HYfu ^t[q R;Y L;W I;V! G;TV J;R L;P R;N M;M, F;Ka A;I A;G =;F M;D7 @;Bl N;@ J;> 9;=  L;;A ! 9L;7 J;6 I;4: ?;#/!t +q>;*9;(=:;&sH;$K;"C;!<;HE;   2N%D0 Midas ManualEdward R. Fiala3 January 19803l. IntroductionMidas is a loader/debugger that runs on an Alto and controls its target machine remotely. It canload/dump microprograms assembled by Micro, examine and modify storage, and test hardware inseveral ways. Versions exist for Maxc2, Dorado, D0, and M68 microprocessors.Midas is coded about 95% in Bcpl and 5% in assembly language. The Maxc2 version wasimplemented by E. R. Fiala and H. E. Sturgis. The Dorado, D0, and M68 versions consist ofmachine-independent modules implemented by E. Fiala (Overlay and LoadRAM packagesimplemented by L. Deutsch and Alto microcode by E. Taft are also used) and machine-dependentsections implemented by E. Fiala for Dorado; D. Swinehart and P. Baudelaire for M68; and D.Charnley, C. Thacker, B. Rosen, C. Hankins, and E. Fiala for D0.An internal description of Midas is available to anyone interested in adapting Midas to a newhardware system (see [Ivy]MidasInternal.Press).2. Storage RequirementsMidas requires about 500 Alto disk pages, using the following files:Midas.Run~350 pagesMidas.Syms ~40 pagesMidas.Errors ~8 pagesError message strings for Midas swat callsMidas.Programs ~2 pages(Discussed below)Midas.UserPrograms ~2 pages(Discussed below)*.Midas ~2 pages eachCommand files for "RunProg" and "Read-Cmds" actions*.mbAssorted micro-binary files loaded by command filesMidas.RunProg ~31 pagesBuilt by Midas/IMidas.Dtach ~31 pagesBuilt by Midas/IMidas.FixUps ~2 pagesCreated by Midas/I (used when loading .MB files)Midas.Compare ~2 pagesCreated by Midas/I, written when "Compare" failsD0 Midas can be obtained by loading [Ivy]D0MidasRun.Dm and retrievingMidas.Programs with Ftp. You must do Midas/I to initialize Midas on your disk afterretrieving these. Subsequently, new versions of Midas can be retrieved by executing theD0NewMidas.Cm command file from the Alto Executive. Midas runs only under OS versions 17or later.To setup an Alto disk for use in D0 microcode development or hardware debugging, you caninstall the Alto OS on a blank disk using the long installation dialog and erase the disk. Whenthis finishes, fetch [Ivy]D0DebuggingDisk.Cm and execute this command file from the AltoExecutive; it will retrieve Midas and a number of other files needed when using an Alto for D0hardware debugging and microcode development. fu!q4] HYfu ^t []q<% YY WM TVT R., PH N@ M,,/ Ka@ GY F$; At >&qD::s :9T  :7  &*:6K P &:4 & :3CP &,:1&3:0;  & :.  & :-3  &):+  &) (`q: &X $-+ #: !6 #5 J /0, dL - B SKernelSources.Dm; there are provisions for overwriting most of Kernel when runninglarge microprograms.In the initial display arrangement, the left-hand display column shows the principal D0 registers,and the right column shows several other items. When you initially start Midas and after a "Run-Prog" action, the display will be set to this configuration.To exit from Midas you may type either SHIFT-SWAT (i.e., simultaneously depress the left-handshift key and the right-most, lowest unmarked key) or ";Q" or you may bug "Exit"; this will closeany open output files prior to exit. Note that on exit, if the D0 was running, it will not bedisturbed. fu!q4] HYfu ^t# []qC:W;:VD:T %R Ouq1 M@ KU J#- FB D*. CW AR-/ ?K =A ;x90sGx7;,x6o 3 qT 1UC /< ,V *NE (// &  &r,: =/ 9O 6KQ 4$7 2G 0H /! +C )E (; &O S $ !D H&uq }R 0, l_ <8 P :nL 8L 6K 5 1 u q4 /d .S ,<G *ry'sJy&Oey$Ey# ?q uq0 tK D 3)   u q% 13  K C@ u q0 V ~ =]LQD0 Midas ManualEdward R. Fiala3 January 19808a memory address that is pointed to by the value in some other register.6. Command MenuThe command menu holds a list of actions that Midas can execute. The basic menu is modifiedunder some conditions. For example, the "Dump" menu item only appears after you have done a"Load". During execution, some actions show alternate menus.For all D0 actions in the command menu, mouse buttons are equivalent. Many common actionsmay alternatively be initated by keyboard command characters, as given in the action table below.Table 1: Command Menu ActionsInputCharMenu ItemCommentsActions (potentially) available on all implementations of Midas[File]Run-ProgReset symbol table, breakpoint table, and display, then do Read-Cmds.[File]Read-CmdsExecutes command file (def. ext. ".Midas") on input text line or fromsubmenu.Show-CmdsShows command file text for selected menu items.FileWrite-CmdsWrite subsequent commands on File.Files;LLoadLoads .MB files (names separated by ",").FilesLdSymsLoads only addresses from .MB files.[File];DDump# Dumps compacted .MB file using the .MB file(s) of the previous loadto control what's dumped.[File];CCompare# Compares hardware data to that in .MB file.Addr=Prints value of an address (illegal in com-file)IMaddr;BBreakInserts break point.[IMaddr];KUnBreakRemoves breakpoint (default address = last break).[IMaddr];GGo* Start at address (continue if nothing typed).;CContinue* Start at address without IOReset or control section reset (continue frombreak if nothing typed).;PContinue* (makes ";P" and ";C" synonymous)[IMaddr]:SS* Single-step at address (continue-step if nothing typed).[IMaddr];SSS* So ":" and ";S" are synonymous.Test* Test register, memory, or other test with data pattern and item selectedfrom submenus.Test-AllTest everything.VirtualChanges IM address interpretation to be virtual.AbsoluteChanges IM address interpretation to be absolute.Actions peculiar to D0 MidasBootBoots the D0 and resets Midas as for Run-ProgClrAddedBPsClears all breakpoints added since the last Load.ClrAllBPsClears all breakpoints.ShowBPsShow BP's added since the last Load.;QExitExits cleanly from Midas--";Q" and Shift-Swat are synonymous.* = requires preceding "TimeOut" action in command file# = requires confirmation with , "Y", or "." (or by preceding "Confirm" command in com-file)[...] = optional input text fu!q4] HYfu _qH Yt VDq uq4 TyF R= O= P Mr uq% Iv FwKwAw"w Dx? BlsA"2 A A"*"?A>J"0 <A "" ;KA") :'A"$ 8KA"3"7f 6KA"- 4K"0 3CKA" 1KA"2 0KA"/K/!A" @"-K,_A"" *KA": )KA"!A(="+"& A%|"A$"0A""1 xAQs"-A "1A"A/"$KA"= 07 ` n X K! 2 P 12` /h P -S +$ (`E &Q $J !YT J F RK 8)  vm y;.<y:n6 7q%4 5UE 3Q 1V .M:$ *+) ) %$9 #$ b#Ap J:<I ;KH:' 8K- 7fK. 6K6 4K< 4=3D0 Midas ManualEdward R. Fiala3 January 198013Table 3: Command File Command ActionsText ArgActionCommentsOctal no.SkipSkip N following commands, where N is the value of the input text..TagSkipSkip following commands until one is encountered with the label ".Tag".Octal no.BackSkip.TagBackSkipReset to byte 1 of the command file, then skip.Octal no.ReturnReturn out of current command file, then skip (".Tag" form is illegal for Return.).DisplayOnTurn on the display, so that effects of subsequent commands can be observed. Thedisplay is initially off for a command file.DisplayOffTurns off the display.Octal no.TimeOutInput text is evaluated to a 32-bit octal number of msec at which to abort theimmediately following command, if it has not finished by then. This is intended foruse before "Go" and other commands which might hang indefinitely. If the timeoutoccurs, Midas will skip the command after the "Go". TimeOut also turns on thedisplay, necessary because the machinery which checks for timeout is only active withthe display on. Note that TimeOut is required before the actions *'ed in the tableon page 4 and is illegal before other commands; Midas will complain if you do notuse TimeOut appropriately.ConfirmSupplies confirmation for the command which follows (which should be one of thecommands requiring confirmation).File nameOpenOutputOpens an output file (default extension ".Report") on which text can be written.File nameAppendOutputAppend to an output file (default extension ".Report")CloseOutputCloses the output file.[text]WriteMessageWrites the contents of the input text buffer on the output file. Note that if any textfollows the WriteMessage, that text up to but not including the is what getswritten. However, if immediately follows WriteMessage, then the contents ofthe input text buffer left by the previous command get written. "~" is translatedinto and "\" into a blank.WriteDTAppends the current date and time to the output file.textShowErrorDisplays the text arg on the command line, turns on the display if it was off, andqueries with "Abort" and "Continue" menu items.--DumpDisplayWrites the current display image on the output file.textPrettyPrintEvaluates text to a memory address, register name, or memory name; writes thisname on the output file; then pretty-prints the value on the output file exactly as itwould be pretty-printed on the comment lines if the item were displayed in one ofthe name-value menus and middle-buttoned.File nameWriteStateUsed by Midas initialization to create the Midas.Dtach and Midas.RunProg files--users shouldn't use this action.9. Syntax of Command-file ActionsThe syntax of a command-file action is as follows:[["."]$" "]$" "$" "[$" "][";"]where the "[]" denote that the ".tag", input text, and ";comment" are optional. $" " denotes asequence of one or more blanks and tabs.If the first character on the line is a ".", then the characters after that are a label or tag which maybe used as the argument for the "Skip" or "BackSkip" actions given in the table earlier. may be any combination of the letters "L" (left-button), "M" (middle-button), and"R" (right-button); these are the buttons released to execute the action. These may appear in anyorder. fu!q4] Gfu__v& [wK YLsKB WKG VK U*K/ SK0KRhMQ,KO  NFKDL?KBJ# AHUGb&xs Fxs2DKC@2A! @~K ") ?K 0K=  <\K F:89&+8986K5x5 4K?2/ 1UK 4 /K B .>-3:+) *rK 2) #t" bq2ysM qE ( @( O LF T  p<\D0 Midas ManualEdward R. Fiala3 January 198014 is the menu name in which the action is executed ("X" for the command menu,"A0"..."A19", "B0"..."B19", and "C0"..."C19" for name-value menus). is the text name for one of the actions (upper/lower case must match the definition). is the text typed on the command line, which may be anything except a ";".Note that if a single blank terminates and if no input text argument is given, then input text left-over from the preceding action will be used. This allows text from a right-button action over a value to beused in a following action (e.g., in WriteMessage or to store the value into another reigster). However, oneor more extra blanks will reset the input text, so the action is executed with null input text.";" begins a comment, which may be omitted. (carriage-return) terminates the action.To find out what text should be put in command files, you can bug "ShowCmds" in thecommand menu. This will cause the command file text for each command to be displayed on thecommand comment line as the mouse selects it (You don't have to execute the command to seethe equivalent text.). This text is complete except that the mouse button which executes thecommand isn't shown unless you depress the mouse button. To terminate "ShowCmds", bug"StopShow" (which appears only when "ShowCmds" is in progress.).You can prepare a command file (default extension ".Midas") by typing a file name and bugging"Write-Cmds". This causes text for subsequent commands to be put on the file. When you aredone with this, bug "Stop-Write-Cmds" to close the file. ("Stop-Write-Cmds" is in the commandmenu only when a command file is being written.). Exiting from Midas also closes the output file.You will probably want to edit out your goofs with Bravo after the command file is written.In addition, you will have to insert "Confirm" before actions which require confirmation andmodify the "TimeOut" stuff which Midas uses to surround actions which might hang indefinitely(See the table given earlier for the actions that require this.).Here is a sample command file:L X Load DG1;Equivalent to typing "DG1" and bugging "Load" in the command menuL A0 Addr CTASK;Examine the "CTASK" register in name-value menu A0L A0 Val 0;Change the value in CTASK to 0L A1 Addr RTEMP;Examine the address "RTEMP" in menu A1L A1 SkipE FOO+3;Skip the next command if RTEMP contains the value FOO+3L X ShowError RTEMP not loaded correctlyL A2 TPC 0;Examine the TPC register for task 0 in menu A2L X TimeOut 2000;Abort the following command if it hasn't finished in 1.024 sec.L X Go START;Begin microprogram execution at address "START"L X Skip 1;Skip the next command if "Go" halts before timeoutL X ShowError START;G failed;Show an error message fu!q4] Gfu _q+' ]KC YE VgQyS ,<\ *r&7 (A %5x" s ! -x !+xH !x!x!3x&(x !'xd!:x !*x !.xB! 8 = ] ;A12 9wO 7y4u07y3 ly1%y/! Zy-+ *rqb (T &W %= #G2pq !}#  L @B! uTyJuC q>$ 1"= fN J *B <]('D0 Midas ManualEdward R. Fiala3 January 198017return links are saved in RM words.The convenient way to use AATOVA is to first right-button the value from an RM word that contains areturn link (which puts the value on the input text line); then left-button the value into AATOVA, whichwill prettyprint the virtual address on the comment lines.12. Registers and Memories that Contain MicroinstructionsThe IMX, IM, and MIM memories all contain microinstructions. A middle-button action over thevalue will print these symbolically on the comment lines.The value for an IM word is shown as four fields on the display:148-bit absolute address;bits 40-438 of microinstruction;bits 0-178 of microinstruction;bits 208-378 of microinstruction.The format of the bits is as shown in the hardware manual. You will note that the RSEL and JAfields are scrambled in this arrangement; each of these has two bits in the main part of themicroinstruction and two other bits in the 4-bit extension, and two of the RSEL bits are inverted.This, together with the numerous fields in each microinstruction, makes octal interpretation andmodification of microinstructions somewhat tedious, so the symbolic pretty-print and input formsdiscussed below should generally be used.IMX and MIM are like IM, but the 148-bit absolute address field is absent from IMX.The MIM memory is an array in Alto core that contains microinstructions used by Midas whenoperating the hardware; it should ordinarily be of no interest to users.Note that the microinstruction pretty-print procedure does not have available all of theinformation that the microassembler had when you assembled your program, so the printout is notalways beautiful. The following are deficiencies you should be aware of:From the hardware manual, you will remember that the interpretation of someinstruction fields depends upon the task executing the instruction, so Midas willdisassemble correctly only when it is able to deduce the task that executes themicroinstruction.There are many possible assembler macros that you might use to generate constants tocontrol the shifter; for an instruction that does this, Midas might not choose the formyou used in the source file.When you want to modify a microinstruction, a special form of input is available as follows: Thefirst character on the input text line should be "(" to change the values of several fields in theinstruction without clobbering other fields, or "[" to reconstruct the value beginning with a no-opmicroinstruction. This is followed by a number of clauses of the form "Field_integer" separatedby blanks and/or commas. The legal field names are:RSEL, JA, MEMINST, F2, and JC for all instructions; fp!q4] G?fp bq#y^u9*y]?)y\1: Wr: TVqY R9 O@yKKuKqyI I uIqyGFuGqyEtDuEtqDuEtq B% Q @[1+ >C </1 :` 90) 5#51u5q/ 2pG 0H -3: +iO )Hy&,.y$a#.y"B y yZ=y<y S:' P F :& )4y 3 p=\ D0 Midas ManualEdward R. Fiala3 January 198018RMOD, ALUF, BSEL, F1, LR, and LT for regular instructions only; andDF2, TYPE, and SRCDEST for memory instructions only.In addition to "field_value" clauses, Midas interprets the standalone clause RETURN, and branchclauses of the form GOTO[addr], CALL[addr], GOTO[addr,bc], GOTOP[addr], or CALLP[addr].In these "addr" is interpreted as a virtual IM address in virtual mode or as an absolute IMXaddress in absolute mode; "bc" is a symbolic branch condition.The "addr" argument to GOTO, CALL, GOTOP, and CALLP will usually be a simple integer inabsolute mode but may be an expression such as FOO+3, where FOO is an IM address, invirtual mode. Midas will give an error if the target for GOTO or CALL is off-page; in the eventthat an off-page branch is legitimate because the predecessor did a LOADPAGE, then this errorcheck will thwart you--you have to use GOTOP or CALLP, which do not check for off-page, inthis situation.On a conditional GOTO, Midas will check that the target is at an odd location for a "regular"branch condition, or at an even location for an "inverted" branch condition. The branchconditions are as follows:Regular: ALU#0, CARRY, ALU<0, NOH2BIT8, R<0, RODD, NOATTN, MB,INTPENDING, NOOVF, BPCCHK, SPARE, QW0, and TIMEOUT;Inverted: ALU=0, NOCARRY, ALU>+0, H2BIT8, R>=0, REVEN, IOATTN,NOMB, NOINTPENDING, OVF, NOBPCCHK, NOSPARE, NOQW0, andNOTIMEOUT.For parts of the microinstruction other than the control clause, Midas requires you to use theawkward "field_value" form.13. Task-Specific RegistersMidas treats all task-specific registers (T and TPC) as 20-word memories. In other words, "T 6" isthe T-register for task 6.In addition, a special kludge allows you to display the 21st word (i.e., "T 20" or "TPC 20") andhave that be interpreted as the register for the currently selected task. The currently selected taskis the value in CTASK; CTASK is initialized to the task which broke at breakpoints.In other words, when a microprogram halts at a breakpoint or because of a mouse-abort, CTASKbecomes the word number for the "T 20" and "TPC 20" items on the display; if CTASK contains6, these will show values for task 6. You can see the registers for another taks by modifyingCTASK on your display. CTASK is also the task started by "Go", "SS", etc. as discussed later.APC contains either the subroutine return link for the current task or the PC for a task about tobe reactivated; when it is a subroutine return link, it holds the location of the last CALL or'edwith 1. In virtual mode, because of the scrambled instruction placement, this will not readilytranslate into the location of the caller, so Midas provides a variant of APC named CALLER,which holds the value in APC less 1; in virtual mode this will show the IM address of the lastCALL. fp!q4] G?fpybqCy`S4 \+4 [ I YLA W> TC RE&. PzS NM L; K G7& E: Dy@pq!y>3y;epq.y92y7 4^^ 2 .r *q(; ( %XH #1pq !S QI I 2, E )8 .3 W  > UB   C=[D0 Midas ManualEdward R. Fiala3 January 19801914. Memory System Registers and MemoriesVM accesses the virtual memory using the current contents of the MAP. Midas does not provideany direct method of accessing storage; the user has to setup MAP with appropriate values andthen use VM to do this.MAP, MEMSYNDROME, etc. to be filled in15. Loading ProgramsThe "Load", "LdSyms", and "LdData" actions are used to load micro-binary files into themachine. These actions are executed by first typing a list of file names (default extension ".mb")separated by commas, then bugging "Load" or "LdSyms" (typing ";L" is equivalent to bugging"Load"). These actions require confirmation by , "Y", or "." iff a previously-loadedprogram is being overwritten; in a command file where it is not known whether or not anotherprogram is being overwritten, a "Confirm" action should precede the load action, as discussedearlier."Load" loads the entire .mb file--symbols into the Midas symbol table, data into the hardware,and breakpoints into the BP memory."LdSyms" loads only the address symbols and IM mapping table from the .mb file; the BPmemory is not loaded and data are not loaded into the hardware."LdData", (in command files but not available interactively), loads data blocks and the BPmemory from the .mb file; symbols and the IM mapping table are not loaded.On D0, the MADDR and MDATA memories are treated as exceptions by "LdData"--symbols for these areloaded anyway.Midas uses several 1024-word core buffers (about 12 on D0 Midas) and the Swatee file to manageits symbol table and virtual memory mapping information; the largest existing programs use 10buffers for VM information and about 20 more (out of 64 available on Swatee) for symbols. Fornearly all symbol and VM accesses, Midas will reference only one or two symbol blocks, so thereshould be no appreciable slow down when handling large programs.The symbol table management algorithm used by Midas is an extremely fast merge that works well whenthe symbol table is nearly empty at the onset of a load but suffers somewhat from block fragmentationwhen the initial symbol table has many items.To avoid fragmentation, don't load one microprogram on top of another--use "Run-Prog" to reset thesymbol table, then do the "Load". It is also a good idea to assemble microprograms as a single .MB file.Although Midas can load multiple .MB files (typed as a list separated by commas), this will fragment thesymbol table and cause extra thrashing.These recommendations follow because Midas takes advantage of alphabetical address ordering in .MB filesto pack its symbol buffers nearly full. But when subsequent files are loaded, the symbol buffers willfragment to about half-full, symbol buffer swapping will result, and symbol searches will be longer.Midas uses the symbol table in two ways: looking up the value of a symbol, requiring at most one diskaccess; and searching for the symbol in a particular memory which best matches a value, requiring at mostone access for RM or at most two accesses for IM address symbols; the best matching value for addresses inall other memories is determined by scanning every block. Searching every block requires about (.22seconds * no. symbol blocks) - (.15 seconds * no. blocks in core) or about 2.9 seconds for the largestprogram thus far. However, since best matches for the two most important memories are obtained quickly, fp!q4] G?fp ar) ^eq@ \F Z W^p Rr O`q L M4/ K< J: H6\ FkM D A.2, ?d# ;O :'? 6O 4Jy2)uLy0 -zqW +D )Z (G &O@y#u-6y"-Ky -y.by!Hyl44y 'ymJy Ny#Ay fyF#yLJy [y Yy *26 ^ <]9D0 Midas ManualEdward R. Fiala3 January 198020it will rarely be necessary to wait for a search.In most situations where a "Load" is going to be done, many other actions will also be carried outto setup the display appropriately for the program. For this reason, you will ordinarily want todefine a command file that does all these other actions as well as the "Load" and you willordinarily do "Run-Prog" on this command file; direct use of "Load" in the command menu willbe rare.Midas/MicroD do not handle microprograms with overlays conveniently. At present, the systemmicrocode consists of an initial microstore image that contains both some resident code andinitialization code; the initialization code is executed and then overwritten by the rest of theresident system. Midas/MicroD do not provide any clever features for setting up the symbol tableand IM mapping table correctly in this situation. One method of handling this situation is tocreate a "Run-Prog" command file which does the following:1) A "Load" on the resident+initialization; then a "Go" at the starting address, whichruns up to a breakpoint at the end of initialization.2) A "Run-Prog" on another command file; this clears the breakpoint, IM mapping, andsymbol tables. The command file does a "Load" on the original resident+rest ofresident that replaces the initialization code and returns to the outer command file.3) A "Go" at the starting address (or a "Continue" from the initialization breakpoint) tostart the system which then runs until it fails or halts.Assuming that you are somehow able to build the two .Mb files needed by this sequence (It isunclear how you will do this.), you will wind up with Midas containing the correct symbols andIM mapping table for debugging.16. Dump and CompareBoth "Dump" and "Compare" require confimation by , Y, or "." They accept the name ofa microprogram (default extension ".mb") on the input text line. If the input text line is empty,then the file name is defaulted to the name of the program last loaded."Dump" deletes forward reference fixups left by Micro (which never occur on Dorado or D0because MicroD does these) and compacts both data and addresses to use less disk space and loadmore quickly later. Dumped files are about 20% smaller and can be loaded 10% to 15% fasterthan undumped files, so it is desirable to load and then dump .mb files that will be used widely. Also, if undumped .MB files contain forward references, they cannot be used with "Compare" (noproblem on Dorado or D0).Note that only memory words loaded by Load are dumped--you cannot patch unused locations,dump the program, and expect the patches to survive. (You might assemble extra locations as apatch area with your microprogram, so that you can patch and dump during debugging, butplacement constraints will be difficult to satisfy.)"Compare" compares data currently in storage against data in the file and reports differences onthe Midas.Compare file. fp!q4] G?fpybAu1 ^qb ](&; []; Y\ W TV(4 R6% P/1 N10 M,I Ka:yG;yF$5yB),y@@y??y;(2y99 6o O 4O 2 .Mr *q@ ):( 'FG #5# " B ?G t*7 <" 8  p+q B 1< f4 N * <](%D0 Midas ManualEdward R. Fiala3 January 198021In microprograms, avoid loading initial values into memory words modified during execution. Theusefulness of "Compare" is enhanced when programs are clean, because no fictitious errors will be reported.For diagnostics, "Compare" can report what has been smashed when something goes off the deep end--thishas frequently been helpful.Following system microcode crashes, "Compare" may provide the only clue about the nature of anintermittent storage failure.17. Break, UnBreak, ClrAddedBPs, ClrAllBPs, and ShowBPs"Break" inserts a breakpoint in the IM or IMX address typed on the input text line. The addressmust be typed--there is no default break address. You will normally find it faster to type"address;B" to insert a breakpoint."UnBreak" removes a breakpoint. If no text is typed, the address defaults to the breakpoint thatcaused the last program halt or to the address of the last breakpoint inserted. You will normallyfind it faster to type "address;K" or ";K" to remove a breakpoint."ClrAddedBPs" removes all the breakpoints inserted since the last "Load" and prettyprints theaddresses of the first 10 removed. "ClrAllBPs" clears all breakpoints, including those that wereloaded witht he program. "ShowBPs" prettyprints the addresses of all breakpoints added since thelast "Load."Breakpoints are implemented by replacing the broken instruction by a special breakpointinstruction. When the D0 is halted, IMX contains the unbroken instructions, and Midasremembers which places contain breakpoints; when you continue your program with "SS," "Go,"or "Continue," Midas saves the instructions in its table (the BP memory), and stores breakpointinstructions at those places; when the program halts, Midas restores the contents of IMX.Single-stepping is also implemented with breakpoints; Midas determines one or both possiblesuccessors to the instruction being single-stepped, plants breakpoints there, starts the machine, andthen undoes the breakpoints after the machine halts; BP's 0 and 1 are used for this purpose.A breakpoint can be put on any instruction. However, there is a limit of 254 user breakpoints;also, there are some restrictions on continuing discussed in a later section. You may be unable tocontinue from breakpoints on some instructions.18. Go, SS, and ContinueThese are actions that result in the microprocessor resuming or starting execution at the selectedaddress. "Go" and "SS" accept an optional address argument on the input line that must evaluateto an IM or IMX address; a simple number is defaulted to an IMX address in absolute mode oran IM address in virtual mode. If the optional argument is omitted, Midas will continue from thelast break. "Continue" always continues from the last break, ignoring any text on the input textline.The keyboard equivalents for these commands are ";G" for "Go"; ";S" or ":" for "SS"; and";P" or ";C" for "Continue."When you start at a new address, the value in CTASK (lower left-hand corner of the normal fp!q4] G?fpybAu`y`56y^BSy\yZCDyX Tyr8 QqS O=; Mr# J.3 H6O FkB BA A.6+ ?d4- = :'W 8]V 6+0 4E 2&3 /[ -:+ +4( (H &V $/ br qH &B [S a C  ?  M K <]D0 Midas ManualEdward R. Fiala3 January 198022display) is the task activated. You must change CTASK on the display before initiating executionfor a different task.When the microprocessor halts after a breakpoint, due to an error, or because you aborted, Midasprints the location of and reason for the halt and saves the information that it needs to continue.The form of the printout is "task:address". Subsequently, if you attempt to continue, Midasrestores the hardware as nearly as possible to its state at the break before continuing.There are some complications surrounding Midas' ability to restore the state of the program, afterdoing other things, so that continuation is possible. These are discussed in the next section.19. When Registers are Read/Written--Restrictions on ContinuingWhen a microprogram halts at a breakpoint or due to a mouse-halt, Midas has two objectives: toread the contents of registers and memory addresses so that they may be shown to the user, and tobe able to continue from the interrupt or breakpoint. In terms of how the Midas read/writeprocedures work, there are three cases:Registers: The Kernel program running on D0 saves registers in RM words reserved for thepurpose; Midas reads these special RM locations into a block of Alto storage when the machinehalts or when you do a "Boot" action. Subsequently, Midas displays the values from Alto storage,and, when a register is written, modifies the Alto storage. The D0 hardware is not affected by anychange in register values until you resume or start your D0 program. At that time, the block ofAlto storage is rewritten into the Kernel's special RM locations, and the Kernel will transfer thesevalues into the registers just before releasing control to your program.Memories: IM/IMX, RM, T, TPC, MAP, and VM addresses are read and written directly;whenever you modify a word in one of these memories, Midas will write it (through the Kernel);Midas always reads the values from the hardware, never from remembered values in Alto core.Artificial registers and memories: For CTASK, AATOVA, BP, MIM, MDATA, and MADDR,Midas modifies/reads the Alto storage containing the value, so the D0 hardware is not affected.However, whenever any register, memory word, or artificial register or memory word is modified,Midas rereads the value for every item on the display, going left-to-right and top-to-bottomthrough the display. This is unimportant as long as the D0 hardware is functioning correctly, butif the hardware is unreliable, then displayed values of memory words may change, so be wary.There are a number of situations that may prevent continuation from a breakpoint or interrupt;Midas warns you about some of these when you try to continue but does not warn you aboutothers. Some of the ones that Midas does not warn you about are as follows:Input/output tasks were not serviced properly due to the delay at the breakpoint, so these are not continuedcorrectly;You break on any of the three instructions involved in the "bypass kludge," when the instruction after amemory operation expects to read the result of the memory addition instead of the value for which write ispending into T or RM.Some situations that Midas does warn you about are as follows:You broke at the instruction after a LoadPage. This happens either because you break on the instruction fp!q4] G?fp bqW `S \B [P YL:" WX TO REJ Mr@ JGqF H|G FH D' Aup qO ?Q =X <21 :K` 8K 6H 3Cpq4 1y$: /P ,y uK  =](.D0 Midas ManualEdward R. Fiala3 January 198023after a LoadPage or because you break on the LoadPage instruction itself and Midas breaks on theinstruction after the LoadPage when restarting.20. Hardware Failure ReportingMidas checks for several kinds of hardware errors and reports them in COMM-ER0, COMM-ER1,and COMM-ER2, which are addresses in the MADDR memory; these are shown in the upperright-hand name-value menus of the normal Midas display. Values have two 16-bit fields; eachfield counts errors of some type and can be prettyprinted for interpretation. Midas does not printany special messages after these errors--the user will have to notice when they change.A "Boot" action is carried out by first loading selected IMX words from a ROM; Midas can causethe D0 hardware to do this through its Diablo Printer interface, as discussed in the hardwaremanual. When this part of the boot finishes, Midas transmits the Kernel into IMX bycommunicating with the boot loader. If Kernel transmission is successful, Midas then starts theKernel.Four possible communication errors may be detected during Kernel transmission. If one of thesefailures occurs, Midas reports the failure in BOOT-ERR (an address in the MADDR memory) andreattempts the boot, not giving up until the boot has failed 10 times. BOOT-ERR is shown on thedisplay as two 16-bit fields; the left-most field shows how many words were transmitted before the(last) failure occurred; the right-most field contains four four-bit nibbles that count the number offailure occurrences for each of the four reasons.As soon as the Kernel has been successfully transmitted, Midas will attempt to start it running; ifthis fails Midas will immediately report a failure without retrying.MEMSYNDROME and BOOTREASON registers report failures detectd by the D0 hardware, asdiscussed in the hardware manual.21. Testing Directly From Midas"Test" and "TestAll" allow the target machine to be tested directly from Midas. Althoughdiagnostic firmware can test faster and more thoroughly than is practical from Midas, Midas directtesting permits the hardware to be checked out well enough to get basic diagnostics loaded andstarted. On Maxc1, which had no direct testing in Midas, many hardware failures of the "nothingworks" variety were harder to fix than on Maxc2 and Dorado, where Midas test software isavailable.However, on D0 and M68 implementations of Midas, the test features in Midas are of doubtfulusefulness because the hardware is accessed through communication with a small "Kernel"microprogram that only works when most of the hardware is functional.On D0, only IMX and RM are presently testable, but the address ranges are limited so as not tooverwrite the parts of these memories used by the Kernel. Neither of these actions is expected tobe useful because most failures in these memories will prevent the Kernel from running. Theyare described here anyway.Data patterns for test actions are determined from the first subsidiary menu, as follows: fp!q4] G?fpybAuMy`/ \wr Yq!8 W;@ UpE SP QW Ni^ L] J6 I #= G? C R B"9 @7?! >mF <;* :1 7fN 5D 2)P 0_! +r (`qC &,6 $G #P !6G k 9" /A dE [ TS W  MY <]D0 Midas ManualEdward R. Fiala3 January 198024Table 6: Test Data Pattern ActionsZEROESAll-zeroes dataONESAll-ones dataSHOULD-BEConstant test pattern equal to value in SHOULD-BECYC1Vector of the same size as the register containing zeroes with a single one-bit cycled leftone position each iterationCYC0Cycled zero in vector of onesRANDOMRandom numbersSEQUENTIAL0, 1, ..., sequential numbersALTZOAlternating all-ones and all-zeroes patternsALT-SHOULD-BEAlternating contents of SHOULD-BE with its ones-complementThe CYC0, CYC1, and SEQUENTIAL patterns vary according to the size and arrangement of thedata vector for the item being tested. CYC0, for example, starts off with leading 1's and a 0 inthe right-most bit of the data vector. The 0 is shifted left (bringing in 1's to its right) eachiteration; when the 0 is shifted out of the left-most bit in the data vector, the vector is reinitializedto leading 1's and a 0 in the right-most bit. The CYC1 pattern is like CYC0 with 1's and 0'sinterchanged. The SEQUENTIAL pattern is initialized to 0 and is incremented by 1 in the right-most bit of the data vector each iteration.This treatment of CYC0, CYC1, and SEQUENTIAL patterns is conceptually correct for items thatare described inside Midas by dense, left-justified data vectors whose bits are displayed left-to-right on the screen. On D0 all testable items are handled this way.Testing is controlled/described by 12 addresses on the display as follows:Table 7: Test Items in the Name-Value DisplaySHOULD-BEOn a failure, the correct data; after control-C or Abort, the next pattern.DATA-WASOn a failure, what the data was; after control-C or Abort, the data read last time.BITS-CHECKEDMask of bits checked (see below).BITS-PICKEDUnion of bits that should have been 0 but were erroneously 1 during testing. Thisaccumulates failure information when you continue a Test using or .BITS-DROPPEDUnion of bits that should have been 1 but were erroneously 0.LOOP-COUNT32-bit iteration count at which failure occurred or after which the test was aborted.NFAILURES32-bit count of test failures.Memory tests onlyLOW-ADDRHIGH-ADDRCURRENT-ADDRADDR-INC32-bit addresses: If ADDR-INC (normally 1) is positive, the test starts at LOW-ADDRand advances through the memory in steps of ADDR-INC until CURRENT-ADDR isgreater than HIGH-ADDR. If ADDR-INC is negative, the test starts at HIGH-ADDRand goes by steps of ADDR-INC until CURRENT-ADDR is below LOW-ADDR.CURRENT-ADDR contains the last address tested.ADDR-INTERSIntersection of address bits where failures were detected.ADDR-UNIONUnion of address bits where failures were detected.SHOULD-BE, DATA-WAS, BITS-CHECKED, BITS-PICKED, and BITS-DROPPED areaddresses in the MDATA memory; LOOP-COUNT, NFAILURES, LOW-ADDR, etc. areaddresses in the MADDR memory. These two memories (which are tables in Alto storage) existon all versions of Midas that implement the test actions. fp!q4] G?fpzbs#x^ux] x\11xZ[YoxXxV xUM xS,xR : O=qB Mr\ KQ I'B HB FHX D}+ A ,0 ?A U =vD :J6s.x3guKx2:x0 !x/D <-1x, =x){ 6x(x%tx" ux xH x76&6 8d.x :x 3 Tq_`0 * = 9 p <[^PD0 Midas ManualEdward R. Fiala3 January 198025The handling of the MDATA memory is complicated by the fact that items in this memory haveto be shown in the same format as the memory or register being tested. This is accomplished asfollows: When the selected test item is different from the last, the width and print-format ofMDATA are set to be identical to the new item; in this case BITS-CHECKED is initialized to testall bits in the new item. Then when the test is aborted or halts due to a failure, the display ofBITS-CHECKED, etc. is identical to that of the item tested. The user may then modify BITS-CHECKED and continue, restart, or free-run the test, as discussed below; in this case the itemtested is identical to the last item tested, so BITS-CHECKED is not reset.The handling of MADDR is also tricky. ADDR-INC is allowed to be any value except 0; if it is0, Midas will reset it to 1 before testing. When HIGH-ADDR is initially greater than the largestlegal address in the memory, it is reset to memlength-1 prior to testing. Then if LOW-ADDR isgreater than HIGH-ADDR, it is reset to 0 before testing. When the selected memory differs fromthe last item tested, and when the length of the memory is less-than-or-equal to 100008 wordslong, Midas will reset LOW-ADDR to 0 and HIGH-ADDR to memlength-1 prior to testing. Thisis done because a common operational error is failure to reset the address range when switchingfrom one memory test to another. However, Midas does not reset the address range for very longmemories because they are normally tested with small address ranges that cannot be predicted inadvance--full-length testing of long memories from the Alto is so slow as to be impractical."Test", after showing the data-pattern menu, shows a menu of register and memory names andother test names, and executes a test of the one you select until the test fails or you halt the testfrom the keyboard.The testable registers and memories appear in the second sub-menu for the "Test" action.Provision is also made for other machine-dependent tests, but there aren't any implemented forthe D0. will continue a register or memory test that has halted; it restarts an OtherTest that hashalted. will continue a register or memory test that has halted but will free-run the test rather thanhalting on the next failure. While free-running, LOOP-COUNT and NFAILURES are reportedcontinuously on the display, and BITS-DROPPED, BITS-PICKED, ADDR-INTERS, and ADDR-UNION accumulate failure information. When you stop the test by bugging "Abort" or typingcontrol-C, the accumulated failure information is displayed in these registers."TestAll" automatically loads BITS-CHECKED with a full-sized comparison mask prior to testingeach item; memories are tested with LOW-ADDR = 0, HIGH-ADDR = memory length-1, andADDR-INC = 1. It tests each register 200 times and makes 4 passes through each memory andeach OtherTest. fp!q4] G?fp bqA `SL ^%: \B ZO Y)E W^H UJ R":# PWY NR L/0 J=JjuJq I-5$ Gb8' EK C<# B;! >E <%@ : 7B 5 R 3 0-3 . +EE ){; '6 %4& $O /. ?  M I v =M D0 Midas ManualEdward R. Fiala3 January 19802622. Command Files Used With "RdCmds"At the time this was written, the following command files were in use:Table 8: Command Filesmidas-testsrestore "normal" Midas display with the hardware testing items in the right display column.svcrashwrite the Midas display followed by a pretty-print of most registers on the file Crash.Report.tpcshow 208 TPC registers in middle column.tshow 208 T registers in middle column. fp!q4] G?fp ar% ^eqF!ZsxWu  ExVD UxS SSxQ QqQ QN9/SLoaded: KERNELBEGIN;Sample Midas DisplayGo at 0:BEGIN, BrkP after 0:QERR+1 at 0:QERR+2***AATOVA 177777 COMM-ER0 0 0DBREG 0 TPC 0 1234 CYCLECONTROL 0 COMM-ER1 0 0PCXREG 1 COMM-ER2 0 0PCFREG 2 BOOT-ERR 0 0SBREG 0 TPC 1 5677MNBR 0 TPC 2 123STKP 302 TPC 4 2274ALURESULT 7 TPC 5 3331SALUF 11 TPC 6 1255T 20 123123 TPC 7 2771 TPC 10 1336TPC 20 7002 TPC 11 7774CALLER 7103 TPC 12 1177PAGE 16 TPC 13 444APC 7105 TPC 14 4055APCTASK 3 TPC 15 117 BOOTREASON 1CIA 7104 TPC 16 6660 PARITY 0CTASK 3 TPC 17 7403 MEMSYNDROME 0 0D0MidasPicture.Sil1/3/80Exit Boot Run-Prog Read-Cmds Break UnBreak ClrAddedBPs ClrAllBPs ShowBPs GoSS Continue Load LdSyms Compare Test-All Test Dump Show-Cmds Write-CmdsAbsoluteSSTKP 0 TPC 3 71029d'F$H $XX9 F$9 $X|5%1.AIBPJZJKSKXKVKUJKQ&PJ&L&KJ&I&G&FI&D&B&AI&?&=K