From ed5c8b7fc11b1aa09d0174b7902bf0db0999582d Mon Sep 17 00:00:00 2001 From: wfjm Date: Fri, 15 Mar 2019 20:39:35 +0100 Subject: [PATCH] add cp -brf,-bwf; fix rblk handling for aborted transfers - RlinkCommand: - add BlockDoneAll() - Print(): use BlockDone() as length for rblk - RlinkConnect: DecodeResponse(): rblk expect check over BlockDone - RtclRlinkConnect: M_exec(): tranfer BlockDone values after rblk - RtclRw11Cpu: - M_cp(): tranfer BlockDone values after rblk - add cp -brf and -bwf; add range checks for cp -wa --- doc/CHANGELOG.md | 7 ++++ doc/README_known_issues.md | 11 ++++++ doc/w11a_known_issues.md | 5 --- tools/src/librlink/RlinkCommand.cpp | 8 ++-- tools/src/librlink/RlinkCommand.hpp | 7 ++-- tools/src/librlink/RlinkCommand.ipp | 14 +++++-- tools/src/librlink/RlinkConnect.cpp | 8 ++-- tools/src/librlinktpp/RtclRlinkConnect.cpp | 6 +-- tools/src/librwxxtpp/RtclRw11Cpu.cpp | 39 ++++++++++++++++++-- tools/tbench/w11a_ibmon/test_ibmon_ibtst.tcl | 9 +++-- 10 files changed, 84 insertions(+), 30 deletions(-) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 9b155286..f67244c7 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -37,6 +37,13 @@ The full set of tests is only run for tagged releases. - tools changes - Rw11Cpu,RtclRw11Cpu: add ibmon setup and HasIbtst() - RtclGet.ipp: use const& for oper() of string& and Rtime& + - RlinkCommand: add BlockDoneAll() + - RtclRw11Cpu: add cp -brf and -bwf; add range checks for cp -wa + - ensure that after aborted rblk only BlockDone words are processed + - RlinkCommand: Print(): use BlockDone() as length for rblk + - RlinkConnect: DecodeResponse(): rblk expect check over BlockDone + - RtclRlinkConnect: M_exec(): tranfer BlockDone values after rblk + - RtclRw11Cpu: M_cp(): tranfer BlockDone values after rblk - firmware changes - rbd_rbmon: more robust ack,err trace when busy - rbd_tester: use now fifo_simple_dram diff --git a/doc/README_known_issues.md b/doc/README_known_issues.md index 157a0564..2c369f09 100644 --- a/doc/README_known_issues.md +++ b/doc/README_known_issues.md @@ -7,6 +7,17 @@ This file descibes general issues. The case id indicates the release when the issue was first recognized. +### V0.50-8 {[issue #21](https://github.com/wfjm/w11/issues/21)} --RK11,RL11: no proper NXM check in 18bit systems + +No `NXM` error is generated when a UNIBUS device DMA transfer reaches the top +of memory in 18 bit addressing. Seen originally for RK11, but RL11 and DEUNA +are also affected. + +In normal operation is minor non-conformity is not relevant because operating +systems never setup DMA transfers to/from non-existing memory. However, some +highly space optimized crash dump routines use this to detect end-of-memory +and might endless loop. Also maindec's might test this border case and fail. + ### V0.50-10 {[issue #20](https://github.com/wfjm/w11/issues/20)} -- DL11: output chars lost when device polling used Part of the console output can be lost when `xxdp` test `eqkce1` is run on FPGA, also some kernel messages during the 2.11bsd boot sequence. diff --git a/doc/w11a_known_issues.md b/doc/w11a_known_issues.md index 833c0ccc..68a7a0b8 100644 --- a/doc/w11a_known_issues.md +++ b/doc/w11a_known_issues.md @@ -63,11 +63,6 @@ differences. The RK11/RK05 hardware poll logic is probably not reflecting the behaviour of the real drive. -- **TCK-035 pri=L: RK11: no proper `NXM` check in 18bit systems** -No `NXM` error is generated when a RK11 read or write reaches the top -of memory in 18 bit addressing. Crash dump routines use this to detect -end-of-memory. - - **TCK-032 pri=M: RK11: polling on `DRY` in `RKDS` doesn't work** `DRY` in `RKDS` goes 1->0 immediately with `RDY` in `RKCS` when a function is started. In a real RK05 drive `DRY` went to 0 after a short delay. Some diff --git a/tools/src/librlink/RlinkCommand.cpp b/tools/src/librlink/RlinkCommand.cpp index fef40e25..f274fbb6 100644 --- a/tools/src/librlink/RlinkCommand.cpp +++ b/tools/src/librlink/RlinkCommand.cpp @@ -1,6 +1,6 @@ -// $Id: RlinkCommand.cpp 1091 2018-12-23 12:38:29Z mueller $ +// $Id: RlinkCommand.cpp 1121 2019-03-11 08:59:12Z mueller $ // -// Copyright 2011-2018 by Walter F.J. Mueller +// Copyright 2011-2019 by Walter F.J. Mueller // // 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-03-10 1121 1.4.3 Print(): use BlockDone() as length for rblk data // 2018-12-23 1091 1.4.2 CmdWblk(),SetBlockWrite(): add move version // 2018-12-19 1090 1.4.1 use RosPrintf(bool) // 2018-12-01 1076 1.4 use unique_ptr @@ -31,7 +32,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of class RlinkCommand. */ @@ -407,7 +407,7 @@ void RlinkCommand::Print(std::ostream& os, bool dcheck = (HasExpect() && Expect().BlockValue().size() > 0); size_t ncol = (80-4-5)/(dwidth+2); - size_t size = BlockSize(); + size_t size = BlockDone(); const uint16_t* pdat = BlockPointer(); for (size_t i=0; i +// Copyright 2011-2019 by Walter F.J. Mueller // // 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-03-10 1121 1.4.3 add BlockDoneAll() // 2018-12-24 1092 1.4.2 rename IsBlockExt -> HasBlockExt // 2018-12-23 1091 1.4.1 CmdWblk(),SetBlockWrite(): add move version // 2018-12-01 1076 1.4 use unique_ptr @@ -29,7 +30,6 @@ /*! - \file \brief Declaration of class RlinkCommand. */ @@ -102,6 +102,7 @@ namespace Retro { const uint16_t* BlockPointer() const; size_t BlockSize() const; size_t BlockDone() const; + bool BlockDoneAll() const; uint8_t Status() const; uint32_t Flags() const; bool TestFlagAny(uint32_t mask) const; diff --git a/tools/src/librlink/RlinkCommand.ipp b/tools/src/librlink/RlinkCommand.ipp index d111080d..89587ba5 100644 --- a/tools/src/librlink/RlinkCommand.ipp +++ b/tools/src/librlink/RlinkCommand.ipp @@ -1,6 +1,6 @@ -// $Id: RlinkCommand.ipp 1092 2018-12-24 08:01:50Z mueller $ +// $Id: RlinkCommand.ipp 1121 2019-03-11 08:59:12Z mueller $ // -// Copyright 2011-2018 by Walter F.J. Mueller +// Copyright 2011-2019 by Walter F.J. Mueller // // 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-03-10 1121 1.4.2 add BlockDoneAll() // 2018-12-24 1092 1.4.1 rename IsBlockExt -> HasBlockExt // 2018-12-01 1076 1.4 use unique_ptr // 2015-04-02 661 1.3 expect logic: add stat check, Print() without cntx @@ -23,7 +24,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation (inline) of class RlinkCommand. */ @@ -260,6 +260,14 @@ inline size_t RlinkCommand::BlockDone() const //------------------------------------------+----------------------------------- //! FIXME_docs +inline bool RlinkCommand::BlockDoneAll() const +{ + return BlockDone() == BlockSize(); +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + inline uint8_t RlinkCommand::Status() const { return fStatus; diff --git a/tools/src/librlink/RlinkConnect.cpp b/tools/src/librlink/RlinkConnect.cpp index 3eeb6cf4..a41264a8 100644 --- a/tools/src/librlink/RlinkConnect.cpp +++ b/tools/src/librlink/RlinkConnect.cpp @@ -1,6 +1,6 @@ -// $Id: RlinkConnect.cpp 1091 2018-12-23 12:38:29Z mueller $ +// $Id: RlinkConnect.cpp 1121 2019-03-11 08:59:12Z mueller $ // -// Copyright 2011-2018 by Walter F.J. Mueller +// Copyright 2011-2019 by Walter F.J. Mueller // // 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-03-10 1121 2.8.5 DecodeResponse(): rblk expect check over BlockDone // 2018-12-22 1091 2.8.4 Open(): (-Wpessimizing-move fix); add BadPort() // 2018-12-19 1090 2.8.3 use RosPrintf(bool) // 2018-12-18 1089 2.8.2 use c++ style casts @@ -48,7 +49,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of RlinkConnect. */ @@ -996,7 +996,7 @@ int RlinkConnect::DecodeResponse(RlinkCommandList& clist, size_t ibeg, cmd.SetFlagBit(RlinkCommand::kFlagChkData); } } else if (ccode==RlinkCommand::kCmdRblk) { - size_t nerr = expect.BlockCheck(cmd.BlockPointer(), cmd.BlockSize()); + size_t nerr = expect.BlockCheck(cmd.BlockPointer(), cmd.BlockDone()); if (nerr != 0) { fStats.Inc(kStatNChkData); cmd.SetFlagBit(RlinkCommand::kFlagChkData); diff --git a/tools/src/librlinktpp/RtclRlinkConnect.cpp b/tools/src/librlinktpp/RtclRlinkConnect.cpp index 41b0be5a..b054b124 100644 --- a/tools/src/librlinktpp/RtclRlinkConnect.cpp +++ b/tools/src/librlinktpp/RtclRlinkConnect.cpp @@ -1,4 +1,4 @@ -// $Id: RtclRlinkConnect.cpp 1114 2019-02-23 18:01:55Z mueller $ +// $Id: RtclRlinkConnect.cpp 1121 2019-03-11 08:59:12Z mueller $ // // Copyright 2011-2019 by Walter F.J. Mueller // @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2019-03-10 1121 1.6.10 M_exec(): tranfer BlockDone values after rblk // 2019-02-23 1114 1.6.9 use std::bind instead of lambda // 2018-12-23 1091 1.6.8 use AddWblk(move) // 2018-12-18 1089 1.6.7 use c++ style casts @@ -52,7 +53,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of class RtclRlinkConnect. */ @@ -380,7 +380,7 @@ int RtclRlinkConnect::M_exec(RtclArgs& args) pres = Tcl_NewIntObj(int(cmd.Data())); break; case RlinkCommand::kCmdRblk: - pres = Rtcl::NewListIntObj(cmd.Block()); + pres = Rtcl::NewListIntObj(cmd.Block().data(), cmd.BlockDone()); break; } if(!Rtcl::SetVar(interp, vardata[icmd], pres)) return kERR; diff --git a/tools/src/librwxxtpp/RtclRw11Cpu.cpp b/tools/src/librwxxtpp/RtclRw11Cpu.cpp index 66d0079e..4ff6f97a 100644 --- a/tools/src/librwxxtpp/RtclRw11Cpu.cpp +++ b/tools/src/librwxxtpp/RtclRw11Cpu.cpp @@ -1,4 +1,4 @@ -// $Id: RtclRw11Cpu.cpp 1114 2019-02-23 18:01:55Z mueller $ +// $Id: RtclRw11Cpu.cpp 1121 2019-03-11 08:59:12Z mueller $ // // Copyright 2013-2019 by Walter F.J. Mueller // @@ -13,6 +13,8 @@ // // Revision History: // Date Rev Version Comment +// 2019-03-10 1121 1.2.28 M_cp(): tranfer BlockDone values after rblk +// 2019-03-09 1120 1.2.27 add -brf,-bwf; add range checks for -wa // 2019-02-23 1114 1.2.26 use std::bind instead of lambda // 2019-02-15 1112 1.2.25 add HasIbtst() getter // 2018-12-23 1091 1.2.24 use AddWbibr(move),AddWblk(move) @@ -55,7 +57,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of RtclRw11Cpu. */ @@ -359,7 +360,7 @@ int RtclRw11Cpu::M_cp(RtclArgs& args) "-rsp|-rpc|-wsp|-wpc|" "-rps|-wps|" "-ral|-rah|-wal|-wah|-wa|" - "-rm|-rmi|-rma|-wm|-wmi|-wma|-brm|-bwm|" + "-rm|-rmi|-rma|-wm|-wmi|-wma|-brm|-bwm|-brf|-bwf|" "-start|-stop|-step|-creset|-breset|" "-suspend|-resume|" "-stapc|" @@ -495,6 +496,7 @@ int RtclRw11Cpu::M_cp(RtclArgs& args) if (!GetVarName(args, "??varStat", lsize, varstat)) return kERR; clist.AddWreg(base + Rw11Cpu::kCPAH, data); + // Note: -wa without -p22 or -ubm options is equivalent to -wal } else if (opt == "-wa") { // -wa addr ?varStat [-p22 -ubm]-- uint32_t addr=0; if (!args.GetArg("addr", addr, 017777776)) return kERR; @@ -509,8 +511,24 @@ int RtclRw11Cpu::M_cp(RtclArgs& args) ah |= Rw11Cpu::kCPAH_M_22BIT; } else if (subopt == "-ubm") { // -ubm ah |= Rw11Cpu::kCPAH_M_UBM22; + if (addr > 0777776) { + ostringstream sos; + sos << "-E: value '" << addr + << "' for 'addr' out of range 0...0777776"; + args.AppendResult(sos); + return kERR; + } } } + if ((ah & (Rw11Cpu::kCPAH_M_22BIT|Rw11Cpu::kCPAH_M_UBM22)) == 0 && + addr > 0177776) { + ostringstream sos; + sos << "-E: value '" << addr + << "' for 'addr' out of range 0...0177776"; + args.AppendResult(sos); + return kERR; + } + clist.AddWreg(base + Rw11Cpu::kCPAL, al); if (ah!=0) clist.AddWreg(base + Rw11Cpu::kCPAH, ah); @@ -563,6 +581,19 @@ int RtclRw11Cpu::M_cp(RtclArgs& args) if (!GetVarName(args, "??varStat", lsize, varstat)) return kERR; clist.AddWblk(base + Rw11Cpu::kCPMEMI, move(block)); + } else if (opt == "-brf") { // -brf size ?varData ?varStat --- + int32_t bsize=0; + if (!args.GetArg("bsize", bsize, 1, Connect().BlockSizeMax())) return kERR; + if (!GetVarName(args, "??varData", lsize, vardata)) return kERR; + if (!GetVarName(args, "??varStat", lsize, varstat)) return kERR; + clist.AddRblk(base + Rw11Cpu::kCPMEM, size_t(bsize)); + + } else if (opt == "-bwf") { // -bwf block ?varStat ----------- + vector block; + if (!args.GetArg("data", block, 1, Connect().BlockSizeMax())) return kERR; + if (!GetVarName(args, "??varStat", lsize, varstat)) return kERR; + clist.AddWblk(base + Rw11Cpu::kCPMEM, move(block)); + } else if (opt == "-start") { // -start ?varStat --------------- if (!GetVarName(args, "??varStat", lsize, varstat)) return kERR; clist.AddWreg(base + Rw11Cpu::kCPCNTL, Rw11Cpu::kCPFUNC_START); @@ -766,7 +797,7 @@ int RtclRw11Cpu::M_cp(RtclArgs& args) break; case RlinkCommand::kCmdRblk: - pres = Rtcl::NewListIntObj(cmd.Block()); + pres = Rtcl::NewListIntObj(cmd.Block().data(), cmd.BlockDone()); break; } if(!Rtcl::SetVar(interp, vardata[icmd], pres)) return kERR; diff --git a/tools/tbench/w11a_ibmon/test_ibmon_ibtst.tcl b/tools/tbench/w11a_ibmon/test_ibmon_ibtst.tcl index e239fd4c..5d3ec01e 100644 --- a/tools/tbench/w11a_ibmon/test_ibmon_ibtst.tcl +++ b/tools/tbench/w11a_ibmon/test_ibmon_ibtst.tcl @@ -1,10 +1,11 @@ -# $Id: test_ibmon_ibtst.tcl 1118 2019-03-05 19:26:39Z mueller $ +# $Id: test_ibmon_ibtst.tcl 1120 2019-03-09 18:19:31Z mueller $ # # Copyright 2019- by Walter F.J. Mueller # License disclaimer see License.txt in $RETROBASE directory # # Revision History: # Date Rev Version Comment +# 2019-03-09 1120 1.0.1 use -brm,-bwf # 2019-03-05 1118 1.0 Initial version # # Test register response @@ -201,7 +202,7 @@ $cpu cp \ -wal $itfifo \ -wreg it.cntl [regbld ibd_ibtst::CNTL fclr remw locr] \ -wbibr it.fifo {0x0101 0x0102} \ - -rblk mem 3 -edone 2 -edata {0x0101 0x0102} -estaterr + -brf 3 -edone 2 -edata {0x0101 0x0102} -estaterr ibd_ibmon::stop $cpu if {$print} {puts [ibd_ibmon::print $cpu]} ibd_ibmon::raw_check $cpu $edat $emsk @@ -244,8 +245,8 @@ ibd_ibmon::raw_edata edat emsk \ ibd_ibmon::start $cpu $cpu cp \ -wreg it.cntl [regbld ibd_ibtst::CNTL fclr locw remr] \ - -wblk mem {0x0200 0x0201 0x0202 0x0203 0x0204 0x0205 0x0206 0x0207 \ - 0x0208 0x0209 0x020a 0x020b 0x020c 0x020d 0x020e 0x020f} \ + -bwf {0x0200 0x0201 0x0202 0x0203 0x0204 0x0205 0x0206 0x0207 \ + 0x0208 0x0209 0x020a 0x020b 0x020c 0x020d 0x020e 0x020f} \ -edone 15 -estaterr \ -rbibr it.fifo 15 \ -edata {0x0200 0x0201 0x0202 0x0203 0x0204 0x0205 0x0206 0x0207 \