1
0
mirror of https://github.com/wfjm/w11.git synced 2026-03-10 04:54:26 +00:00

minor updates and code cosmetics

- asm-11_expect: skip data checks if dot not defined
- tbrun: print list of failed test after summary line
- RparseUrl: add DirName,FileName,FileStem,FileType
This commit is contained in:
wfjm
2019-06-10 15:37:46 +02:00
parent c575613867
commit 3925fb1cd9
12 changed files with 91 additions and 43 deletions

View File

@@ -32,6 +32,7 @@ The full set of tests is only run for tagged releases.
- 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()
- librtools/RparseUrl: add DirName,FileName,FileStem,FileType
- firmware changes
- sys_w11a_arty: down-rate to 72 MHz, viv 2019.1 fails with 75 MHz
- sys_w11a_*.vmfset: add new rule for vivado 2019.1

View File

@@ -1,9 +1,8 @@
# Summary of known differences and limitations for w11a CPU and systems
General issues are listed on a separate document
[README_known_issues.md](README_known_issues.md).
This file descibes differences and limitations of the w11 CPU and systems.
The issues of the w11 CPU and systems are listed in a separate document
[README_known_issues.md](README_known_issues.md).
### Table of content

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# $Id: asm-11_expect 1065 2018-11-04 11:32:06Z mueller $
# $Id: asm-11_expect 1152 2019-05-26 08:13:18Z mueller $
#
# Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -14,6 +14,7 @@
#
# Revision History:
# Date Rev Version Comment
# 2019-05-25 1152 1.1.1 skip data checks if dot not defined
# 2018-11-03 1065 1.1 add and use bailout; update exit code usage
# 2013-03-29 500 1.0 Initial version
# 2013-03-24 499 0.1 First draft
@@ -232,7 +233,7 @@ sub do_file {
}
}
if (scalar(@c_dat)) {
if (defined $dot && scalar(@c_dat)) {
my $nc = scalar(@c_dat);
$nc = scalar(@dat) if $nc < scalar(@dat);
for (my $i=0; $i<$nc; $i++) {

View File

@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
# $Id: tbrun 1103 2019-01-04 13:18:54Z mueller $
# $Id: tbrun 1159 2019-06-06 19:15:50Z mueller $
#
# Copyright 2016-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
@@ -14,6 +14,7 @@
#
# Revision History:
# Date Rev Version Comment
# 2019-06-04 1159 1.1.4 print list of failed test after summary line
# 2019-01-04 1103 1.1.3 add --list option
# 2018-12-29 1097 1.1.2 show correct 'found count' in summary message
# 2018-11-16 1069 1.1.1 add --all
@@ -64,7 +65,7 @@ my %keys_itest = ( test => { mode => 'm', ref => ''},
my $nseen = 0;
my $ntest = 0;
my $ndone = 0;
my $nfail = 0;
my @failedtags;
my $inicwd = getcwd();
my %gblvars;
@@ -136,15 +137,19 @@ if (defined $opts{dry}) {
tpr(sprintf "#tbrun-I: %d tests found, %d selected\n", $nseen,$ntest);
} else {
if ($nfail) {
tpr(sprintf "tbrun-I: %d tests failed of %d tests executed\n",$nfail,$ndone);
if (scalar(@failedtags)) {
tpr(sprintf "tbrun-I: %d tests failed of %d tests executed\n",
scalar(@failedtags),$ndone);
foreach (@failedtags) {
tpr(sprintf "tbrun-I: FAILED %s\n", $_);
}
} else {
tpr(sprintf "tbrun-I: all tests passed, %d tests selected from %d found\n",
$ndone,$nseen);
}
}
exit ($nfail ? 2 : 0);
exit (scalar(@failedtags) ? 2 : 0);
#-------------------------------------------------------------------------------
sub setup_tagfilter {
@@ -516,7 +521,7 @@ sub run_tests_single {
my $err = $?;
tpr(sprintf "tbrun-I: test FAILed with exit status %d,%d\n",
($err>>8), ($err&0xff));
$nfail += 1;
push @failedtags, $titem->{tmsg};
}
}
}
@@ -802,7 +807,7 @@ sub run_tests_multi {
$titem->{out} .= sprintf
"tbrun-I: test FAILed with exit status %d,%d\n",
($err>>8), ($err&0xff);
$nfail += 1;
push @failedtags, $titem->{tmsg};
$titem->{exitcode} = $err;
} else {
$titem->{exitcode} = 0;

View File

@@ -1,5 +1,5 @@
.\" -*- nroff -*-
.\" $Id: ti_w11.1 1103 2019-01-04 13:18:54Z mueller $
.\" $Id: ti_w11.1 1159 2019-06-06 19:15:50Z mueller $
.\"
.\" Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
.\"
@@ -143,15 +143,11 @@ trigger auto-bauding, and \fIcts\fP to use hardware handshake.
Like above, but now the USB device will be autodetected.
Typical way to start a Nexys4 board.
.IP "\fBti_w11 -n3 -e $RETROBASE/tools/asm-11/w11/sys/dl11/simple_out.mac\fR"
.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 \fIsimple_out.mac\fP test program with \fBasm-11\fP(1), load
and execute it. This little test code just produces
.EX
Hello world!
Hello world!
.EE
forever, just abort with ^C if you have seen enough.
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
with ^C if you have seen enough.
.
.\" ------------------------------------------------------------------
.SH "SEE ALSO"

View File

@@ -1,4 +1,4 @@
// $Id: RlinkCommandList.hpp 1091 2018-12-23 12:38:29Z mueller $
// $Id: RlinkCommandList.hpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -53,7 +53,7 @@ namespace Retro {
typedef std::unique_ptr<RlinkCommandExpect> exp_uptr_t;
RlinkCommandList();
RlinkCommandList(const RlinkCommandList&);
RlinkCommandList(const RlinkCommandList& rhs);
~RlinkCommandList();
size_t AddCommand(cmd_uptr_t&& upcmd);

View File

@@ -1,4 +1,4 @@
// $Id: RlinkPortTerm.cpp 1091 2018-12-23 12:38:29Z mueller $
// $Id: RlinkPortTerm.cpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -149,7 +149,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
emsg.Init("RlinkPortTerm::Open()",
string("isatty() check for '") + fUrl.Path() +
"' failed: not a TTY");
close(fd);
::close(fd);
return false;
}
@@ -206,7 +206,7 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg)
emsg.InitErrno("RlinkPortTerm::Open()",
string("cfsetspeed() for '") + baud + "' failed: ",
errno);
close(fd);
::close(fd);
return false;
}

View File

@@ -1,4 +1,4 @@
// $Id: RerrMsg.hpp 983 2018-01-02 20:35:59Z mueller $
// $Id: RerrMsg.hpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -39,7 +39,7 @@ namespace Retro {
RerrMsg(const std::string& meth, const std::string& text);
RerrMsg(const std::string& meth, const std::string& text,
int errnum);
~RerrMsg();
~RerrMsg();
void Init(const std::string& meth, const std::string& text);
void InitErrno(const std::string& meth,

View File

@@ -1,6 +1,6 @@
// $Id: RparseUrl.cpp 1070 2018-11-17 09:48:04Z mueller $
// $Id: RparseUrl.cpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2019-06-07 1161 1.2 add DirName,FileName,FileStem,FileType
// 2018-11-16 1070 1.1.1 use auto; use emplace,make_pair; use range loop
// 2017-04-15 875 1.1 add Set() with default scheme handling
// 2015-06-04 686 1.0.2 Set(): add check that optlist is enclosed by '|'
@@ -162,6 +163,46 @@ void RparseUrl::Clear()
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RparseUrl::DirName() const
{
size_t ddel = fPath.find_last_of('/');
return (ddel == string::npos) ? "." : fPath.substr(0,ddel);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RparseUrl::FileName() const
{
size_t ddel = fPath.find_last_of('/');
return (ddel != string::npos && ddel+1 <= fPath.length()) ?
fPath.substr(ddel+1) : fPath;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RparseUrl::FileStem() const
{
string fname = FileName();
size_t ddel = fname.find_last_of('.');
return (ddel == string::npos) ? "" : fname.substr(0,ddel);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RparseUrl::FileType() const
{
string fname = FileName();
size_t ddel = fname.find_last_of('.');
return (ddel != string::npos && ddel+1 <= fname.length()) ?
fname.substr(ddel+1) : "";
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool RparseUrl::FindOpt(const std::string& name) const
{
auto it = fOptMap.find(name);

View File

@@ -1,6 +1,6 @@
// $Id: RparseUrl.hpp 1066 2018-11-10 11:21:53Z mueller $
// $Id: RparseUrl.hpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2019-06-07 1161 1.2 add DirName,FileName,FileStem,FileType
// 2017-04-15 875 1.1 add Set() with default scheme handling
// 2013-02-23 492 1.0.1 add static FindScheme(); allow no or empty scheme
// 2013-02-03 481 1.0 Initial version, extracted from RlinkPort
@@ -51,10 +52,14 @@ namespace Retro {
const std::string& Url() const;
const std::string& Scheme() const;
const std::string& Path() const;
const omap_t& Opts() const;
bool FindOpt(const std::string& name) const;
bool FindOpt(const std::string& name,
std::string& value) const;
std::string DirName() const;
std::string FileName() const;
std::string FileStem() const;
std::string FileType() const;
const omap_t& Opts() const;
bool FindOpt(const std::string& name) const;
bool FindOpt(const std::string& name,
std::string& value) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;

View File

@@ -1,4 +1,4 @@
// $Id: Rw11VirtTapeTap.cpp 1090 2018-12-21 12:17:35Z mueller $
// $Id: Rw11VirtTapeTap.cpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -504,7 +504,7 @@ bool Rw11VirtTapeTap::Write(size_t nbyt, const uint8_t* data, bool back,
RerrMsg& emsg)
{
if (fTruncPend) {
if (ftruncate(fFd, fPos) < 0) {
if (::ftruncate(fFd, fPos) < 0) {
emsg.InitErrno("Rw11VirtTapeTap::Write()", "ftruncate() failed: ", errno);
return false;
}

View File

@@ -1,4 +1,4 @@
// $Id: Rw11VirtTermPty.cpp 1114 2019-02-23 18:01:55Z mueller $
// $Id: Rw11VirtTermPty.cpp 1161 2019-06-08 11:52:01Z mueller $
//
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -85,21 +85,21 @@ bool Rw11VirtTermPty::Open(const std::string& url, RerrMsg& emsg)
int irc = grantpt(fd);
if (irc < 0) {
emsg.InitErrno("Rw11VirtTermPty::Open", "grantpt() failed: ", errno);
close(fd);
::close(fd);
return false;
}
irc = unlockpt(fd);
if (irc < 0) {
emsg.InitErrno("Rw11VirtTermPty::Open", "unlockpt() failed: ", errno);
close(fd);
::close(fd);
return false;
}
char* pname = ptsname(fd);
if (pname == nullptr) {
emsg.InitErrno("Rw11VirtTermPty::Open", "ptsname() failed: ", errno);
close(fd);
::close(fd);
return false;
}