1
0
mirror of https://github.com/wfjm/w11.git synced 2026-01-19 09:57:49 +00:00

more compact dumps, add Dump(..,detail); trace output with cntl name

- RlinkCommand: add CommandInfo()
- RtclCmdBase: add GetArgsDump()
- RlinkCommandList: Dump(): add detail arg
- Rstats: add NameMaxLength(); Print(): add counter name
- Rw11Cntl: use Dump(detail) for PrimClist ect
- Rw11CntlBase,Rw11Rdma*: Dump(): add detail arg
- Rw11Cntl*: Dump(): add detail arg; use cntl name as message prefix
- RtclRw11Cntl: M_dump: use GetArgsDump and Dump detail
This commit is contained in:
Walter F.J. Mueller 2017-04-02 19:06:38 +02:00
parent e73c041309
commit 79c565f6f3
31 changed files with 361 additions and 178 deletions

View File

@ -1,6 +1,6 @@
// $Id: RlinkCommand.cpp 662 2015-04-05 08:02:54Z mueller $
// $Id: RlinkCommand.cpp 859 2017-03-11 22:36:45Z mueller $
//
// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2017 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
// 2017-03-11 859 1.3.1 add CommandInfo()
// 2015-04-02 661 1.3 expect logic: add stat check, Print() without cntx
// 2015-02-07 642 1.2.3 Print()+Dump(): adopt for large nblk;
// 2014-12-21 617 1.2.2 use kStat_M_RbTout for rbus timeout
@ -27,12 +28,13 @@
/*!
\file
\version $Id: RlinkCommand.cpp 662 2015-04-05 08:02:54Z mueller $
\version $Id: RlinkCommand.cpp 859 2017-03-11 22:36:45Z mueller $
\brief Implemenation of class RlinkCommand.
*/
// debug
#include <iostream>
#include <sstream>
#include <algorithm>
@ -297,7 +299,7 @@ void RlinkCommand::Print(std::ostream& os,
}
}
// don't write more that command and address for canceled commands
// don't write more than command and address for canceled commands
if (TestFlagAny(kFlagLabo)) {
os << " CANCELED" << endl;
return;
@ -433,6 +435,73 @@ void RlinkCommand::Print(std::ostream& os,
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RlinkCommand::CommandInfo() const
{
ostringstream sos;
uint8_t ccode = Command();
// separator + command mnemonic, code and flags
// separator: ++ first in packet
// -- non-first in packet
// -! +! labo with abort
// -. +. labo canceled command
char sep0 = TestFlagAny(kFlagPktBeg) ? '+' : '-';
char sep1 = sep0;
if (ccode==kCmdLabo && fData) sep1 = '!'; // indicate aborting labo
if (TestFlagAny(kFlagLabo)) sep1 = '.'; // indicate aborted command
sos << sep0 << sep1 << " " << CommandName(ccode);
// address field
if (ccode==kCmdRreg || ccode==kCmdRblk ||
ccode==kCmdWreg || ccode==kCmdWblk ||
ccode==kCmdInit) {
sos << " a=" << RosPrintBvi(fAddress, 16);
} else {
sos << " ";
}
// data field (scalar)
if (ccode== kCmdRreg || ccode==kCmdWreg ||
ccode== kCmdLabo || ccode==kCmdAttn ||
ccode== kCmdInit) {
sos << " d=" << RosPrintBvi(fData, 16) << " ";
} else if (ccode== kCmdRblk || ccode==kCmdWblk) {
sos << " n=" << RosPrintf(BlockSize(), "d", 4)
<< (BlockSize()==BlockDone() ? "=" : ">")
<< RosPrintf(BlockDone(), "d", 4);
} else {
sos << " ";
}
// don't write more that command and address for canceled commands
if (TestFlagAny(kFlagLabo)) {
sos << " CANCELED";
return sos.str();
}
// status field
sos << " s=" << RosPrintBvi(fStatus, 2);
if (TestFlagAny(kFlagDone)) {
if (TestFlagAny(kFlagChkStat|kFlagChkData|kFlagChkDone)) {
sos << " FAIL: chk";
} else {
sos << " OK";
}
} else if (TestFlagAny(kFlagSend)) {
sos << " FAIL: snd";
} else {
sos << " PEND";
}
return sos.str();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RlinkCommand::Dump(std::ostream& os, int ind, const char* text) const
{
RosFill bl(ind);

View File

@ -1,6 +1,6 @@
// $Id: RlinkCommand.hpp 661 2015-04-03 18:28:41Z mueller $
// $Id: RlinkCommand.hpp 859 2017-03-11 22:36:45Z mueller $
//
// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2017 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
// 2017-03-11 859 1.3.1 add CommandInfo()
// 2015-04-02 661 1.3 expect logic: add stat check, Print() without cntx
// 2014-12-21 617 1.2.2 use kStat_M_RbTout for rbus timeout
// 2014-12-20 616 1.2.1 add kFlagChkDone
@ -25,7 +26,7 @@
/*!
\file
\version $Id: RlinkCommand.hpp 661 2015-04-03 18:28:41Z mueller $
\version $Id: RlinkCommand.hpp 859 2017-03-11 22:36:45Z mueller $
\brief Declaration of class RlinkCommand.
*/
@ -34,6 +35,7 @@
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>
#include <ostream>
@ -107,6 +109,7 @@ namespace Retro {
void Print(std::ostream& os, const RlinkAddrMap* pamap=0,
size_t abase=16, size_t dbase=16,
size_t sbase=16) const;
std::string CommandInfo() const;
void Dump(std::ostream& os, int ind=0, const char* text=0) const;
static const char* CommandName(uint8_t cmd);

View File

@ -1,6 +1,6 @@
// $Id: RlinkCommandList.cpp 661 2015-04-03 18:28:41Z mueller $
// $Id: RlinkCommandList.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2017 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
// 2017-04-02 865 1.3.1 Dump(): add detail arg
// 2015-04-02 661 1.3 expect logic: add SetLastExpect methods
// 2014-11-23 606 1.2 new rlink v4 iface
// 2014-08-02 576 1.1 rename LastExpect->SetLastExpect
@ -25,12 +26,11 @@
/*!
\file
\version $Id: RlinkCommandList.cpp 661 2015-04-03 18:28:41Z mueller $
\version $Id: RlinkCommandList.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of class RlinkCommandList.
*/
#include <string>
#include "boost/foreach.hpp"
#define foreach_ BOOST_FOREACH
@ -306,18 +306,24 @@ void RlinkCommandList::Print(std::ostream& os,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RlinkCommandList::Dump(std::ostream& os, int ind, const char* text) const
void RlinkCommandList::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "RlinkCommandList @ " << this << endl;
os << bl << " fLaboIndex: " << fLaboIndex << endl;
for (size_t i=0; i<Size(); i++) {
string pref("fList[");
pref << RosPrintf(i) << RosPrintf("]: ");
fList[i]->Dump(os, ind+2, pref.c_str());
if (detail >= 0) { // full dump
string pref("fList[");
pref << RosPrintf(i) << RosPrintf("]: ");
fList[i]->Dump(os, ind+2, pref.c_str());
} else { // compact dump
os << bl << " [" << RosPrintf(i,"d",2) << "]: "
<< fList[i]->CommandInfo() << endl;
}
}
return;
}

View File

@ -1,6 +1,6 @@
// $Id: RlinkCommandList.hpp 661 2015-04-03 18:28:41Z mueller $
// $Id: RlinkCommandList.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2017 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
// 2017-04-02 865 1.3.1 Dump(): add detail arg
// 2015-04-02 661 1.3 expect logic: add SetLastExpect methods
// 2014-11-23 606 1.2 new rlink v4 iface
// 2014-08-02 576 1.1 rename LastExpect->SetLastExpect
@ -24,7 +25,7 @@
/*!
\file
\version $Id: RlinkCommandList.hpp 661 2015-04-03 18:28:41Z mueller $
\version $Id: RlinkCommandList.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class RlinkCommandList.
*/
@ -82,7 +83,8 @@ namespace Retro {
void Print(std::ostream& os, const RlinkAddrMap* pamap=0,
size_t abase=16, size_t dbase=16,
size_t sbase=16) const;
void Dump(std::ostream& os, int ind=0, const char* text=0) const;
void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
RlinkCommandList& operator=(const RlinkCommandList& rhs);

View File

@ -1,4 +1,4 @@
// $Id: RtclCmdBase.cpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclCmdBase.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.1.1 add GetArgsDump()
// 2017-04-02 863 1.1 add DelMeth(),TstMeth(); add M_info() and '?'
// rename fMapMeth -> fMethMap
// 2017-03-11 859 1.1 support now sub-command handling
@ -24,13 +25,15 @@
/*!
\file
\version $Id: RtclCmdBase.cpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclCmdBase.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of RtclCmdBase.
*/
#include "RtclCmdBase.hpp"
#include "librtools/Rexception.hpp"
#include "librtcltools/RtclNameSet.hpp"
#include "Rtcl.hpp"
#include "RtclOPtr.hpp"
@ -164,6 +167,26 @@ bool RtclCmdBase::TstMeth(const std::string& name)
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool RtclCmdBase::GetArgsDump(RtclArgs& args, int& detail)
{
static RtclNameSet optset("-brief|-v|-vv|-vvv");
detail = 0;
string opt;
while (args.NextOpt(opt, optset)) {
if (opt == "-brief") { detail = -1;}
else if (opt == "-v") { detail = +1;}
else if (opt == "-vv") { detail = +2;}
else if (opt == "-vvv") { detail = +3;}
else { detail = 0;}
}
return true;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int RtclCmdBase::M_info(RtclArgs& args)
{
Tcl_Interp* interp = args.Interp();

View File

@ -1,4 +1,4 @@
// $Id: RtclCmdBase.hpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclCmdBase.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.1.1 add GetArgsDump()
// 2017-04-02 863 1.1 add DelMeth(),TstMeth(); add M_info() and '?'
// rename fMapMeth -> fMethMap
// 2013-04-26 511 1.0.1 AddMeth() now public
@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclCmdBase.hpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclCmdBase.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class RtclCmdBase.
*/
@ -56,12 +57,13 @@ namespace Retro {
void AddMeth(const std::string& name, const methfo_t& methfo);
void DelMeth(const std::string& name);
bool TstMeth(const std::string& name);
// some constants (also defined in cpp)
static const int kOK = TCL_OK; //<!
static const int kERR = TCL_ERROR; //<!
protected:
bool GetArgsDump(RtclArgs& args, int& detail);
int M_info(RtclArgs& args);
protected:

View File

@ -1,4 +1,4 @@
// $Id: Rstats.cpp 851 2017-02-18 09:20:40Z mueller $
// $Id: Rstats.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-02-04 865 1.0.4 add NameMaxLength(); Print(): add counter name
// 2017-02-18 851 1.0.3 add IncLogHist; fix + and * operator definition
// 2013-02-03 481 1.0.2 use Rexception
// 2011-03-06 367 1.0.1 use max from algorithm
@ -21,7 +22,7 @@
/*!
\file
\version $Id: Rstats.cpp 851 2017-02-18 09:20:40Z mueller $
\version $Id: Rstats.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rstats .
*/
@ -138,6 +139,18 @@ void Rstats::SetFormat(const char* format, int width, int prec)
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
size_t Rstats::NameMaxLength() const
{
size_t maxlen = 0;
for (size_t i=0; i<Size(); i++) {
size_t len = fName[i].length();
if (len > maxlen) maxlen = len;
}
return maxlen;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
@ -149,9 +162,11 @@ void Rstats::Print(std::ostream& os, const char* format,
width = fWidth;
prec = fPrec;
}
size_t maxlen = NameMaxLength();
for (size_t i=0; i<Size(); i++) {
os << RosPrintf(fValue[i], format, width, prec)
<< " : " << RosPrintf(fName[i].c_str(),"-s",maxlen)
<< " : " << fText[i] << endl;
}
return;
@ -160,20 +175,30 @@ void Rstats::Print(std::ostream& os, const char* format,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rstats::Dump(std::ostream& os, int ind, const char* text) const
void Rstats::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rstats @ " << this << endl;
size_t maxlen=8;
for (size_t i=0; i<Size(); i++) maxlen = max(maxlen, fName[i].length());
for (size_t i=0; i<Size(); i++) {
os << bl << " " << fName[i] << ":" << RosFill(maxlen-fName[i].length()+1)
<< RosPrintf(fValue[i], "f", 12)
<< " '" << fText[i] << "'" << endl;
if (detail >= 0) { // full dump
size_t maxlen=8;
for (size_t i=0; i<Size(); i++) maxlen = max(maxlen, fName[i].length());
for (size_t i=0; i<Size(); i++) {
os << bl << " " << fName[i] << ":" << RosFill(maxlen-fName[i].length()+1)
<< RosPrintf(fValue[i], "f", 12)
<< " '" << fText[i] << "'" << endl;
}
} else {
os << bl << " fValue.size(): "
<< RosPrintf(fValue.size(),"d",2) << endl;
}
os << bl << " fHash: " << RosPrintf(fHash,"x",8) << endl;
os << bl << " fFormat,Width,Prec: " << fFormat
<< ", " << RosPrintf(fWidth,"d",2)
<< ", " << RosPrintf(fPrec,"d",2) << endl;
return;
}

View File

@ -1,4 +1,4 @@
// $Id: Rstats.hpp 851 2017-02-18 09:20:40Z mueller $
// $Id: Rstats.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-02-04 865 1.0.2 add NameMaxLength(); Dump(): add detail arg
// 2017-02-18 851 1.0.1 add IncLogHist; fix + and * operator definition
// 2011-02-06 359 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rstats.hpp 851 2017-02-18 09:20:40Z mueller $
\version $Id: Rstats.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rstats .
*/
@ -38,7 +39,7 @@ namespace Retro {
public:
Rstats();
Rstats(const Rstats& rhs);
~Rstats();
~Rstats();
void Define(size_t ind, const std::string& name,
const std::string& text);
@ -55,10 +56,12 @@ namespace Retro {
double Value(size_t ind) const;
const std::string& Name(size_t ind) const;
const std::string& Text(size_t ind) const;
size_t NameMaxLength() const;
void Print(std::ostream& os, const char* format=0,
int width=0, int prec=0) const;
void Dump(std::ostream& os, int ind=0, const char* text=0) const;
void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
double operator[](size_t ind) const;

View File

@ -1,6 +1,6 @@
// $Id: Rw11Cntl.cpp 682 2015-05-15 18:35:29Z mueller $
// $Id: Rw11Cntl.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.1.1 use Dump(detail) for PrimClist
// 2014-12-30 625 1.1 adopt to Rlink V4 attn logic
// 2013-03-06 495 1.0 Initial version
// 2013-02-05 483 0.1 First draft
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11Cntl.cpp 682 2015-05-15 18:35:29Z mueller $
\version $Id: Rw11Cntl.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11Cntl.
*/
@ -128,7 +129,8 @@ std::string Rw11Cntl::UnitName(size_t index) const
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11Cntl::Dump(std::ostream& os, int ind, const char* text) const
void Rw11Cntl::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11Cntl @ " << this << endl;
@ -142,8 +144,8 @@ void Rw11Cntl::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fStarted: " << fStarted << endl;
fProbe.Dump(os, ind+2, "fProbe: ");
os << bl << " fTraceLevel: " << fTraceLevel << endl;
fPrimClist.Dump(os, ind+2, "fPrimClist: ");
fStats.Dump(os, ind+2, "fStats: ");
fPrimClist.Dump(os, ind+2, "fPrimClist: ", detail-1);
fStats.Dump(os, ind+2, "fStats: ", detail-1);
return;
}

View File

@ -1,4 +1,4 @@
// $Id: Rw11Cntl.hpp 848 2017-02-04 14:55:30Z mueller $
// $Id: Rw11Cntl.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.2.1 Dump(): add detail arg
// 2017-02-04 848 1.2 add ProbeFound(),ProbeDataInt,Rem()
// 2015-05-15 680 1.1.1 add NUnit() as virtual
// 2014-12-30 625 1.1 adopt to Rlink V4 attn logic
@ -23,7 +24,7 @@
/*!
\file
\version $Id: Rw11Cntl.hpp 848 2017-02-04 14:55:30Z mueller $
\version $Id: Rw11Cntl.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11Cntl.
*/
@ -84,7 +85,8 @@ namespace Retro {
std::string UnitName(size_t index) const;
const Rstats& Stats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// statistics counter indices
enum stats {

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlBase.hpp 682 2015-05-15 18:35:29Z mueller $
// $Id: Rw11CntlBase.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.2.1 Dump(): add detail arg
// 2013-03-06 495 1.0 Initial version
// 2013-02-14 488 0.1 First draft
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlBase.hpp 682 2015-05-15 18:35:29Z mueller $
\version $Id: Rw11CntlBase.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlBase.
*/
@ -44,7 +45,8 @@ namespace Retro {
TU& Unit(size_t index) const;
const boost::shared_ptr<TU>& UnitSPtr(size_t index) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
protected:
boost::shared_ptr<TU> fspUnit[NU];

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlBase.ipp 495 2013-03-06 17:13:48Z mueller $
// $Id: Rw11CntlBase.ipp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2013-03-06 495 1.0 Initial version
// 2013-02-14 488 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11CntlBase.ipp 495 2013-03-06 17:13:48Z mueller $
\version $Id: Rw11CntlBase.ipp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation (inline) of Rw11CntlBase.
*/
@ -84,7 +85,7 @@ inline const boost::shared_ptr<TU>&
template <class TU, size_t NU>
void Rw11CntlBase<TU,NU>::Dump(std::ostream& os, int ind,
const char* text) const
const char* text, int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlBase @ " << this << std::endl;
@ -93,7 +94,7 @@ void Rw11CntlBase<TU,NU>::Dump(std::ostream& os, int ind,
os << bl << " " << RosPrintf(i,"d",2) << " : "
<< fspUnit[i].get() << std::endl;
}
Rw11Cntl::Dump(os, ind, " ^");
Rw11Cntl::Dump(os, ind, " ^", detail);
return;
}

View File

@ -1,4 +1,4 @@
// $Id: Rw11CntlDL11.cpp 855 2017-02-25 16:30:37Z mueller $
// $Id: Rw11CntlDL11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.2.3 Dump(): add detail arg
// 2017-03-03 858 1.2.2 use cntl name as message prefix
// 2017-02-25 855 1.2.1 shorten ctor code; RcvNext() --> RcvQueueNext()
// 2014-12-30 625 1.2 adopt to Rlink V4 attn logic
// 2014-12-25 621 1.1 adopt to 4k word ibus window and
@ -24,7 +26,7 @@
/*!
\file
\version $Id: Rw11CntlDL11.cpp 855 2017-02-25 16:30:37Z mueller $
\version $Id: Rw11CntlDL11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlDL11.
*/
@ -185,14 +187,15 @@ uint16_t Rw11CntlDL11::RxRlim() const
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlDL11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlDL11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlDL11 @ " << this << endl;
os << bl << " fPC_xbuf: " << fPC_xbuf << endl;
os << bl << " fRxRlim: " << fRxRlim << endl;
Rw11CntlBase<Rw11UnitDL11,1>::Dump(os, ind, " ^");
Rw11CntlBase<Rw11UnitDL11,1>::Dump(os, ind, " ^", detail);
return;
}
@ -212,7 +215,7 @@ int Rw11CntlDL11::AttnHandler(RlinkServer::AttnArgs& args)
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I DL11." << Name()
lmsg << "-I " << Name() << ":"
<< " xbuf=" << RosPrintBvi(xbuf,8)
<< " xval=" << xval
<< " rrdy=" << rrdy

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlDL11.hpp 665 2015-04-07 07:13:49Z mueller $
// $Id: Rw11CntlDL11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.1.1 Dump(): add detail arg
// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
// 2013-05-04 516 1.0.1 add RxRlim support (receive interrupt rate limit)
// 2013-03-06 495 1.0 Initial version
@ -22,7 +23,7 @@
/*!
\file
\version $Id: Rw11CntlDL11.hpp 665 2015-04-07 07:13:49Z mueller $
\version $Id: Rw11CntlDL11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlDL11.
*/
@ -50,7 +51,8 @@ namespace Retro {
void SetRxRlim(uint16_t rlim);
uint16_t RxRlim() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177560; //!< DL11 default address

View File

@ -1,4 +1,4 @@
// $Id: Rw11CntlLP11.cpp 856 2017-02-25 20:09:10Z mueller $
// $Id: Rw11CntlLP11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@ -13,6 +13,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.2.3 Dump(): add detail arg
// 2017-03-03 858 1.2.2 use cntl name as message prefix
// 2017-02-25 855 1.2.1 shorten ctor code
// 2014-12-30 625 1.2 adopt to Rlink V4 attn logic
// 2014-12-25 621 1.1 adopt to 4k word ibus window
@ -22,7 +24,7 @@
/*!
\file
\version $Id: Rw11CntlLP11.cpp 856 2017-02-25 20:09:10Z mueller $
\version $Id: Rw11CntlLP11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlLP11.
*/
@ -129,13 +131,14 @@ void Rw11CntlLP11::UnitSetup(size_t ind)
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlLP11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlLP11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlLP11 @ " << this << endl;
os << bl << " fPC_buf: " << fPC_buf << endl;
Rw11CntlBase<Rw11UnitLP11,1>::Dump(os, ind, " ^");
Rw11CntlBase<Rw11UnitLP11,1>::Dump(os, ind, " ^", detail);
return;
}
@ -153,7 +156,7 @@ int Rw11CntlLP11::AttnHandler(RlinkServer::AttnArgs& args)
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I LP11." << Name()
lmsg << "-I " << Name() << ":"
<< " buf=" << RosPrintBvi(buf,8)
<< " val=" << val;
if (val) {

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlLP11.hpp 665 2015-04-07 07:13:49Z mueller $
// $Id: Rw11CntlLP11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.1.1 Dump(): add detail arg
// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlLP11.hpp 665 2015-04-07 07:13:49Z mueller $
\version $Id: Rw11CntlLP11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlLP11.
*/
@ -44,7 +45,8 @@ namespace Retro {
virtual void UnitSetup(size_t ind);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177514; //!< LP11 default address

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlPC11.cpp 659 2015-03-22 23:15:51Z mueller $
// $Id: Rw11CntlPC11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.2.2 Dump(): add detail arg
// 2017-03-03 858 1.2.1 use cntl name as message prefix
// 2014-12-30 625 1.2 adopt to Rlink V4 attn logic
// 2014-12-25 621 1.1 adopt to 4k word ibus window
// 2013-05-03 515 1.0 Initial version
@ -20,7 +22,7 @@
/*!
\file
\version $Id: Rw11CntlPC11.cpp 659 2015-03-22 23:15:51Z mueller $
\version $Id: Rw11CntlPC11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlPC11.
*/
@ -232,13 +234,14 @@ void Rw11CntlPC11::UnitSetup(size_t ind)
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlPC11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlPC11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlPC11 @ " << this << endl;
os << bl << " fPC_pbuf: " << fPC_pbuf << endl;
Rw11CntlBase<Rw11UnitPC11,2>::Dump(os, ind, " ^");
Rw11CntlBase<Rw11UnitPC11,2>::Dump(os, ind, " ^", detail);
return;
}
@ -257,7 +260,7 @@ int Rw11CntlPC11::AttnHandler(RlinkServer::AttnArgs& args)
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I PC11." << Name()
lmsg << "-I " << Name() << ":"
<< " pbuf=" << RosPrintBvi(pbuf,8)
<< " pval=" << pval
<< " rbusy=" << rbusy;

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlPC11.hpp 665 2015-04-07 07:13:49Z mueller $
// $Id: Rw11CntlPC11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.2.1 Dump(): add detail arg
// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlPC11.hpp 665 2015-04-07 07:13:49Z mueller $
\version $Id: Rw11CntlPC11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlPC11.
*/
@ -47,7 +48,8 @@ namespace Retro {
virtual void UnitSetup(size_t ind);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177550; //!< PC11 default address

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlRHRP.cpp 720 2015-12-28 14:52:45Z mueller $
// $Id: Rw11CntlRHRP.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Other credits:
// the boot code is from the simh project and Copyright Robert M Supnik
//
@ -15,6 +15,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.5 Dump(): add detail arg
// 2017-03-03 858 1.0.4 use cntl name as message prefix
// 2015-12-28 720 1.0.3 use octal for er1= printouts
// 2015-06-04 686 1.0.2 check for spurious lams
// 2015-05-24 684 1.0.1 fixed rpcs2 update for wcheck and nem aborts
@ -24,7 +26,7 @@
/*!
\file
\version $Id: Rw11CntlRHRP.cpp 720 2015-12-28 14:52:45Z mueller $
\version $Id: Rw11CntlRHRP.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlRHRP.
*/
@ -360,7 +362,8 @@ bool Rw11CntlRHRP::BootCode(size_t unit, std::vector<uint16_t>& code,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlRHRP::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlRHRP::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlRHRP @ " << this << endl;
@ -388,8 +391,8 @@ void Rw11CntlRHRP::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fRd_nwrd: " << RosPrintf(fRd_nwrd,"d",6) << endl;
os << bl << " fRd_fu: " << RosPrintf(fRd_fu,"d",6) << endl;
os << bl << " fRd_ovr: " << fRd_ovr << endl;
fRdma.Dump(os, ind+2, "fRdma: ");
Rw11CntlBase<Rw11UnitRHRP,4>::Dump(os, ind, " ^");
fRdma.Dump(os, ind+2, "fRdma: ", detail);
Rw11CntlBase<Rw11UnitRHRP,4>::Dump(os, ind, " ^", detail);
return;
}
@ -440,7 +443,7 @@ int Rw11CntlRHRP::AttnHandler(RlinkServer::AttnArgs& args)
"10 ","11 ","12 ","13 ","14 ","15 ","16 ","17 ", // 01---
"20 ","21 ","22 ","23 ","wc ","wch","26 ","27 ", // 10---
"wr ","wrh","32 ","33 ","rd ","rdh","36 ","37 "}; // 11---
lmsg << "-I RHRP"
lmsg << "-I " << Name() << ":"
<< " fu=" << fumnemo[fu&037]
<< " cs=" << RosPrintBvi(rpcs1,8)
<< "," << RosPrintBvi(rpcs2,8)
@ -610,8 +613,7 @@ void Rw11CntlRHRP::AddErrorExit(RlinkCommandList& clist, uint16_t rper1)
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I RHRP"
<< " err "
lmsg << "-I " << Name() << ": err "
<< " cs1=" << RosPrintBvi(fRd_rpcs1,8)
<< " er1=" << RosPrintBvi(rper1,8);
}
@ -661,14 +663,12 @@ void Rw11CntlRHRP::AddNormalExit(RlinkCommandList& clist, size_t ndone,
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
if (rper1 || rpcs2) {
lmsg << "-I RHRP"
<< " err "
lmsg << "-I " << Name() << ": err "
<< " er1=" << RosPrintBvi(rper1,8)
<< " cs2=" << RosPrintBvi(rpcs2,8,8)
<< endl;
}
lmsg << "-I RHRP"
<< (rper1==0 ? " ok " :" err ")
lmsg << "-I " << Name() << (rper1==0 ? ": ok " : ": err ")
<< " we=" << RosPrintBvi(wc,8) << "," << RosPrintBvi(rper1,8)
<< " ad=" << RosPrintBvi(addr,8,22)
<< " pa=" << unum

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlRHRP.hpp 680 2015-05-14 13:29:46Z mueller $
// $Id: Rw11CntlRHRP.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2015-05-14 680 1.0 Initial version
// 2015-03-21 659 0.1 First draft
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlRHRP.hpp 680 2015-05-14 13:29:46Z mueller $
\version $Id: Rw11CntlRHRP.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlRHRP.
*/
@ -53,7 +54,8 @@ namespace Retro {
const Rstats& RdmaStats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0176700; //!< RHRP default address

View File

@ -1,4 +1,4 @@
// $Id: Rw11CntlRK11.cpp 857 2017-02-26 15:27:41Z mueller $
// $Id: Rw11CntlRK11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Other credits:
@ -15,6 +15,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 2.0.5 Dump(): add detail arg
// 2017-03-03 858 2.0.4 use cntl name as message prefix
// 2017-02-26 857 2.0.3 use kCPAH_M_UBM22
// 2015-06-04 686 2.0.2 check for spurious lams
// 2015-02-17 647 2.0.1 use Nwrd2Nblk(); BUGFIX: revise RdmaPostExecCB()
@ -28,7 +30,7 @@
/*!
\file
\version $Id: Rw11CntlRK11.cpp 857 2017-02-26 15:27:41Z mueller $
\version $Id: Rw11CntlRK11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlRK11.
*/
@ -290,7 +292,8 @@ bool Rw11CntlRK11::BootCode(size_t unit, std::vector<uint16_t>& code,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlRK11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlRK11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlRK11 @ " << this << endl;
@ -306,8 +309,8 @@ void Rw11CntlRK11::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fRd_nwrd: " << fRd_nwrd << endl;
os << bl << " fRd_fu: " << fRd_fu << endl;
os << bl << " fRd_ovr: " << fRd_ovr << endl;
fRdma.Dump(os, ind+2, "fRdma: ");
Rw11CntlBase<Rw11UnitRK11,8>::Dump(os, ind, " ^");
fRdma.Dump(os, ind+2, "fRdma: ", detail);
Rw11CntlBase<Rw11UnitRK11,8>::Dump(os, ind, " ^", detail);
return;
}
@ -340,7 +343,8 @@ int Rw11CntlRK11::AttnHandler(RlinkServer::AttnArgs& args)
if (!go) {
RlogMsg lmsg(LogFile());
lmsg << "-I RK11 cs=" << RosPrintBvi(rkcs,8)
lmsg << "-I " << Name() << ":"
<< " cs=" << RosPrintBvi(rkcs,8)
<< " go=0, spurious attn, dropped";
return 0;
}
@ -363,7 +367,8 @@ int Rw11CntlRK11::AttnHandler(RlinkServer::AttnArgs& args)
RlogMsg lmsg(LogFile());
static const char* fumnemo[8] = {"cr","w ","r ","wc","sk","rc","dr","wl"};
lmsg << "-I RK11 cs=" << RosPrintBvi(rkcs,8)
lmsg << "-I " << Name() << ":"
<< " cs=" << RosPrintBvi(rkcs,8)
<< " da=" << RosPrintBvi(rkda,8)
<< " ad=" << RosPrintBvi(addr,8,18)
<< " fu=" << fumnemo[fu&0x7]
@ -378,8 +383,8 @@ int Rw11CntlRK11::AttnHandler(RlinkServer::AttnArgs& args)
// check for spurious interrupts (either RDY=1 or RDY=0 and rdma busy)
if ((rkcs & kRKCS_M_RDY) || fRdma.IsActive()) {
RlogMsg lmsg(LogFile());
lmsg << "-E RK11 err "
<< " cr=" << RosPrintBvi(rkcs,8)
lmsg << "-E " << Name() << ": err"
<< " cr=" << RosPrintBvi(rkcs,8)
<< " spurious lam: "
<< (fRdma.IsActive() ? "RDY=0 and Rdma busy" : "RDY=1");
return 0;
@ -573,7 +578,7 @@ void Rw11CntlRK11::RdmaPostExecCB(int stat, size_t ndone,
void Rw11CntlRK11::LogRker(uint16_t rker)
{
RlogMsg lmsg(LogFile());
lmsg << "-E RK11 er=" << RosPrintBvi(rker,8) << " ERROR ABORT";
lmsg << "-E " << Name() << ": er=" << RosPrintBvi(rker,8) << " ERROR ABORT";
}
//------------------------------------------+-----------------------------------

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlRK11.hpp 686 2015-06-04 21:08:08Z mueller $
// $Id: Rw11CntlRK11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 2.0.1 Dump(): add detail arg
// 2015-01-03 627 2.0 use Rw11RdmaDisk
// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
// 2014-06-14 562 1.0.1 Add stats definitions
@ -23,7 +24,7 @@
/*!
\file
\version $Id: Rw11CntlRK11.hpp 686 2015-06-04 21:08:08Z mueller $
\version $Id: Rw11CntlRK11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlRK11.
*/
@ -56,7 +57,8 @@ namespace Retro {
const Rstats& RdmaStats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0177400; //!< RK11 default address

View File

@ -1,4 +1,4 @@
// $Id: Rw11CntlRL11.cpp 857 2017-02-26 15:27:41Z mueller $
// $Id: Rw11CntlRL11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2014-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Other credits:
@ -16,6 +16,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.5 Dump(): add detail arg
// 2017-03-03 858 1.0.4 use cntl name as message prefix
// 2017-02-26 857 1.0.3 use kCPAH_M_UBM22
// 2015-06-04 686 1.0.2 check for spurious lams
// 2015-03-04 655 1.0.1 use original boot code again
@ -25,7 +27,7 @@
/*!
\file
\version $Id: Rw11CntlRL11.cpp 857 2017-02-26 15:27:41Z mueller $
\version $Id: Rw11CntlRL11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlRL11.
*/
@ -353,7 +355,8 @@ bool Rw11CntlRL11::BootCode(size_t unit, std::vector<uint16_t>& code,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlRL11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlRL11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlRL11 @ " << this << endl;
@ -374,8 +377,8 @@ void Rw11CntlRL11::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fRd_nwrd: " << RosPrintf(fRd_nwrd,"d",6) << endl;
os << bl << " fRd_fu: " << RosPrintf(fRd_fu,"d",6) << endl;
os << bl << " fRd_ovr: " << fRd_ovr << endl;
fRdma.Dump(os, ind+2, "fRdma: ");
Rw11CntlBase<Rw11UnitRL11,4>::Dump(os, ind, " ^");
fRdma.Dump(os, ind+2, "fRdma: ", detail);
Rw11CntlBase<Rw11UnitRL11,4>::Dump(os, ind, " ^", detail);
return;
}
@ -428,7 +431,8 @@ int Rw11CntlRL11::AttnHandler(RlinkServer::AttnArgs& args)
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
static const char* fumnemo[8] = {"no","wc","gs","se","rh","w ","r ","rn"};
lmsg << "-I RL11 cs=" << RosPrintBvi(rlcs,8)
lmsg << "-I " << Name() << ":"
<< " cs=" << RosPrintBvi(rlcs,8)
<< " da=" << RosPrintBvi(rlda,8)
<< " ad=" << RosPrintBvi(addr,8,18)
<< " fu=" << fumnemo[fu&0x7]
@ -445,8 +449,8 @@ int Rw11CntlRL11::AttnHandler(RlinkServer::AttnArgs& args)
// check for spurious interrupts (either RDY=1 or RDY=0 and rdma busy)
if ((rlcs & kRLCS_M_CRDY) || fRdma.IsActive()) {
RlogMsg lmsg(LogFile());
lmsg << "-E RL11 err "
<< " cr=" << RosPrintBvi(rlcs,8)
lmsg << "-E " << Name() << ": err"
<< " cr=" << RosPrintBvi(rlcs,8)
<< " spurious lam: "
<< (fRdma.IsActive() ? "RDY=0 and Rdma busy" : "RDY=1");
return 0;
@ -505,8 +509,8 @@ int Rw11CntlRL11::AttnHandler(RlinkServer::AttnArgs& args)
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I RL11 ok "
<< " cs=" << RosPrintBvi(cs,8)
lmsg << "-I " << Name() << ":"
<< " ok cs=" << RosPrintBvi(cs,8)
<< " mp=" << RosPrintBvi(crc,8)
<< " pos=" << RosPrintBvi(pos,8)
<< "->" << RosPrintBvi(posn,8);
@ -617,7 +621,8 @@ void Rw11CntlRL11::RdmaPostExecCB(int stat, size_t ndone,
void Rw11CntlRL11::LogRler(uint16_t rlerr)
{
RlogMsg lmsg(LogFile());
lmsg << "-E RL11 err=" << RosPrintBvi(rlerr,2,5) << " ERROR ABORT";
lmsg << "-E " << Name() << ":"
<< " err=" << RosPrintBvi(rlerr,2,5) << " ERROR ABORT";
return;
}
@ -666,7 +671,7 @@ void Rw11CntlRL11::AddErrorExit(RlinkCommandList& clist, uint16_t rlerr)
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I RL11 err"
lmsg << "-I " << Name() << ": err"
<< " cs=" << RosPrintBvi(cs,8)
<< " err=" << RosPrintBvi(rlerr,2,5)
<< " pos=" << RosPrintBvi(fRd_pos,8);
@ -724,7 +729,7 @@ void Rw11CntlRL11::AddNormalExit(RlinkCommandList& clist, size_t ndone,
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I RL11 " << (rlerr==0 ? " ok" : "err")
lmsg << "-I " << Name() << (rlerr==0 ? ": ok" : ": err")
<< " cs=" << RosPrintBvi(cs,8)
<< " ba=" << RosPrintBvi(ba,8)
<< " da=" << RosPrintBvi(da,8)

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlRL11.hpp 665 2015-04-07 07:13:49Z mueller $
// $Id: Rw11CntlRL11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2014-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2014-2017 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
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2015-03-01 653 1.0 Initial version
// 2014-06-08 561 0.1 First draft
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlRL11.hpp 665 2015-04-07 07:13:49Z mueller $
\version $Id: Rw11CntlRL11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlRL11.
*/
@ -53,7 +54,8 @@ namespace Retro {
const Rstats& RdmaStats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0174400; //!< RL11 default address

View File

@ -1,4 +1,4 @@
// $Id: Rw11CntlTM11.cpp 857 2017-02-26 15:27:41Z mueller $
// $Id: Rw11CntlTM11.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Other credits:
@ -15,6 +15,8 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.4 Dump(): add detail arg
// 2017-03-03 858 1.0.3 use cntl name as message prefix
// 2017-02-26 857 1.0.2 use kCPAH_M_UBM22
// 2015-06-06 690 1.0.1 BUGFIX: AddFastExit() check for Virt() defined
// 2015-06-04 686 1.0 Initial version
@ -23,7 +25,7 @@
/*!
\file
\version $Id: Rw11CntlTM11.cpp 857 2017-02-26 15:27:41Z mueller $
\version $Id: Rw11CntlTM11.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11CntlTM11.
*/
@ -273,7 +275,8 @@ bool Rw11CntlTM11::BootCode(size_t unit, std::vector<uint16_t>& code,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11CntlTM11::Dump(std::ostream& os, int ind, const char* text) const
void Rw11CntlTM11::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11CntlTM11 @ " << this << endl;
@ -291,8 +294,8 @@ void Rw11CntlTM11::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fRd_fu: " << fRd_fu << endl;
os << bl << " fRd_opcode: " << fRd_opcode << endl;
os << bl << " fBuf.size() " << RosPrintf(fBuf.size(),"d",6) << endl;
fRdma.Dump(os, ind+2, "fRdma: ");
Rw11CntlBase<Rw11UnitTM11,4>::Dump(os, ind, " ^");
fRdma.Dump(os, ind+2, "fRdma: ", detail);
Rw11CntlBase<Rw11UnitTM11,4>::Dump(os, ind, " ^", detail);
return;
}
@ -327,7 +330,7 @@ int Rw11CntlTM11::AttnHandler(RlinkServer::AttnArgs& args)
RlogMsg lmsg(LogFile());
static const char* fumnemo[8] =
{"un ","rd ","wr ","we ","sf ","sb ","wi ","re "};
lmsg << "-I TM11"
lmsg << "-I " << Name() << ":"
<< " fu=" << fumnemo[fu&07]
<< " un=" << unum
<< " cr=" << RosPrintBvi(tmcr,8)
@ -340,8 +343,8 @@ int Rw11CntlTM11::AttnHandler(RlinkServer::AttnArgs& args)
// check for spurious interrupts (either RDY=1 or RDY=0 and rdma busy)
if ((tmcr & kTMCR_M_RDY) || fRdma.IsActive()) {
RlogMsg lmsg(LogFile());
lmsg << "-E TM11 err "
<< " cr=" << RosPrintBvi(tmcr,8)
lmsg << "-E " << Name() << ": err"
<< " cr=" << RosPrintBvi(tmcr,8)
<< " spurious lam: "
<< (fRdma.IsActive() ? "RDY=0 and Rdma busy" : "RDY=1");
return 0;
@ -386,7 +389,7 @@ int Rw11CntlTM11::AttnHandler(RlinkServer::AttnArgs& args)
unit.Detach();
AddFastExit(clist, opcode, 0);
RlogMsg lmsg(LogFile());
lmsg << "-I TM11"
lmsg << "-I " << Name() << ":"
<< " unit " << unum << "unload";
} else if (fu == kFUNC_READ) { // Read --------------------------
@ -487,9 +490,7 @@ void Rw11CntlTM11::AddErrorExit(RlinkCommandList& clist, uint16_t tmcr)
cpu.AddWibr(clist, fBase+kTMCR, tmcr);
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I TM11"
<< " err "
<< " "
lmsg << "-I " << Name() << ": err "
<< " cr=" << RosPrintBvi(tmcr,8);
}
@ -545,8 +546,7 @@ void Rw11CntlTM11::AddFastExit(RlinkCommandList& clist, int opcode, size_t ndone
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
bool err = tmcr & (kTMCR_M_RBTE);
lmsg << "-I TM11"
<< (err ? " err " :" ok ")
lmsg << "-I " << Name() << (err ? ": err " : ": ok ")
<< " un=" << unum
<< " cr=" << RosPrintBvi(tmcr,8)
<< " "
@ -619,8 +619,7 @@ void Rw11CntlTM11::AddNormalExit(RlinkCommandList& clist, size_t ndone,
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
bool err = tmcr & (kTMCR_M_RPAE|kTMCR_M_RRLE|kTMCR_M_RBTE|kTMCR_M_RNXM);
lmsg << "-I TM11"
<< (err ? " err " :" ok ")
lmsg << "-I " << Name() << (err ? ": err " : ": ok ")
<< " un=" << unum
<< " cr=" << RosPrintBvi(tmcr,8)
<< " ad=" << RosPrintBvi(addr,8,18)
@ -637,7 +636,7 @@ void Rw11CntlTM11::AddNormalExit(RlinkCommandList& clist, size_t ndone,
void Rw11CntlTM11::WriteLog(const char* func, RerrMsg& emsg)
{
RlogMsg lmsg(LogFile());
lmsg << "-E TM11"
lmsg << "-E " << Name() << ":"
<< " error for func=" << func
<< ":" << emsg;

View File

@ -1,6 +1,6 @@
// $Id: Rw11CntlTM11.hpp 690 2015-06-07 18:23:51Z mueller $
// $Id: Rw11CntlTM11.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2015-06-04 686 1.0 Initial version
// 2015-05-17 683 0.1 First draft
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11CntlTM11.hpp 690 2015-06-07 18:23:51Z mueller $
\version $Id: Rw11CntlTM11.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11CntlTM11.
*/
@ -53,7 +54,8 @@ namespace Retro {
const Rstats& RdmaStats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// some constants (also defined in cpp)
static const uint16_t kIbaddr = 0172520; //!< TM11 default address

View File

@ -1,6 +1,6 @@
// $Id: Rw11Rdma.cpp 648 2015-02-20 20:16:21Z mueller $
// $Id: Rw11Rdma.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.1.1 Dump(): add detail arg
// 2015-02-17 647 1.1 PreExecCB with nwdone and nwnext
// 2015-01-04 627 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11Rdma.cpp 648 2015-02-20 20:16:21Z mueller $
\version $Id: Rw11Rdma.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11Rdma.
*/
@ -115,7 +116,8 @@ void Rw11Rdma::QueueWMem(uint32_t addr, const uint16_t* block, size_t size,
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11Rdma::Dump(std::ostream& os, int ind, const char* text) const
void Rw11Rdma::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11Rdma @ " << this << endl;
@ -129,7 +131,7 @@ void Rw11Rdma::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fNWordRest: " << RosPrintf(fNWordRest,"d",4) << endl;
os << bl << " fNWordDone: " << RosPrintf(fNWordDone,"d",4) << endl;
os << bl << " fpBlock: " << fpBlock << endl;
fStats.Dump(os, ind+2, "fStats: ");
fStats.Dump(os, ind+2, "fStats: ", detail-1);
return;
}

View File

@ -1,6 +1,6 @@
// $Id: Rw11Rdma.hpp 648 2015-02-20 20:16:21Z mueller $
// $Id: Rw11Rdma.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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
// 2017-04-02 865 1.1.1 Dump(): add detail arg
// 2015-02-17 647 1.1 PreExecCB with nwdone and nwnext
// 2015-01-04 627 1.0 Initial version
// ---------------------------------------------------------------------------
@ -20,7 +21,7 @@
/*!
\file
\version $Id: Rw11Rdma.hpp 648 2015-02-20 20:16:21Z mueller $
\version $Id: Rw11Rdma.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11Rdma.
*/
@ -68,7 +69,8 @@ namespace Retro {
uint16_t mode);
const Rstats& Stats() const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// statistics counter indices
enum stats {

View File

@ -1,6 +1,6 @@
// $Id: Rw11RdmaDisk.cpp 648 2015-02-20 20:16:21Z mueller $
// $Id: Rw11RdmaDisk.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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,12 +13,13 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2015-01-04 628 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11RdmaDisk.cpp 648 2015-02-20 20:16:21Z mueller $
\version $Id: Rw11RdmaDisk.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of Rw11RdmaDisk.
*/
@ -127,7 +128,8 @@ size_t Rw11RdmaDisk::WriteCheck(size_t nwdone)
//------------------------------------------+-----------------------------------
//! FIXME_docs
void Rw11RdmaDisk::Dump(std::ostream& os, int ind, const char* text) const
void Rw11RdmaDisk::Dump(std::ostream& os, int ind, const char* text,
int detail) const
{
RosFill bl(ind);
os << bl << (text?text:"--") << "Rw11RdmaDisk @ " << this << endl;
@ -138,7 +140,7 @@ void Rw11RdmaDisk::Dump(std::ostream& os, int ind, const char* text) const
os << bl << " fLba: " << RosPrintf(fLba,"d",8) << endl;
os << bl << " fFunc: " << fFunc << endl;
Rw11Rdma::Dump(os, ind, " ^");
Rw11Rdma::Dump(os, ind, " ^", detail);
return;
}

View File

@ -1,6 +1,6 @@
// $Id: Rw11RdmaDisk.hpp 648 2015-02-20 20:16:21Z mueller $
// $Id: Rw11RdmaDisk.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 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,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.0.1 Dump(): add detail arg
// 2015-01-04 627 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11RdmaDisk.hpp 648 2015-02-20 20:16:21Z mueller $
\version $Id: Rw11RdmaDisk.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class Rw11RdmaDisk.
*/
@ -49,7 +50,8 @@ namespace Retro {
size_t WriteCheck(size_t nwdone);
virtual void Dump(std::ostream& os, int ind=0, const char* text=0) const;
virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
// statistics counter indices
enum stats {

View File

@ -1,6 +1,6 @@
// $Id: RtclRw11Cntl.cpp 660 2015-03-29 22:10:16Z mueller $
// $Id: RtclRw11Cntl.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 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
// 2017-04-02 865 1.0.2 M_dump: use GetArgsDump and Dump detail
// 2015-03-27 660 1.0.1 add M_start
// 2013-03-06 495 1.0 Initial version
// 2013-02-08 484 0.1 First draft
@ -20,7 +21,7 @@
/*!
\file
\version $Id: RtclRw11Cntl.cpp 660 2015-03-29 22:10:16Z mueller $
\version $Id: RtclRw11Cntl.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of RtclRw11Cntl.
*/
@ -121,10 +122,12 @@ int RtclRw11Cntl::M_stats(RtclArgs& args)
int RtclRw11Cntl::M_dump(RtclArgs& args)
{
int detail=0;
if (!GetArgsDump(args, detail)) return kERR;
if (!args.AllDone()) return kERR;
ostringstream sos;
Obj().Dump(sos, 0);
Obj().Dump(sos, 0, "", detail);
args.SetResult(sos);
return kOK;
}