mirror of
https://github.com/wfjm/w11.git
synced 2026-01-12 00:43:01 +00:00
automation of oskit tests (initial version)
- tools/bin/ostest: driver script for oskit tests - tools/exptest: configuration files for ostest and other expect based tests - tools/oskit/test: support files for OS disk/tape image kits - tools/tcl/exptest: tcl package for expect based tests - tools/tcl/exptest_rri: tcl package for rri mode
This commit is contained in:
parent
84540478cd
commit
9f13421caa
@ -26,11 +26,13 @@ The full set of tests is only run for tagged releases.
|
||||
|
||||
### Summary
|
||||
- automate oskit download and container file setup
|
||||
- automate testing of oskits
|
||||
|
||||
### New features
|
||||
- new tools
|
||||
- bin/oskit_setup: helper for oskit download and container file setup
|
||||
- oskit/*/*_setup: scripts for oskit download and container file setup
|
||||
- oskit/\*/\*_setup: scripts for oskit download and container file setup
|
||||
- ostest: automation of oskit tests
|
||||
|
||||
<!-- --------------------------------------------------------------------- -->
|
||||
---
|
||||
@ -51,7 +53,7 @@ The full set of tests is only run for tagged releases.
|
||||
- add -reset option to stats subcommand
|
||||
- librtools/Rstats: add Reset(); drop operator-=() and operator*=()
|
||||
- librtcltools/RtclStats: Rename Collect->Exec, not longer const; add -reset
|
||||
- libr*/*: Stats() not longer const; use RtclStats::Exec()
|
||||
- libr\*/*\: Stats() not longer const; use RtclStats::Exec()
|
||||
- other backend updates
|
||||
- RparseUrl: add DirName,FileName,FileStem,FileType
|
||||
- derive ReventFd and RtimerFd from Rfd
|
||||
@ -364,7 +366,7 @@ The full set of tests is only run for tagged releases.
|
||||
- sys_w11a_*.vhd: use DM_STAT_EXP; IDEC to maxisys; setup PERFEXT
|
||||
- sfs_gsim_core: new common simulation core
|
||||
- use in {dcm,s6_cmt,s7_cmt}_sfs_gsim simulation models
|
||||
- use in rtl/bplib/*/tb/tb_* test benches
|
||||
- use in rtl/bplib/\*/tb/tb_\* test benches
|
||||
- remove s7_cmt_sfs_tb
|
||||
- tbcore_rlink: wait 40 cycles after CONF_DONE
|
||||
- serport_master_tb: add 100 ps RXSD,TXSD delay to allow clock jitter
|
||||
|
||||
@ -6,6 +6,7 @@ This directory tree contains **many tools** and is organized in
|
||||
| [bin](bin) | support scripts and tools |
|
||||
| [bin_xilinx_wrapper](bin_xilinx_wrapper) | wrappers for Xilinx environments |
|
||||
| [dox](dox) | configuration files for Doxygen |
|
||||
| [exptest](exptest) | configuration files for `ostest` and other expect based tests |
|
||||
| [fx2](fx2) | firmware for Cypress FX2 USB interface |
|
||||
| [make](make) | make includes |
|
||||
| [man](man) | man pages |
|
||||
|
||||
116
tools/bin/ostest
Executable file
116
tools/bin/ostest
Executable file
@ -0,0 +1,116 @@
|
||||
#! /usr/bin/env tclsh
|
||||
# -*- tcl -*-
|
||||
# $Id: ostest 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-20 1194 1.2 use per os namespace
|
||||
# 2019-07-13 1187 1.1 add kit_setup script support
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-09 1162 0.1 First draft
|
||||
#
|
||||
|
||||
lappend auto_path [file join $env(RETROBASE) tools tcl]
|
||||
|
||||
package require Expect
|
||||
package require exptest
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc dokit {kit} {
|
||||
|
||||
# cleanup kit context left-overs
|
||||
et_tenv_cleanup
|
||||
|
||||
# setup new kit context
|
||||
et_prttesthead $kit
|
||||
array set ::tenv { FAIL 0}
|
||||
set ::tenv(kit) $kit
|
||||
set ::tenv(dsk_setup) "${kit}_setup"
|
||||
set ::tenv(boot_rri) "${kit}_boot.tcl"
|
||||
set ::tenv(boot_simh) "${kit}_boot.scmd"
|
||||
|
||||
set base_kit "$::env(RETROBASE)/tools/oskit/test/kit"
|
||||
if {[catch {cd $base_kit}]} { error "$base_kit not existing" }
|
||||
set kit_setup_fname "${kit}_setup.tcl"
|
||||
if {[catch {source $kit_setup_fname} emsg]} {
|
||||
error "failed to setup kit '$kit': \n$emsg"
|
||||
}
|
||||
|
||||
putl [et_parray ::tenv]
|
||||
putl "-----"
|
||||
putl ""
|
||||
|
||||
if {![info exists ::tenv(namespace)]} {
|
||||
error "no os namespace defined for kit '$kit'"
|
||||
}
|
||||
if {![info exists ::tenv(proc_boot)]} {
|
||||
error "no boot proc defined for kit '$kit'"
|
||||
}
|
||||
if {![info exists ::tenv(proc_halt)]} {
|
||||
error "no halt proc defined for kit '$kit'"
|
||||
}
|
||||
if {![info exists ::tenv(procs_test)] || [llength ::tenv(procs_test)] == 0} {
|
||||
error "no test procs for defined for kit '$kit'"
|
||||
}
|
||||
|
||||
set quitkit 0
|
||||
if {[info exists ::tenv(procs_preboot)]} {
|
||||
foreach pnam $::tenv(procs_preboot) {
|
||||
if {[$pnam]} { set quitkit 1 }
|
||||
}
|
||||
}
|
||||
if {$quitkit} {
|
||||
putb "-I: skip kit '$kit'"
|
||||
return
|
||||
}
|
||||
|
||||
set base_oskit "$::env(RETROBASE)/tools/oskit/$kit"
|
||||
if {[catch {cd $base_oskit}]} { error "$base_oskit not existing" }
|
||||
|
||||
if {[file executable $::tenv(dsk_setup)]} {
|
||||
putl "$::tenv(dsk_setup)"
|
||||
putl [exec ./$::tenv(dsk_setup)]
|
||||
putl "-----"
|
||||
putl ""
|
||||
}
|
||||
|
||||
et_dostep sv_boot
|
||||
if {$::tenv(FAIL)} {return}
|
||||
|
||||
et_dostep $::tenv(proc_boot)
|
||||
if {$::tenv(FAIL)} {return}
|
||||
foreach step $::tenv(procs_test) {
|
||||
et_dostep $step
|
||||
}
|
||||
et_dostep $::tenv(proc_halt)
|
||||
|
||||
et_dostep sv_halt
|
||||
et_close_allterm
|
||||
|
||||
putl ""
|
||||
putl "-----"
|
||||
putl [et_parray ::tenv "c_*"]
|
||||
putl ""
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
# main program code
|
||||
|
||||
et_init; # basic init, load mode
|
||||
et_init2 $et_oskitdef; # setup tests;
|
||||
et_prtrunhead; # print run header
|
||||
et_config; # configure sys if requested
|
||||
|
||||
# and execute kit tests
|
||||
foreach kit $et_tests {
|
||||
incr ::genv(FAIL) [et_cmdl dokit $kit]
|
||||
incr ::genv(FAIL) $::tenv(FAIL)
|
||||
}
|
||||
|
||||
exit [expr {$::genv(FAIL) ? 1 : 0}]
|
||||
16
tools/exptest/sys/mcode_setup.tcl
Normal file
16
tools/exptest/sys/mcode_setup.tcl
Normal file
@ -0,0 +1,16 @@
|
||||
# $Id: mcode_setup.tcl 1193 2019-07-14 08:36:20Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 0.1 First draft
|
||||
#---
|
||||
# setup for mcode tests
|
||||
#
|
||||
|
||||
lappend ::et_mcodedef "dl11echo"
|
||||
# lappend ::et_mcodedef "dz11echo"
|
||||
# lappend ::et_mcodedef "pc11test"
|
||||
# lappend ::et_mcodedef "lp11test"
|
||||
# lappend ::et_mcodedef "tm11test"
|
||||
19
tools/exptest/sys/ostest_bigmem_setup.tcl
Normal file
19
tools/exptest/sys/ostest_bigmem_setup.tcl
Normal file
@ -0,0 +1,19 @@
|
||||
# $Id: ostest_bigmem_setup.tcl 1174 2019-06-29 18:00:47Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#---
|
||||
# setup for big memory systems (>= 1MB)
|
||||
#
|
||||
|
||||
source ostest_midmem_setup.tcl
|
||||
#
|
||||
lappend ::et_oskitdef "211bsd_rk"
|
||||
lappend ::et_oskitdef "211bsd_rl"
|
||||
lappend ::et_oskitdef "211bsd_rp"
|
||||
#
|
||||
lappend ::et_oskitdef "211bsd_rpeth"
|
||||
16
tools/exptest/sys/ostest_midmem_setup.tcl
Normal file
16
tools/exptest/sys/ostest_midmem_setup.tcl
Normal file
@ -0,0 +1,16 @@
|
||||
# $Id: ostest_midmem_setup.tcl 1174 2019-06-29 18:00:47Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#---
|
||||
# setup for mid-size memory systems (>0.5 MB and <1MB)
|
||||
#
|
||||
|
||||
source ostest_minmem_setup.tcl
|
||||
#
|
||||
lappend ::et_oskitdef "211bsd_rpmin"
|
||||
#
|
||||
15
tools/exptest/sys/ostest_minmem_setup.tcl
Normal file
15
tools/exptest/sys/ostest_minmem_setup.tcl
Normal file
@ -0,0 +1,15 @@
|
||||
# $Id: ostest_minmem_setup.tcl 1174 2019-06-29 18:00:47Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#---
|
||||
# setup for small memory systems (<0.5 MB)
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
#lappend ::et_oskitdef "xxdp_rl"
|
||||
16
tools/exptest/sys/sys_w11a_arty_setup.tcl
Normal file
16
tools/exptest/sys/sys_w11a_arty_setup.tcl
Normal file
@ -0,0 +1,16 @@
|
||||
# $Id: sys_w11a_arty_setup.tcl 1193 2019-07-14 08:36:20Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-16 1165 0.1 First draft
|
||||
#---
|
||||
# setup for sys_w11a_arty
|
||||
#
|
||||
set ::genv(rri_opt) "-tuD,12M,break,xon"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/arty"
|
||||
source ostest_bigmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
17
tools/exptest/sys/sys_w11a_b3_setup.tcl
Normal file
17
tools/exptest/sys/sys_w11a_b3_setup.tcl
Normal file
@ -0,0 +1,17 @@
|
||||
# $Id: sys_w11a_b3_setup.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-16 1165 0.1 First draft
|
||||
#---
|
||||
# setup for sys_w11a_b3
|
||||
#
|
||||
set ::genv(rri_opt) "-tuD,12M,break,xon"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/basys3"
|
||||
set ::genv(memsize) 176
|
||||
source ostest_minmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
17
tools/exptest/sys/sys_w11a_c7_setup.tcl
Normal file
17
tools/exptest/sys/sys_w11a_c7_setup.tcl
Normal file
@ -0,0 +1,17 @@
|
||||
# $Id: sys_w11a_c7_setup.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-16 1165 0.1 First draft
|
||||
#---
|
||||
# setup for sys_w11a_c7
|
||||
#
|
||||
set ::genv(rri_opt) "-tuD,12M,break,xon"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/cmoda7"
|
||||
set ::genv(memsize) 672
|
||||
source ostest_midmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
17
tools/exptest/sys/sys_w11a_n2_setup.tcl
Normal file
17
tools/exptest/sys/sys_w11a_n2_setup.tcl
Normal file
@ -0,0 +1,17 @@
|
||||
# $Id: sys_w11a_n2_setup.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
#---
|
||||
# setup for sys_w11a_n2
|
||||
#
|
||||
set ::genv(xil_ide) "ise"
|
||||
set ::genv(rri_opt) "-u"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/nexys2"
|
||||
set ::genv(memsize) 3840
|
||||
source ostest_bigmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
17
tools/exptest/sys/sys_w11a_n3_setup.tcl
Normal file
17
tools/exptest/sys/sys_w11a_n3_setup.tcl
Normal file
@ -0,0 +1,17 @@
|
||||
# $Id: sys_w11a_n3_setup.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
#---
|
||||
# setup for sys_w11a_n3
|
||||
#
|
||||
set ::genv(xil_ide) "ise"
|
||||
set ::genv(rri_opt) "-u"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/nexys3"
|
||||
set ::genv(memsize) 3840
|
||||
source ostest_bigmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
17
tools/exptest/sys/sys_w11a_n4_setup.tcl
Normal file
17
tools/exptest/sys/sys_w11a_n4_setup.tcl
Normal file
@ -0,0 +1,17 @@
|
||||
# $Id: sys_w11a_n4_setup.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mcode_setup
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#---
|
||||
# setup for sys_w11a_n4
|
||||
#
|
||||
set ::genv(rri_opt) "-tuD,12M,break,cts"
|
||||
set ::genv(sys_path) "rtl/sys_gen/w11a/nexys4"
|
||||
set ::genv(memsize) 3840
|
||||
source ostest_bigmem_setup.tcl
|
||||
source mcode_setup.tcl
|
||||
123
tools/man/man1/ostest.1
Normal file
123
tools/man/man1/ostest.1
Normal file
@ -0,0 +1,123 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" $Id: ostest.1 1196 2019-07-20 18:18:16Z mueller $
|
||||
.\" SPDX-License-Identifier: GPL-3.0-or-later
|
||||
.\" Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
.\"
|
||||
.\" ------------------------------------------------------------------
|
||||
.
|
||||
.TH OSTEST 1 2019-07-20 "Retro Project" "Retro Project Manual"
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH NAME
|
||||
ostest \- oskit test driver
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH SYNOPSIS
|
||||
.
|
||||
.SY ostest
|
||||
.RI [ OPTION ]...
|
||||
.RI [ TEST ]...
|
||||
.
|
||||
.SY ostest
|
||||
.B \-\-help
|
||||
.YS
|
||||
.
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH DESCRIPTION
|
||||
\fBostest\fP organizes the automatized testing of operating systems.
|
||||
It will
|
||||
|
||||
.RS 2
|
||||
.PD 0
|
||||
.IP "-" 2
|
||||
configure the connected board if the \fB\-\-config\fP option is specified
|
||||
.IP "-"
|
||||
determine, based on the available memory size, which operating systems
|
||||
can be run on the board.
|
||||
.IP "-"
|
||||
check for each eligible operating system whether the oskit and the
|
||||
required container files are available, and download or unpack them
|
||||
in case they aren't.
|
||||
.IP "-"
|
||||
boot each eligible operating system and execute a variety of system tests.
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
|
||||
.
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH OPTIONS
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-\-sys=\fIsys\fP"
|
||||
Defines the system which is configured, or in case the \fB\-\-config\fP
|
||||
is given, is to be configured.
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-\-mode=\fImode\fP"
|
||||
Defines the execution mode. The default is \fIrri\fP and currently the
|
||||
only supported mode.
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-\-log[=\fIfnam\fP]"
|
||||
The output is written to a logfile. In case no name is specified an
|
||||
automatically generated name will be used.
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-\-logu\fP"
|
||||
Show full session on \fIstdout\fP even when \fI\-\-log\fP is active.
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-\-config\fP"
|
||||
The connected board is configured with the system defined with the
|
||||
\fB\-\-sys\fP option or the \fBEXPTEST_SYS\fP environment variable.
|
||||
First is checked with a \fImake -n\fP whether the \fI<sys>.bit\fP file is
|
||||
available and up-to-date. The script is aborted if the test fails.
|
||||
.
|
||||
.\" ----------------------------------------------
|
||||
.IP "\fB\-help\fP"
|
||||
print full help text and exit.
|
||||
.
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH ENVIRONMENT
|
||||
.IP \fBEXPTEST_SYS\fP 4
|
||||
Defines the default system in case no \fB\-\-sys\fP option is given.
|
||||
.IP \fBRETROBASE\fP
|
||||
Defines root of all retro project files.
|
||||
.
|
||||
\" ------------------------------------------------------------------
|
||||
.SH FILES
|
||||
.IP "\fI$RETROBASE/tools/tcl/exptest_<mode>.tcl\fP" 4
|
||||
Implementation for mode \fImode\fP.
|
||||
.IP "\fI$RETROBASE/tools/exptest/sys/<sys>_setup.tcl\fP"
|
||||
Setup file for system \fIsys\fP.
|
||||
.IP "\fI$RETROBASE/tools/oskit/test/kit/<kit>_setup.tcl\fP"
|
||||
Setup file for oskit \fIkit\fP.
|
||||
.IP "\fI$RETROBASE/tools/oskit/test/os/<os>/\fP"
|
||||
Path for ostest environment for os \fIos\fP.
|
||||
.IP "\fI$RETROBASE/tools/oskit/<kit>/\fP"
|
||||
Path for execution environment for oskit \fIkit\fP.
|
||||
|
||||
.
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH EXAMPLES
|
||||
.IP "\fBostest --sys=sys_w11a_n4 -log\fP" 4
|
||||
This command expects that a Digilent Nexys4 board is connected and already
|
||||
configured with the \fIsys_w11a_n4\fP system. It will run tests for all
|
||||
available operating systems and produce an output like
|
||||
|
||||
.EX
|
||||
-I: log to ostest-2019-07-13-151006-sys_w11a_n4.log
|
||||
----- 15:10:06 ( 0.0, 0.0): 211bsd_rpmin
|
||||
----- 15:10:34 ( 27.9, 27.9): 211bsd_rk
|
||||
----- 15:11:00 ( 53.9, 26.0): 211bsd_rl
|
||||
----- 15:11:27 ( 80.7, 26.8): 211bsd_rp
|
||||
----- 15:11:55 ( 109.0, 28.3): 211bsd_rpeth
|
||||
-I: 'tap0' device required but not available
|
||||
-I: skip kit '211bsd_rpeth'
|
||||
.EE
|
||||
|
||||
The \fI211bsd_rpeth\fP test was skipped because preconditions were not
|
||||
fulfilled.
|
||||
|
||||
.\" ------------------------------------------------------------------
|
||||
.SH AUTHOR
|
||||
Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
@ -4,6 +4,7 @@ This directory tree contains **OS disk/tape image kits** and is organized in
|
||||
| --------- | ------- |
|
||||
| [doc](doc) | auxiliary documentation |
|
||||
| [hook](hook) | `ti_w11` startup hook files |
|
||||
| [test](test) | `ostest` configuration files |
|
||||
| _all other_ | folders with individual OS kits |
|
||||
|
||||
The available OS kits are summarized in the table below with
|
||||
|
||||
11
tools/oskit/test/kit/211bsd_rk_setup.tcl
Normal file
11
tools/oskit/test/kit/211bsd_rk_setup.tcl
Normal file
@ -0,0 +1,11 @@
|
||||
# $Id: 211bsd_rk_setup.tcl 1166 2019-06-20 07:24:48Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-10 1162 1.0 Initial version
|
||||
#---
|
||||
# kit setup for 211bsd_rk
|
||||
#
|
||||
source ../os/211bsd/211bsd_base.tcl
|
||||
11
tools/oskit/test/kit/211bsd_rl_setup.tcl
Normal file
11
tools/oskit/test/kit/211bsd_rl_setup.tcl
Normal file
@ -0,0 +1,11 @@
|
||||
# $Id: 211bsd_rl_setup.tcl 1166 2019-06-20 07:24:48Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-10 1162 1.0 Initial version
|
||||
#---
|
||||
# kit setup for 211bsd_rl
|
||||
#
|
||||
source ../os/211bsd/211bsd_base.tcl
|
||||
11
tools/oskit/test/kit/211bsd_rp_setup.tcl
Normal file
11
tools/oskit/test/kit/211bsd_rp_setup.tcl
Normal file
@ -0,0 +1,11 @@
|
||||
# $Id: 211bsd_rp_setup.tcl 1166 2019-06-20 07:24:48Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-10 1162 1.0 Initial version
|
||||
#---
|
||||
# kit setup for 211bsd_rp
|
||||
#
|
||||
source ../os/211bsd/211bsd_base.tcl
|
||||
12
tools/oskit/test/kit/211bsd_rpeth_setup.tcl
Normal file
12
tools/oskit/test/kit/211bsd_rpeth_setup.tcl
Normal file
@ -0,0 +1,12 @@
|
||||
# $Id: 211bsd_rpeth_setup.tcl 1166 2019-06-20 07:24:48Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-15 1163 1.0 Initial version
|
||||
#---
|
||||
# kit setup for 211bsd_rpeth
|
||||
#
|
||||
source ../os/211bsd/211bsd_base.tcl
|
||||
source ../os/211bsd/211bsd_eth.tcl
|
||||
11
tools/oskit/test/kit/211bsd_rpmin_setup.tcl
Normal file
11
tools/oskit/test/kit/211bsd_rpmin_setup.tcl
Normal file
@ -0,0 +1,11 @@
|
||||
# $Id: 211bsd_rpmin_setup.tcl 1166 2019-06-20 07:24:48Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-06-10 1162 1.0 Initial version
|
||||
#---
|
||||
# kit setup for 211bsd_rpmin
|
||||
#
|
||||
source ../os/211bsd/211bsd_base.tcl
|
||||
66
tools/oskit/test/os/211bsd/211bsd_base.tcl
Normal file
66
tools/oskit/test/os/211bsd/211bsd_base.tcl
Normal file
@ -0,0 +1,66 @@
|
||||
# $Id: 211bsd_base.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-20 1196 1.1 Use os namespace 211bsd
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#---
|
||||
# basic procs for 211bsd tests
|
||||
#
|
||||
|
||||
set ::tenv(namespace) "211bsd"; # os namespace
|
||||
set ::tenv(os_kpr) "\[\n\r\]+# "; # kernel prompt
|
||||
set ::tenv(os_upr) "\[\n\r\]+$ "; # user prompt
|
||||
|
||||
namespace eval 211bsd {
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
set ::tenv(proc_boot) "211bsd::boot"
|
||||
proc boot {} {
|
||||
et_spawn_term "tta0"
|
||||
et_exp e "70Boot from (.+?) at" ct1 bootdev
|
||||
et_exp e ": " s "\r"
|
||||
et_exp e "phys mem = (\[0-9\]+)\n" ct1 pmem
|
||||
et_exp e "avail mem = (\[0-9\]+)\n" ct1 amem
|
||||
et_exp e "user mem = (\[0-9\]+)\n" ct1 umem
|
||||
et_exp t 30 e $::tenv(os_kpr) s "\004"
|
||||
et_exp t 30 e "login:" s "root\r"
|
||||
et_exp t 10 e "# "
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
set ::tenv(proc_halt) "211bsd::halt"
|
||||
proc halt {} {
|
||||
et_exp i $::tenv(sid_tta0)
|
||||
et_exp s "\r" e $::tenv(os_kpr)
|
||||
et_exp s "halt\r"
|
||||
et_exp t 30 e "syncing disks"
|
||||
et_exp t 10 e "halting"
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
lappend ::tenv(procs_test) "211bsd::test_basic"
|
||||
proc test_basic {} {
|
||||
et_exp i $::tenv(sid_tta0)
|
||||
et_exp s "mount\r"
|
||||
et_exp e "(/dev/\[a-z0-9\]+?) on /" ct1 rootdev
|
||||
et_exp e $::tenv(os_kpr)
|
||||
et_exp s "pstat -T\r"
|
||||
et_exp e "swapmap entries"
|
||||
et_exp e "coremap entries"
|
||||
et_exp e "ub_map entries"
|
||||
et_exp e $::tenv(os_kpr)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
61
tools/oskit/test/os/211bsd/211bsd_eth.tcl
Normal file
61
tools/oskit/test/os/211bsd/211bsd_eth.tcl
Normal file
@ -0,0 +1,61 @@
|
||||
# $Id: 211bsd_eth.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-20 1196 1.1 Use os namespace 211bsd
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-10 1163 0.1 First draft
|
||||
#---
|
||||
# basic procs for 211bsd eth tests
|
||||
#
|
||||
|
||||
set ::tenv(ip_addr) "192.168.178.150"; # w11 system ip address
|
||||
|
||||
namespace eval 211bsd {
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
lappend ::tenv(procs_preboot) "211bsd::eth_preboot"
|
||||
proc eth_preboot {} {
|
||||
et_spawn "if_tst" ifconfig
|
||||
set rc 1
|
||||
expect {
|
||||
-re "tap0 +Link" { set rc 0; exp_continue}
|
||||
eof { }
|
||||
}
|
||||
et_close "if_tst"
|
||||
|
||||
if ($rc) { puts "-I: 'tap0' device required but not available" }
|
||||
|
||||
return $rc
|
||||
}
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
lappend ::tenv(procs_test) "211bsd::eth_test_basic"
|
||||
proc eth_test_basic {} {
|
||||
et_spawn "pty0" telnet $::tenv(ip_addr)
|
||||
et_exp e "Trying"
|
||||
et_exp e "Connected to"
|
||||
et_exp e "Escape character is"
|
||||
et_exp e "2.11 BSD UNIX"
|
||||
et_exp e "login: " s "root\r"
|
||||
et_exp e $::tenv(os_kpr)
|
||||
et_exp s "ps -aux\r"
|
||||
et_exp e "telnetd"
|
||||
et_exp e $::tenv(os_kpr)
|
||||
et_exp s "who\r"
|
||||
et_exp e "root +ttyp"
|
||||
et_exp e $::tenv(os_kpr)
|
||||
et_exp s "\004"
|
||||
et_exp e "Connection closed by foreign host"
|
||||
et_exp e eof
|
||||
et_close "pty0"
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
356
tools/tcl/exptest/util.tcl
Normal file
356
tools/tcl/exptest/util.tcl
Normal file
@ -0,0 +1,356 @@
|
||||
# $Id: util.tcl 1196 2019-07-20 18:18:16Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-20 1196 1.0.1 et_tenv_cleanup: use test namespaces
|
||||
# 2019-06-29 1174 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#
|
||||
|
||||
package provide exptest 1.0
|
||||
|
||||
package require Expect
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
# global defs
|
||||
|
||||
array set opts {
|
||||
sys_ ""
|
||||
mode_ "rri"
|
||||
log 0
|
||||
log_ ""
|
||||
logu 0
|
||||
config 0
|
||||
help 0
|
||||
}
|
||||
|
||||
array set genv {
|
||||
FAIL 0
|
||||
}
|
||||
|
||||
set et_args {}
|
||||
set et_tests {}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc bailout {msg} {
|
||||
set cmd [file tail $::argv0]
|
||||
puts "$cmd-E: $msg"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc putl {msg} {
|
||||
if { $::opts(log) } { send_log -- "$msg\n" } else { puts "$msg" }
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc putb {msg} {
|
||||
if { $::opts(log) } { send_log -- "$msg\n" }; puts "$msg"
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_init {} {
|
||||
global opts; # for brevity of code
|
||||
|
||||
set ::genv(iwd) [pwd]
|
||||
set ::genv(cmd) [file tail $::argv0]
|
||||
|
||||
if {[info exists ::env(EXPTEST_SYS)]} {set opts(sys_) $::env(EXPTEST_SYS)}
|
||||
|
||||
# process command arguments
|
||||
foreach arg $::argv {
|
||||
switch -regexp -- $arg {
|
||||
^--?sys=.+$ { regexp -- {=(.*)} $arg dummy opts(sys_) }
|
||||
^--?mode=.+$ { regexp -- {=(.*)} $arg dummy opts(mode_) }
|
||||
^--?logu$ { set opts(logu) 1 }
|
||||
^--?log=?.*$ { set opts(log) 1; regexp -- {=(.*)} $arg dummy opts(log_) }
|
||||
^--?config$ { set opts(config) 1 }
|
||||
^--?help$ { set opts(help) 1 }
|
||||
^--?.+$ { bailout "bad option $arg, use --help" }
|
||||
default { lappend ::et_args $arg }
|
||||
}
|
||||
}
|
||||
# handle --help
|
||||
if { $opts(help) } { et_help; exit 0 }
|
||||
|
||||
# basic checks
|
||||
if {![info exists ::env(RETROBASE)]} { bailout "\$RETROBASE not defined" }
|
||||
if {$opts(sys_) eq ""} { bailout "system not defined, use --sys" }
|
||||
|
||||
# initialize mode, load associated package
|
||||
set pack_mode "exptest_$opts(mode_)"
|
||||
if {![file isdirectory "$::env(RETROBASE)/tools/tcl/$pack_mode"]} {
|
||||
bailout "mode '$opts(mode_)' not defined"
|
||||
}
|
||||
package require $pack_mode
|
||||
|
||||
# initialize system
|
||||
set base_sys "$::env(RETROBASE)/tools/exptest/sys"
|
||||
|
||||
if {[catch {cd $base_sys}]} { bailout "$base_sys not existing" }
|
||||
|
||||
set sys_setup_fname "$opts(sys_)_setup.tcl"
|
||||
if {![file readable $sys_setup_fname]} {
|
||||
bailout "not setup file found for '$opts(sys_)'"
|
||||
}
|
||||
|
||||
if {[catch {source $sys_setup_fname} emsg]} {
|
||||
bailout "failed to setup sys '$opts(sys_)': \n$emsg"
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_init2 {deflist} {
|
||||
if {[llength $::et_args] == 0} { set ::et_args "*" }
|
||||
foreach arg $::et_args {
|
||||
if {[string first "*" $arg] >= 0} {
|
||||
foreach tst $deflist {
|
||||
if {[string match $arg $tst]} { lappend ::et_tests $tst }
|
||||
}
|
||||
} else {
|
||||
lappend ::et_tests $arg
|
||||
}
|
||||
}
|
||||
|
||||
if {[llength $::et_tests] == 0} {
|
||||
puts "$::genv(cmd)-I: no tests selected, nothing to do"
|
||||
exit 0
|
||||
}
|
||||
|
||||
et_setlog $::genv(cmd)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_prtrunhead {} {
|
||||
set ::et_timerun [clock milliseconds]
|
||||
set ::et_timetest $::et_timerun
|
||||
putl "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
putl "----- run setup"
|
||||
putl [et_parray ::opts]
|
||||
putl [et_parray ::genv]
|
||||
putl ""
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_prttesthead {tnam} {
|
||||
set now [clock milliseconds]
|
||||
set dt [expr {$now - $::et_timetest}]
|
||||
putl "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
putb [format "----- %s (%6.1f,%6.1f): $tnam" \
|
||||
[clock format [clock seconds] -format %T] \
|
||||
[expr {($now-$::et_timerun)/1000.}] \
|
||||
[expr {($now-$::et_timetest)/1000.}] ]
|
||||
set ::et_timetest [clock milliseconds]
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_config {} {
|
||||
if {!$::opts(config)} { return }
|
||||
if {[info procs sv_config] eq ""} {
|
||||
bailout "--config not supported on mode $::opts(mode_)"
|
||||
}
|
||||
et_prttesthead "-config"
|
||||
if {[et_cmdl sv_config]} { exit 1}
|
||||
putl ""
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_help {} {
|
||||
# use {} as delimiter here to avoid escaping of all []
|
||||
puts "usage: $::genv(cmd) \[OPTION\]... \[TEST\]..."
|
||||
puts {}
|
||||
puts {Options:}
|
||||
puts { --sys=SNAME system name, e.g. sys_w11a_n4. Default is taken from}
|
||||
puts { $EXPTEST_SYS environment variable}
|
||||
puts { --mode=MODE currently 'rri' the only option}
|
||||
puts { --log[=FNAM] log session to file FNAM}
|
||||
puts { --logu show session on stdout even when --log active}
|
||||
puts { --config configure FPGA}
|
||||
puts { --help display this help and exit}
|
||||
puts {}
|
||||
puts "For further details consults the $::genv(cmd) man page."
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_parray {a {pattern *}} {
|
||||
upvar 1 $a array
|
||||
set res ""
|
||||
set maxl 0
|
||||
set names [lsort [array names array $pattern]]
|
||||
foreach name $names { set maxl [expr { max($maxl,[string length $name]) }] }
|
||||
set maxl [expr {$maxl + [string length $a] + 2}]
|
||||
foreach name $names {
|
||||
set nameString [format %s(%s) $a $name]
|
||||
if { $res ne "" } {append res "\n"}
|
||||
append res [format "%-*s = %s" $maxl $nameString $array($name)]
|
||||
}
|
||||
return $res
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_setlog {pref} {
|
||||
if { $::opts(log) } {
|
||||
if { $::opts(log_) eq "" } {
|
||||
set tnow [clock seconds]
|
||||
append ::opts(log_) "$pref-"
|
||||
append ::opts(log_) [clock format $tnow -format "%Y-%m-%d-%H%M%S"]
|
||||
append ::opts(log_) "-$::opts(sys_).log"
|
||||
puts "-I: log to $::opts(log_)"
|
||||
}
|
||||
log_file -a -noappend "$::genv(iwd)/$::opts(log_)"
|
||||
log_user $::opts(logu)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_spawn {id args} {
|
||||
global spawn_id; # ensure that spawn uses global spawn_id
|
||||
spawn {*}$args
|
||||
set ::tenv(sid_$id) $spawn_id
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_spawn_term {port} {
|
||||
et_spawn $port telnet localhost $::sv_pmap($port)
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_close_allterm {} {
|
||||
foreach sid [array names ::tenv sid_tt*] {
|
||||
et_exp i $::tenv($sid)
|
||||
et_exp e eof
|
||||
wait -i $::tenv($sid)
|
||||
unset ::tenv($sid)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_close {id} {
|
||||
wait -i $::tenv(sid_$id)
|
||||
unset ::tenv(sid_$id)
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_exp {args} {
|
||||
set ::timeout 10.
|
||||
foreach {cmd val} $args {
|
||||
switch -glob -- $cmd {
|
||||
i { set ::spawn_id $val }
|
||||
t { set ::timeout $val }
|
||||
s { send $val }
|
||||
e { if {$val eq "eof"} {
|
||||
expect {
|
||||
eof { }
|
||||
timeout { error "FAIL: missed 'eof'" }
|
||||
}
|
||||
} else {
|
||||
expect {
|
||||
-re $val { }
|
||||
eof { error "FAIL: unexpected 'eof' seen" }
|
||||
timeout { error "FAIL: missed '$val'" }
|
||||
}
|
||||
}
|
||||
}
|
||||
ct[0-9] { set slot [string range $cmd 2 2]
|
||||
set ::tenv(c_$val) $expect_out($slot,string) }
|
||||
cg[0-9] { set slot [string range $cmd 2 2]
|
||||
set ::genv(c_$val) $expect_out($slot,string) }
|
||||
default { error "invalid et_exp option '$cmd'" }
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_cmd {cmd args} {
|
||||
if { [catch {$cmd {*}$args} msg]} {
|
||||
puts "$cmd-E: $msg"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_cmdl {cmd args} {
|
||||
if { [catch {$cmd {*}$args} msg]} {
|
||||
putl ""
|
||||
putl "--------------------------------------------------"
|
||||
putb "$cmd FAILed with '$msg'"
|
||||
putl "--------------------------------------------------"
|
||||
putl $::errorInfo
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_dostep {cmd args} {
|
||||
if {[et_cmdl $cmd {*}$args]} { incr ::tenv(FAIL) }
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc et_tenv_cleanup {} {
|
||||
if {[info exists ::tenv]} {
|
||||
if {[info exists ::tenv(namespace)]} {
|
||||
namespace delete $::tenv(namespace)
|
||||
}
|
||||
unset ::tenv
|
||||
}
|
||||
}
|
||||
153
tools/tcl/exptest_rri/util.tcl
Normal file
153
tools/tcl/exptest_rri/util.tcl
Normal file
@ -0,0 +1,153 @@
|
||||
# $Id: util.tcl 1197 2019-07-27 10:03:21Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# Revision History:
|
||||
# Date Rev Version Comment
|
||||
# 2019-07-13 1193 1.1 add mctest support (sv_{start,stop,load,cmd})
|
||||
# 2019-06-29 1173 1.0 Initial version
|
||||
# 2019-06-10 1162 0.1 First draft
|
||||
#
|
||||
|
||||
package provide exptest_rri 1.0
|
||||
|
||||
array set sv_pmap {
|
||||
"tta0" 8000
|
||||
"tta1" 8001
|
||||
"dza0" 8002
|
||||
"dza1" 8003
|
||||
"dza2" 8004
|
||||
"dza3" 8005
|
||||
"dza4" 8006
|
||||
"dza5" 8007
|
||||
"dza6" 8008
|
||||
"dza7" 8009
|
||||
}
|
||||
|
||||
set ::genv(xil_ide) "viv"; # 'viv' is default, 'ise' alternative
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_start {} {
|
||||
et_spawn "sv" ti_w11 $::genv(rri_opt)
|
||||
et_exp e "\ncpu0> "
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_stop {} {
|
||||
et_exp i $::tenv(sid_sv)
|
||||
et_exp s "\r" e "cpu0> "
|
||||
et_exp s ".qq\r" e eof
|
||||
et_close "sv"
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_load {file} {
|
||||
et_exp i $::tenv(sid_sv)
|
||||
et_exp s "cpu0 ldasm -file $file -sym ldasm_sym -lst ldasm_lst\r" e "cpu0> "
|
||||
et_exp s "cpu0 cp -stapc \$ldasm_sym(...end)\r" e "cpu0> "
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_cmd {cmd} {
|
||||
et_exp s "$cmd\r" e "cpu0> "
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_boot {} {
|
||||
et_spawn "sv" ti_w11 $::genv(rri_opt)
|
||||
et_exp e "\ncpu0> "
|
||||
et_exp s "source ../hook/hook_disk_over.tcl\r" e "\ncpu0> "
|
||||
et_exp s "@$::tenv(boot_rri)\r" e "\ncpu0> "
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_halt {} {
|
||||
et_exp i $::tenv(sid_sv)
|
||||
et_exp t 60 e "CPU attention"
|
||||
et_exp e "rust: 01 HALTed"
|
||||
et_exp s "\r" e "cpu0> "
|
||||
et_exp s ".qq\r" e eof
|
||||
et_close "sv"
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_config {} {
|
||||
set base_conf "$::env(RETROBASE)/$::genv(sys_path)"
|
||||
if {[catch {cd $base_conf}]} { bailout "$base_conf not existing" }
|
||||
|
||||
switch -- $::genv(xil_ide) {
|
||||
viv { sv_config_viv }
|
||||
ise { sv_config_ise }
|
||||
default { bailout "unsuported IDE '$::genv(xil_ide)'" }
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_config_viv {} {
|
||||
et_spawn "conf_tst" make -n $::opts(sys_).bit
|
||||
expect {
|
||||
"vivado" {
|
||||
bailout "$::opts(sys_).bit not existing or not up-to-date; abort"
|
||||
}
|
||||
"is up to date" {}
|
||||
eof { error "FAIL: make bit: unexpected 'eof' seen" }
|
||||
timeout { error "FAIL: make bit: unexpected timeout seen" }
|
||||
}
|
||||
et_exp e eof
|
||||
et_close "conf_tst"
|
||||
|
||||
et_spawn "conf_act" make $::opts(sys_).vconfig
|
||||
et_exp t 120 e "USR_ACCESS: 0x\[0-9a-f\]+ *(\[0-9: -\]+?)" cg1 USRACC
|
||||
et_exp t 10 e eof
|
||||
et_close "conf_act"
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
proc sv_config_ise {} {
|
||||
et_spawn "conf_tst" make -n $::opts(sys_).bit
|
||||
expect {
|
||||
"ise" {
|
||||
bailout "$::opts(sys_).bit not existing or not up-to-date; abort"
|
||||
}
|
||||
"is up to date" {}
|
||||
eof { error "FAIL: make bit: unexpected 'eof' seen" }
|
||||
timeout { error "FAIL: make bit: unexpected timeout seen" }
|
||||
}
|
||||
et_exp e eof
|
||||
et_close "conf_tst"
|
||||
|
||||
et_spawn "conf_act" make $::opts(sys_).jconfig
|
||||
et_exp t 120 e "xtwi config_wrapper"
|
||||
et_exp t 60 e eof
|
||||
et_close "conf_act"
|
||||
|
||||
return
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
#! /usr/bin/env tclshcpp
|
||||
# $Id: setup_packages 1146 2019-05-05 06:25:13Z mueller $
|
||||
# $Id: setup_packages 1194 2019-07-20 07:43:21Z mueller $
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2011-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
#
|
||||
# pkg_mkIndex uses tclLog to write, which by default writes to stderr
|
||||
# this is 'make -s' unfriendly, so redefined tclLog to use plain puts
|
||||
@ -14,6 +16,9 @@ pkg_mkIndex -verbose ../lib \
|
||||
librutiltpp.so \
|
||||
librwxxtpp.so
|
||||
#
|
||||
pkg_mkIndex -verbose exptest *.tcl
|
||||
pkg_mkIndex -verbose exptest_rri *.tcl
|
||||
#
|
||||
pkg_mkIndex -verbose rutil *.tcl
|
||||
pkg_mkIndex -verbose rlink *.tcl
|
||||
pkg_mkIndex -verbose rbtest *.tcl
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user