From f2ced63b0d2c8d208743fce2b63bc5f60c1fc5a3 Mon Sep 17 00:00:00 2001 From: wfjm Date: Sun, 10 Jul 2022 12:29:41 +0200 Subject: [PATCH] tbrun_tbwrri and ti_w11 updates - tbrun_tbwrri: fully implement --r(l|b)mon - ti_w11: add -w and -to options --- doc/CHANGELOG.md | 3 ++- tools/bin/tbrun_tbwrri | 13 +++++++++++-- tools/bin/ti_w11 | 38 ++++++++++++++++++++++++++++++++++---- tools/man/man1/tbw.1 | 26 +++++++++++++++++++++----- tools/man/man1/ti_w11.1 | 25 +++++++++++++++++++------ 5 files changed, 87 insertions(+), 18 deletions(-) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 93ba942d..db27cc85 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -41,7 +41,8 @@ The full set of tests is only run for tagged releases. - **/tbrun.yml: since nexys4 not longer available switch to nexys4d - tools/bin - njobihtm: add -n and -h options - - ti_w11: update --help text, add -ar,-n4d,-bn4d + - tbrun_tbwrri: fully implement --r(l|b)mon + - ti_w11: update --help text, add -ar,-n4d,-bn4d; add -w and -to options - tmuconv: add DEUNA defs - tools/tcl - w11/tcodes.tcl: driver for tcode execution diff --git a/tools/bin/tbrun_tbwrri b/tools/bin/tbrun_tbwrri index 62f5b7a6..14fd3b3a 100755 --- a/tools/bin/tbrun_tbwrri +++ b/tools/bin/tbrun_tbwrri @@ -1,10 +1,11 @@ #!/bin/bash -# $Id: tbrun_tbwrri 1172 2019-06-29 07:27:24Z mueller $ +# $Id: tbrun_tbwrri 1250 2022-07-10 10:21:03Z mueller $ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2014-2019 by Walter F.J. Mueller +# Copyright 2014-2022 by Walter F.J. Mueller # # Revision History: # Date Rev Version Comment +# 2022-07-09 1250 1.3.4 fully implement --r(l|b)mon # 2016-09-17 808 1.3.3 add --r(l|b)mon,(b|s)wait; configure now via _conf= # 2016-09-03 805 1.3.2 add TIMEFORMAT and time for make commands # 2016-08-21 800 1.3.1 add -norun, -nomake @@ -187,6 +188,14 @@ if (( $waitns > 0 )) ; then conf+=".wait $waitns ns;" fi +if [[ -n "$optrlmon" ]] ; then + conf+=".rlmon 1;" # enable rlmom +fi + +if [[ -n "$optrbmon" ]] ; then + conf+=".rbmon 1;" # enable rbmom +fi + # now build actual test command cmdtb+="ti_rri --run=\"tbw $tbench -fifo" if [[ -n "$conf" ]] ; then cmdtb+=" '_conf={$conf}'"; fi diff --git a/tools/bin/ti_w11 b/tools/bin/ti_w11 index cbade09b..b9f2c991 100755 --- a/tools/bin/ti_w11 +++ b/tools/bin/ti_w11 @@ -1,10 +1,11 @@ #!/usr/bin/perl -w -# $Id: ti_w11 1248 2022-07-07 06:25:50Z mueller $ +# $Id: ti_w11 1250 2022-07-10 10:21:03Z mueller $ # SPDX-License-Identifier: GPL-3.0-or-later # Copyright 2013-2022 by Walter F.J. Mueller # # Revision History: # Date Rev Version Comment +# 2022-07-08 1250 1.4.6 add -w and -to options # 2022-07-06 1248 1.4.5 update --help text, add -ar,-n4d,-bn4d # 2019-04-19 1133 1.4.4 for -e use .end start address when available # 2019-01-04 1103 1.4.3 add -ar,-n4d (ddr versions) @@ -35,6 +36,7 @@ my $sysbase = "$ENV{RETROBASE}/rtl/sys_gen/w11a"; my $opt_dry; my $opt_b; +my $opt_w; my $opt_ns; my $opt_io = ''; my $opt_f = ''; @@ -76,6 +78,11 @@ while (scalar(@ARGV)) { $opt_b = 1; shift @ARGV; + } elsif ($curarg =~ m{^-w$} ) { # -w + $opt_b = 1; # -w implies -b + $opt_w = 1; + shift @ARGV; + } elsif ($curarg =~ m{^-ns$} ) { # -ns $opt_ns = 1; shift @ARGV; @@ -88,6 +95,15 @@ while (scalar(@ARGV)) { $opt_ghw = 1; shift @ARGV; + } elsif ($curarg =~ m{^-to$} ) { # -to + shift @ARGV; + if (scalar(@ARGV) == 0 || $ARGV[0] !~ /^[0-9]+\.?[0-9]*$/) { + print STDERR "ti_w11-E: no decimal value after -to\n"; + exit 1; + } + $opt_to = $ARGV[0]; + shift @ARGV; + } elsif ($curarg =~ m{^-s3$} ) { # -s3 (use -f2 by default) $opt_io = 'f'; $opt_f = '2'; @@ -255,8 +271,8 @@ if ($opt_io eq 'f') { exit 1; } -# setup timeout -if ($opt_io eq 'f') { +# setup default timeout +if ($opt_io eq 'f' && $opt_to eq '') { $opt_to = '120.'; # 120 sec timeout for simulation } @@ -334,6 +350,17 @@ if (defined $val_e) { push @arglist, @ticmds; # add commands from ARGV +# +# handle -w option +# +if ($opt_w) { + unless (defined $val_e) { + print STDERR "ti_w11-E: -w only allowed with -e\n"; + exit 1; + } + push @arglist, "rw11::asmwait cpu0 ldasm_sym $opt_to"; +} + # # find ti_rri executable # @@ -398,11 +425,14 @@ sub print_usage { print " -ll set rlink logging level to (using --logl=)\n"; print " -dl set rlink dump level to (using --dmpl=)\n"; print " -tl set rlink trace level to (using --tiol=)\n"; - print " -b batch mode\n"; + print " -to timeout for rlink and -w waits\n"; + print " -b batch mode (default is to start interactive session)\n"; + print " -w wait till CPU halted (used with -e, implies -b)\n"; print " -ns don't start w11 shell\n"; print " -e load and execute file\n"; print " file type '.mac': on the fly compile with asm-11\n"; print " any other file type: assume lda format\n"; + print " -dry dry run, prints the commands but doesn't execute\n"; print "\n"; print " either one of -c7,-ar,-arb, ... ,-n2,-s3 must be given -> sim run\n"; print " or one of -t or -u must be given -> fpga run\n"; diff --git a/tools/man/man1/tbw.1 b/tools/man/man1/tbw.1 index d2f7c081..5a51d17f 100644 --- a/tools/man/man1/tbw.1 +++ b/tools/man/man1/tbw.1 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" $Id: tbw.1 1238 2022-05-15 15:19:08Z mueller $ +.\" $Id: tbw.1 1250 2022-07-10 10:21:03Z mueller $ .\" SPDX-License-Identifier: GPL-3.0-or-later .\" Copyright 2013-2022 by Walter F.J. Mueller .\" @@ -61,6 +61,22 @@ In this case, the \fIFILEDEF\fP argument can be specified as 'tag=value' pairs where 'tag' refers to a generic name and 'value' gives the concrete file name. Useful when several input files are to be specified. . +.SS Using inline configurations +A \fIFILEDEF\fP argument can have the form 'tag={line1;line2;...}'. +In that case, a temporary file is created with the given lines and the name +of the temporary file is associated with the tag as described above. +This is often used in conjunction with the tag referring to the +configuration file. +This mechanism allows for rlink based test benches to +specify '.scntl', '.sdata', 'rlmon', 'rbmon', and '.wait' startup commands +on the \fBtbw\fP command line and is for example used by \fBtbrun_tbwrri\fP(1). +The '-sxon' option of \fBtbrun_tbwrri\fP(1) creates for example +.EX + _conf={.sdata 08 0002;.sdata 10 0002;} +.EE +which generates two 'simbus' configuration cycles before the simulation body +starts. +. .SS Test benches controlled with \fBti_rri\fP In this case, the communication between the test bench and the controlling \fBti_rri\fP is done via two named pipes (see \fBfifo\fP(7)). The test @@ -177,12 +193,12 @@ a setup like .SH EXAMPLES .SS Stimulus file based test benches Test benches are usually self-checking and produce a comprehensive log file. -For each checked response, the line contains the word \fICHECK\fP and either -an \fIOK\fP or a \fIFAIL\fP, in the latter case in general with an indication +For each checked response, the line contains the word "CHECK" and either +an "OK" or a "FAIL", in the latter case in general with an indication of what\'s wrong. Other unexpected behavior, like timeouts, will also result in a line -containing the word \fIFAIL\fP. -When the simulation stops a line with the word \fIDONE\fP is printed. +containing the word "FAIL". +When the simulation stops a line with the word "DONE" is printed. These test benches are usually run like .EX diff --git a/tools/man/man1/ti_w11.1 b/tools/man/man1/ti_w11.1 index 17cf3e18..5015670a 100644 --- a/tools/man/man1/ti_w11.1 +++ b/tools/man/man1/ti_w11.1 @@ -1,11 +1,11 @@ .\" -*- nroff -*- -.\" $Id: ti_w11.1 1237 2022-05-15 07:51:47Z mueller $ +.\" $Id: ti_w11.1 1250 2022-07-10 10:21:03Z mueller $ .\" SPDX-License-Identifier: GPL-3.0-or-later .\" Copyright 2013-2022 by Walter F.J. Mueller .\" .\" ------------------------------------------------------------------ . -.TH TI_W11 1 2019-01-04 "Retro Project" "Retro Project Manual" +.TH TI_W11 1 2022-07-08 "Retro Project" "Retro Project Manual" .\" ------------------------------------------------------------------ .SH NAME ti_w11 \- Quick starter for \fBti_rri\fP with \fBw11\fP CPU designs @@ -109,18 +109,25 @@ activate GHDL wave dump, will write a dump file with the name .PD . .SS "common options" -.IP \fB-ll\fIn\fR +.IP \fB-ll\fIn\fR 6 set rlink logging level to \fIn\fR (will issue a --logl=\fIn\fR). .IP \fB-dl\fIn\fR set rlink dump level to \fIn\fR (will issue a --dmpl=\fIn\fR). .IP \fB-tl\fIn\fR set rlink I/O trace level to \fIn\fR (will issue a --tiol=\fIn\fR). +.IP "\fB-to \fIval\fP" +set timeout for rlink and \fB-w\fP waits (default FPGA 10., sim 120.) .IP \fB-b\fR -batch mode +batch mode (default is to start interactive session) +.IP \fB-w\fP +wait till CPU halted (used with \fB-e\fP, implies \fB-b\fP) +.IP \fB-ns\fP +don't start w11 shell .IP "\fB-e \fR\fIfile\fR" load and execute \fIfile\fP. If the file type is '.mac' the file will be on the fly compiled with \fBasm-11\fP(1), for all other file types it is assumed that they are in \fBlda-11\fP(5) format. +Can be combined with \fB-w\fP wait for completion of code. .IP \fB-dry\fR dry run, prints the commands but doesn't execute . @@ -146,14 +153,20 @@ The typical way to start a Nexys4 board. .IP "\fBti_w11 -n3 -e $RETROBASE/tools/mcode/dl11/dl11echo.mac\fR" Will start the \fItb_w11a_n3\fP test bench in \fBghdl\fP(1), on the fly compile the \fIdz11echo.mac\fP test program with \fBasm-11\fP(1), load -and execute it. This little test code echos console input, just abort +and start it. This little test code echos console input, just abort with ^C if you have seen enough. + +.IP "\fBti_w11 -c7 -tmu -w -e $RETROBASE/tools/tcode/cpu_basics.mac\fR" +Will start the \fItb_w11a_c7\fP test bench in \fBghdl\fP(1), on the fly +compile the \fIcpu_basics.mac\fP test code with \fBasm-11\fP(1), load and +start it, wait for CPU halted, and finally terminate. A tmu trace is written +to file \fItmu_ofile\fP and can be analysed with \fBtmuconv\fP(1). . .\" ------------------------------------------------------------------ .SH "SEE ALSO" .BR ti_rri (1), .BR asm-11 (1), -.BR lda-11 (1) +.BR lda-11 (5) .\" ------------------------------------------------------------------ .SH AUTHOR