From 7f9506b2019f792bc9223978f75334d2173fd649 Mon Sep 17 00:00:00 2001 From: wfjm Date: Thu, 25 Aug 2022 09:00:53 +0200 Subject: [PATCH] add systyp checking; add w11 specific tcode tests - tcode_std_start.mac: system type (w11,simh,e11) detection via sysid - cpu_mmu.mac: add a test done for w11 only - tcode.ecmd,tcode_exec.scmd: set up sysid --- tools/asm-11/lib/tcode_std_start.mac | 64 +++++++++++++++++++--------- tools/tcode/.gitignore | 7 +-- tools/tcode/cpu_mmu.mac | 15 ++++--- tools/tcode/tcode.ecmd | 4 +- tools/tcode/tcode_exec.scmd | 4 +- 5 files changed, 64 insertions(+), 30 deletions(-) diff --git a/tools/asm-11/lib/tcode_std_start.mac b/tools/asm-11/lib/tcode_std_start.mac index 2134414b..c7e3b02d 100644 --- a/tools/asm-11/lib/tcode_std_start.mac +++ b/tools/asm-11/lib/tcode_std_start.mac @@ -1,4 +1,4 @@ -; $Id: tcode_std_start.mac 1275 2022-08-10 08:10:40Z mueller $ +; $Id: tcode_std_start.mac 1283 2022-08-22 10:07:58Z mueller $ ; SPDX-License-Identifier: GPL-3.0-or-later ; Copyright 2015-2022 by Walter F.J. Mueller ; @@ -6,6 +6,7 @@ ; ; Revision History: ; Date Rev Version Comment +; 2022-08-22 1283 1.1.2 system type (w11,simh,e11) detection via sysid ; 2022-08-08 1275 1.1.1 BUGFIX: fix sdreg probe code ; 2022-07-28 1263 1.1 ensure PRI=0, ignore startup state (for e11) ; 2015-11-02 712 1.0 Initial version @@ -13,12 +14,17 @@ .include |lib/defs_bits.mac| .include |lib/defs_cpu.mac| .include |lib/defs_nzvc.mac| + .include |lib/defs_reg70.mac| ; .include |lib/vec_cpucatch.mac| .include |lib/vec_devcatch.mac| ; .include |lib/halt_checks.mac| .include |lib/push_pop.mac| +; + sy.w1a = 010000/256. ; sysid prefix for w11a systems + sy.sih = 110000/256. ; sysid prefix for SimH environment + sy.e11 = 120000/256. ; sysid prefix for e11 environment ; . = 000200 jmp @#start @@ -29,14 +35,17 @@ stack: dostop: halt ; successful halt address is 2002 !! stop: br dostop ; no restart after successful halt !! ; -psreg: .word cp.dsr ; pointer to switch reg (default->hardware) -pdreg: .word cp.dsr ; pointer to display reg (default->hardware) swsreg: .word 0 ; software switch reg swdreg: .word 0 ; software display reg +swsyid: .word 0 ; software sysid reg +psreg: .word cp.dsr ; pointer to switch reg (default->hardware) +pdreg: .word cp.dsr ; pointer to display reg (default->hardware) ; tstno: .word 0 ; test number runno: .word 0 ; run number ; +systyp: .byte 0 ; system type (from sysid) +cpunum: .byte 0 ; cpu number (from sysid) ; start: reset ; general reset mov #stack,sp ; setup stack @@ -44,30 +53,47 @@ start: reset ; general reset ; mov #v..lp+2,v..lp ; setup LP11 vector catcher clr v..lp -; - tst swsreg ; software switch reg setup ? - bne 200$ ; if yes use software swi and disp reg -; - mov #100$,v..iit ; setup IIT handler + mov #800$,v..iit ; setup IIT handler for probing mov #cp.pr7,v..iit+2 ; - mov #200$,r5 ; setup failed probe code pointer + tst swsreg ; software switch reg set up ? + bne 100$ ; if yes use software swi and disp reg +; + mov #100$,r5 ; setup failed probe code pointer mov @#cp.dsr,r0 ; test switch register clr @#cp.dsr ; test display register - br 300$ + br 200$ +; +100$: mov #swsreg,psreg ; use software switch/display regs + mov #swdreg,pdreg +; +200$: tst swsyid ; software sysid set up ? + bne 300$ +; + mov #300$,r5 ; setup failed probe code pointer + mov @#sysid,swsyid ; probe and read sysid +; +; reset iit vector catcher after all probing +; +300$: mov #v..iit+2,v..iit ; reset to iit vector catcher + clr v..iit+2 +; +; analyse sysid information +; + movb swsyid+1,r0 ; get sysid upper byte + mov r0,r1 + bic #^b00001111,r0 ; mask system type field (sysid[15:12]) + movb r0,systyp + asr r1 + bic #^b11111100,r1 ; get cpu number (sysid[10:9]) + movb r1,cpunum + br 900$ ; ; IIT handler for probing. Simply use r5 as return address ; --> successful probes simply fall through ; --> unsuccessful probes branch to address given in r5 ; -100$: mov r5,(sp) +800$: mov r5,(sp) rti ; -; setup software swi and disp reg -; -200$: mov #swsreg,psreg - mov #swdreg,pdreg -; -300$: mov #v..iit+2,v..iit ; reset to iit vector catcher - clr v..iit+2 -; +900$: diff --git a/tools/tcode/.gitignore b/tools/tcode/.gitignore index 31c0a566..f56ae559 100644 --- a/tools/tcode/.gitignore +++ b/tools/tcode/.gitignore @@ -9,8 +9,9 @@ tmp_e11.ini tmp_e11_tt0.log # simulation stuff -rlink_cext_conf -rlink_cext_fifo_rx -rlink_cext_fifo_tx +rlink_cext_* sysmon_stim tmu_ofile + +# Simh stuff +simh_*.dat diff --git a/tools/tcode/cpu_mmu.mac b/tools/tcode/cpu_mmu.mac index 93de4be5..542b0410 100644 --- a/tools/tcode/cpu_mmu.mac +++ b/tools/tcode/cpu_mmu.mac @@ -1,4 +1,4 @@ -; $Id: cpu_mmu.mac 1280 2022-08-15 09:12:03Z mueller $ +; $Id: cpu_mmu.mac 1283 2022-08-22 10:07:58Z mueller $ ; SPDX-License-Identifier: GPL-3.0-or-later ; Copyright 2022- by Walter F.J. Mueller ; @@ -611,12 +611,15 @@ tc0101: mov #1000$,r1 ; ptr to abort bit table hcmpeq (r3),#^b0000000011110001; ; ; check @(pc)+ behavior -; Simh only adds 'general purpose register updates, thus not pc ; w11 updates mmr1 in this case, as is also expected in ekbee1 -; case commented out to ensure that cpu_mmu.mac runs on both -;; reset -;; mov -(r1),@#mmr0 ; r1,-2,pc,2 00010 111 11110 001 via ale -;; hcmpeq (r3),#^b0001011111110001; +; Simh only adds 'general purpose register updates', thus not pc +; e11 doesn't like this test either + tstb systyp ; skip test if on SimH or e11 + blt 100$ ; systyp<0 --> not on w11 + reset + mov -(r1),@#mmr0 ; r1,-2,pc,2 00010 111 11110 001 via ale + hcmpeq (r3),#^b0001011111110001; +100$: ; reset jmp 9999$ diff --git a/tools/tcode/tcode.ecmd b/tools/tcode/tcode.ecmd index bd22ee5e..93827648 100644 --- a/tools/tcode/tcode.ecmd +++ b/tools/tcode/tcode.ecmd @@ -1,4 +1,4 @@ -! $Id: tcode.ecmd 1264 2022-07-30 07:42:17Z mueller $ +! $Id: tcode.ecmd 1283 2022-08-22 10:07:58Z mueller $ ! SPDX-License-Identifier: GPL-3.0-or-later ! Copyright 2022- by Walter F.J. Mueller ! @@ -7,6 +7,8 @@ set cpu 70 set cpu nofpp set idle delay=1 +! set sysid, leading '1' indicates simulator, next '2' e11 +set cpu SYSID=0120345 ! ! create log file, the only way to capture e11 output ! no rediction to stdout possible diff --git a/tools/tcode/tcode_exec.scmd b/tools/tcode/tcode_exec.scmd index fc5215d2..c844836b 100644 --- a/tools/tcode/tcode_exec.scmd +++ b/tools/tcode/tcode_exec.scmd @@ -1,4 +1,4 @@ -; $Id: tcode_exec.scmd 1275 2022-08-10 08:10:40Z mueller $ +; $Id: tcode_exec.scmd 1283 2022-08-22 10:07:58Z mueller $ ; SPDX-License-Identifier: GPL-3.0-or-later ; Copyright 2022- by Walter F.J. Mueller ; @@ -11,6 +11,8 @@ set cpu nofpp set cpu 4m set cpu oct set cpu idle +; set sysid, leading '1' indicates simulator, next '1' SimH +dep sysid 110234 ; ; disable simulator stop conditions, especially "read stack trap" ;