Guest User

Sample of PDP11 interceptor scripting language

a guest
May 6th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 3.87 KB | None | 0 0
  1. //************************************************************************
  2. //  Interceptor script for basic test of M7847 16KW memory board
  3. //------------------------------------------------------------------------
  4. // Test Parameters
  5. BoardID='7847#5'       // ID of board being tested
  6. TestBaseAddr=0         // Word Address of Memory Board
  7. TestMemSize=16384      // Memory Board size in words
  8. BlokSize=16;           // Size of test block (words)
  9. AddrStepSize=4096      // Test block address increment (words)
  10. // Setup
  11. LogClear
  12. Log 'Testing M7847 board '+BoardID
  13. Log 'This test done without M930 terminator in AB1'
  14. ErrorCount=0
  15. ErrorFlag=False
  16. TestBaseAddr=TestBaseAddr*2 // Convert to bytes...
  17. TestMemSize=TestMemSize*2
  18. AddrStepSize=AddrStepSize*2
  19. // Run tests...
  20. For BlockAddr=TestBaseAddr to TestBaseAddr+TestMemSize by AddrStepSize do
  21.   TestData=0      Call FillMemCon  Call ExamMem(False)
  22.   TestData=65535  Call FillMemCon  Call ExamMem(False)
  23.   TestData=21845  Call FillMemCon  Call ExamMem(False)
  24.   TestData=43690  Call FillMemCon  Call ExamMem(False)
  25.   Call FillMemAdr Call ExamMem(True)
  26.   Log('')
  27. End
  28. Log 'Test Complete. '+ErrorCount+' Errors found. Duration: '+Duration;
  29. LogSave $Name+' ('+BoardID+') '+$Date+'-'+$Time+'.log';
  30.  
  31. // Fill memory block with a constant value
  32. Procedure FillMemCon
  33.   Call ShowFillHeading('constant value $'+Hex(TestData))
  34.   PutCommand('@C.'+Oct(TestData));        // Enter test data value
  35.   For 0 to BlokSize do
  36.     LogRepl(Heading+HEX(CurrAddr))        // Show address being loaded
  37.     PutCommand('@D');                     // Hit deposit key
  38.     Inc(CurrAddr)                         // Track the address value
  39.   End
  40. End
  41.  
  42. // Fill memory block with each location's address value
  43. Procedure FillMemAdr
  44.   Call ShowFillHeading('address value')
  45.   For 0 to BlokSize do                   // Loop for the number of words/testblock
  46.     If Not ErrorFlag then                // Don't clobber any error message,
  47.       LogRepl(Heading+HEX(CurrAddr))     // otherwise show address
  48.     End
  49.     PutCommand('@C.'+Oct(CurrAddr)+'DV');  // Det data value and Deposit
  50.     If ConsoleDispStr<>Oct(CurrAddr) then  // Check the data was entered properly
  51.       Log('ERROR: Display shows: '+ConsoleDispStr+' Should be: '+Oct(CurrAddr))
  52.       ErrorFlag=True;
  53.     End
  54.     Inc(CurrAddr)                         // Track the address value
  55.   End
  56. End
  57.  
  58. // Check that memory block contains the expected data
  59. Procedure ExamMem
  60.   Call ShowTestHeading
  61.   For 0 to BlokSize do
  62.     If Not ErrorFlag then            // Show addr if no error msg
  63.       LogRepl(Heading+HEX(CurrAddr))
  64.     End
  65.     PutCommand('@E@V')               // Hit Exam, ensure we have updated value
  66.     If &1 then                       // Using address as test data?
  67.       TestData=CurrAddr
  68.     End
  69.     Call CheckExamResult             // Check Exam result matches test data
  70.     Inc(CurrAddr)                    // Track the address value
  71.   End
  72. End
  73.  
  74. // Check that the console display (from EXAM) shows the expected value (in TestData)
  75. Procedure CheckExamResult
  76.   If ConsoleDispStr<>Oct(TestData) then  // Does console show correct value?
  77.     ErorMesg='['+Oct(CurrAddr)+'] = '+ConsoleDispStr+' Expected '+Oct(TestData)
  78.     ConsValu=ConsoleDispVal
  79.     Syndrome=ConsValu Xor TestData       // No, form difference, and display
  80.     ErorMesg=ErorMesg+' Syndrome Bits: '+Bin(Syndrome)
  81.     Log('ERROR: '+ErorMesg);
  82.     Inc(ErrorCount) ErrorFlag=True
  83.   End
  84. End
  85.  
  86. Procedure ShowFillHeading
  87.   Heading='Filling block at: '+Oct(BlockAddr)+' $'+Hex(BlockAddr)+' with '+&1+' >$'
  88.   Log(Heading)
  89.   Call LoadAddress(BlockAddr)
  90. End
  91.  
  92. Procedure ShowTestHeading
  93.   Heading='Testing block at: '+Oct(BlockAddr)+' $'+Hex(BlockAddr)+' >$'
  94.   Log(Heading)
  95.   Call LoadAddress(BlockAddr)
  96. End
  97.  
  98. Procedure LoadAddress
  99.   CurrAddr=&1
  100.   PutCommand('@C.'+Oct(CurrAddr)+'L');  // Hit CLR, Enter address, Hit LAD
  101.   ErrorFlag=False
  102. End
Add Comment
Please, Sign In to add comment