From e8fc9fa3663dad1735d554aee5615bf571655b64 Mon Sep 17 00:00:00 2001 From: wfjm Date: Mon, 8 Aug 2022 09:40:44 +0200 Subject: [PATCH] tcode: add Makefile [skip ci] --- tools/README.md | 2 +- tools/tcode/.gitignore | 9 ++++- tools/tcode/Makefile | 78 +++++++++++++++++++++++++++++++++++++ tools/tcode/README.md | 28 ++++++++++++- tools/tcode/tcode.ecmd | 14 +++++++ tools/tcode/tcode_exec.scmd | 22 +++++++++++ 6 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 tools/tcode/Makefile create mode 100644 tools/tcode/tcode.ecmd create mode 100644 tools/tcode/tcode_exec.scmd diff --git a/tools/README.md b/tools/README.md index 964c245d..d3f415a7 100644 --- a/tools/README.md +++ b/tools/README.md @@ -10,7 +10,7 @@ This directory tree contains **many tools** and is organized in | [fx2](fx2) | firmware for Cypress FX2 USB interface | | [make](make) | make includes | | [man](man) | man pages | -| [mcode](mcode) | miscellaneous codes | +| [mcode](mcode) | miscellaneous stand-alone codes for system tests | | [oskit](oskit) | support files for OS disk/tape image kits | | [simh](simh) | configuration files for `SimH pdp11` | | [src](src) | C++ sources for rlink backend | diff --git a/tools/tcode/.gitignore b/tools/tcode/.gitignore index d1df3b77..31c0a566 100644 --- a/tools/tcode/.gitignore +++ b/tools/tcode/.gitignore @@ -1,7 +1,12 @@ *.cof -*.lst +*.exp.mac +*.lda *.lsm -*.lsm_scmd +*.lst + +# e11 tmp stuff +tmp_e11.ini +tmp_e11_tt0.log # simulation stuff rlink_cext_conf diff --git a/tools/tcode/Makefile b/tools/tcode/Makefile new file mode 100644 index 00000000..3bb57094 --- /dev/null +++ b/tools/tcode/Makefile @@ -0,0 +1,78 @@ +# $Id: Makefile 1264 2022-07-30 07:42:17Z mueller $ +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2022- by Walter F.J. Mueller +# +# Revision History: +# Date Rev Version Comment +# 2022-07-29 1264 1.0 Initial version +#--- +# +include ${RETROBASE}/tools/make/generic_asm11.mk +# +MAC_all += cpu_badinst_nofpp.mac +MAC_all += cpu_basics.mac +MAC_all += cpu_details.mac +MAC_all += cpu_eis.mac +MAC_all += cpu_mmu.mac +MAC_all += cpu_selftest.mac +# +LDA_all = $(MAC_all:.mac=.lda) +LST_all = $(MAC_all:.mac=.lst) +EXP_all = $(MAC_all:.mac=.exp.mac) +TSIM_all = $(MAC_all:.mac=.tsim) +TE11_all = $(MAC_all:.mac=.te11) +TW11_all = $(MAC_all:.mac=.tw11) +# +# create export mac (with asm-11 -E) +%.exp.mac : %.mac + asm-11 -E $< > $@ +# execute SimH simulation +%.tsim : %.lda + pdp11 tcode_exec.scmd $* | grep -q "HALT instruction, PC: 002002" +# execute e11 simulation; output goes to tmp_e11_tt0.log +%.te11 : %.lda + @rm -f tmp_e11.ini + @echo "@tcode.ecmd" >> tmp_e11.ini + @echo "mount pr: $*.lda" >> tmp_e11.ini + @echo "boot pr:" >> tmp_e11.ini + @echo "quit" >> tmp_e11.ini + e11 /initfile:tmp_e11.ini + grep "PC/002002" tmp_e11_tt0.log + rm -f tmp_e11_tt0.log tmp_e11.ini +# execute w11 simulation (on C7 system) +%.tw11 : %.mac + ti_w11 -c7 -tmu -w -e $< | tbfilt +# +.PHONY : default alllda alllst allexp alltsim alltw11 clean +# +default : + @echo "No default action defined, use" + @echo " make alllda all .lda + .lst files" + @echo " make alllst all .lst files" + @echo " make allexp all exp.mac export files" + @echo " make alltsim all SimH tests" + @echo " make allte11 all e11 tests" + @echo " make alltw11 all w11 GHDL simulation tests" + @echo " make .lda compile, create .lda + .lst" + @echo " make .lst compile, create .lst" + @echo " make .exp.mac compile with -E" + @echo " make .tsim run SimH simulator" + @echo " make .te11 run e11 simulator" + @echo " make .tw11 run w11 GHDL simulation (for C7)" +# +alllda : $(LDA_all) +# +alllst : $(LST_all) +# +allexp : $(EXP_all) +# +alltsim : $(TSIM_all) +# +allte11 : $(TE11_all) +# +alltw11 : $(TW11_all) +# +clean : + rm -rf *.lst + rm -rf *.lda + rm -rf *.exp.mac diff --git a/tools/tcode/README.md b/tools/tcode/README.md index f31480d7..d9b5863b 100644 --- a/tools/tcode/README.md +++ b/tools/tcode/README.md @@ -1 +1,27 @@ -This directory contains the **w11 test codes** +This directory contains the **w11 test codes**. + +The _tcodes_ are MACRO-11 stand-alone codes. They are meant for +verification and not as diagnostic tool: +- in case of success, they stop on a `halt` at 2000, thus with PC=002002 +- in case of error, they `halt` at the point of the failed check + +The codes can be executed +- in a w11 GHDL simulation, usually via a `ti_w11 -c7 -w -e ` +- with SimH, usually via a `load `, `dep pc 200`, `cont` +- with `e11`, usually via a `mount pr: `, `boot pr:` + +A [Makefile](Makefile) is provided with the targets +``` + make alllda all .lda + .lst files + make alllst all .lst files + make allexp all exp.mac export files + make alltsim all SimH tests + make allte11 all e11 tests + make alltw11 all w11 GHDL simulation tests + make .lda compile, create .lda + .lst + make .lst compile, create .lst + make .exp.mac compile with -E + make .tsim run on SimH simulator + make .te11 run on e11 simulator + make .tw11 run on w11 GHDL simulation (for C7) +``` diff --git a/tools/tcode/tcode.ecmd b/tools/tcode/tcode.ecmd new file mode 100644 index 00000000..bd22ee5e --- /dev/null +++ b/tools/tcode/tcode.ecmd @@ -0,0 +1,14 @@ +! $Id: tcode.ecmd 1264 2022-07-30 07:42:17Z mueller $ +! SPDX-License-Identifier: GPL-3.0-or-later +! Copyright 2022- by Walter F.J. Mueller +! +! setup w11 like processor configuration +! +set cpu 70 +set cpu nofpp +set idle delay=1 +! +! create log file, the only way to capture e11 output +! no rediction to stdout possible +! +log tt0: tmp_e11_tt0 diff --git a/tools/tcode/tcode_exec.scmd b/tools/tcode/tcode_exec.scmd new file mode 100644 index 00000000..ccc8d944 --- /dev/null +++ b/tools/tcode/tcode_exec.scmd @@ -0,0 +1,22 @@ +; $Id: tcode_exec.scmd 1264 2022-07-30 07:42:17Z mueller $ +; SPDX-License-Identifier: GPL-3.0-or-later +; Copyright 2022- by Walter F.J. Mueller +; +; setup w11 like processor configuration +; like ../simh/setup_w11a_max.scmd +; but only cpu, devices are all default +; +set cpu 11/70 +set cpu nofpp +set cpu 4m +set cpu oct +set cpu idle +; +; disable simulator stop conditions, especially "read stack trap" +; +dep STOP_TRAPS 0 +; +load %1.lda +dep pc 200 +cont +quit