40using namespace std::placeholders;
140 std::bind(&
Rw11CntlTM11::RdmaPreExecCB, this, _1, _2, _3, _4),
141 std::bind(&
Rw11CntlTM11::RdmaPostExecCB, this, _1, _2, _3, _4))
144 for (
size_t i=0; i<
NUnit(); i++) {
180 "Bad state: started, no lam, not enable, not found");
204 uint16_t(1)<<
fLam,
this);
235 uint16_t& aload, uint16_t& astart)
237 uint16_t kBOOT_START = 02000;
238 uint16_t bootcode[] = {
240 0012706, kBOOT_START,
241 0012700, uint16_t(unit),
259 0012704, uint16_t(kBOOT_START+020),
265 code.insert(code.end(), std::begin(bootcode), std::end(bootcode));
267 astart = kBOOT_START+2;
278 os << bl << (text?text:
"--") <<
"Rw11CntlTM11 @ " <<
this << endl;
289 os << bl <<
" fRd_fu: " <<
fRd_fu << endl;
291 os << bl <<
" fRd_opcode: " <<
fRd_opcode << endl;
292 os << bl <<
" fBuf.size: " <<
RosPrintf(
fBuf.size(),
"d",6) << endl;
293 fRdma.
Dump(os, ind+2,
"fRdma: ", detail);
315 uint32_t addr = uint32_t(ea)<<16 | uint32_t(tmba);
320 uint32_t nbyt = (~uint32_t(tmbc)&0xffff) + 1;
327 static const char* fumnemo[8] =
328 {
"un ",
"rd ",
"wr ",
"we ",
"sf ",
"sb ",
"wi ",
"re "};
329 lmsg <<
"-I " <<
Name() <<
":"
330 <<
" fu=" << fumnemo[fu&07]
336 if (nbyt==65536) lmsg <<
" (0)";
else lmsg <<
RosPrintf(nbyt,
"d",5);
342 lmsg <<
"-E " <<
Name() <<
": err"
350 if (unum >=
NUnit()) {
388 lmsg <<
"-I " <<
Name() <<
":"
389 <<
" unit " << unum <<
"unload";
393 size_t nwalloc = (nbyt+1)/2;
394 if (
fBuf.size() < nwalloc)
fBuf.resize(nwalloc);
408 size_t nwdma = (nbyt+1)/2;
409 if (
fBuf.size() < nwdma)
fBuf.resize(nwdma);
482 lmsg <<
"-I " <<
Name() <<
": err "
525 uint16_t tmbc =
fRd_tmbc + uint16_t(ndone);
551 uint16_t tmbc =
fRd_tmbc + 2*uint16_t(ndone);
552 size_t nbyt = 2*ndone;
604 uint16_t tmba = uint16_t(addr & 0xfffe);
605 uint16_t ea = uint16_t((addr>>16)&0x0003);
628 lmsg <<
"-E " <<
Name() <<
":"
629 <<
" error for func=" << func
639 uint16_t tmbc, uint16_t tmds)
646 lmsg <<
"-I " <<
Name() << (err ?
": err " :
": ok ")
size_t AddWreg(uint16_t addr, uint16_t data)
FIXME_docs.
size_t AddAttn()
FIXME_docs.
size_t Size() const
FIXME_docs.
void AddAttnHandler(attnhdl_t &&attnhdl, uint16_t mask, void *cdata=nullptr)
FIXME_docs.
void GetAttnInfo(AttnArgs &args, RlinkCommandList &clist)
FIXME_docs.
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
I/O appicator to generate fill characters.
void Inc(size_t ind, double val=1.)
FIXME_docs.
void Define(size_t ind, const std::string &name, const std::string &text)
FIXME_docs.
Implemenation (inline) of Rw11CntlBase.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
virtual size_t NUnit() const
FIXME_docs.
std::shared_ptr< Rw11UnitTM11 > fspUnit[NU]
static const uint16_t kTMDB
TMDB reg offset.
static const uint16_t kTMRL_M_WRL
WRL: write locked.
void WriteExitLog(uint16_t tmcr, uint32_t addr, uint16_t tmbc, uint16_t tmds)
FIXME_docs.
uint32_t fRd_addr
Rdma: current addr.
static const uint16_t kTMSR_M_WRL
WRL: write locked.
static const uint16_t kTMCR_M_GO
static const uint16_t kTMSR_M_NXM
NXM: non-existent mem.
static const int kLam
TM11 default lam.
static const uint16_t kTMRL_M_ONL
ONL: online.
void RdmaPostExecCB(int stat, size_t ndone, RlinkCommandList &clist, size_t ncmd)
FIXME_docs.
static const uint16_t kTMSR_M_EOT
EOT: end-of-tape seen.
static const uint16_t kTMCR_M_RICMD
static const uint16_t kTMCR_B_REA
size_t fPC_tmsr
PrimClist: tmsr index.
static const uint16_t kFUNC_UNLOAD
static const uint16_t kTMRL_M_REW
REW: tape rewinding.
int fRd_opcode
Rdma: read opcode.
static const uint16_t kTMSR_M_BTE
BTE: bad tape error.
static const uint16_t kFUNC_SBACK
virtual bool BootCode(size_t unit, std::vector< uint16_t > &code, uint16_t &aload, uint16_t &astart)
FIXME_docs.
uint16_t fRd_fu
Rdma: request fu code.
static const bool kProbeRem
probr rem active
uint16_t fRd_tmbc
Rdma: request tmbc.
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const uint16_t kTMCR_M_RPAE
static const uint16_t kTMCR_B_FUNC
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kTMSR_M_TUR
TUR: unit ready.
static const uint16_t kTMCR_V_EA
static const uint16_t kTMSR
TMSR reg offset.
static const uint16_t kTMSR_M_ONL
ONL: online.
size_t fRd_rddone
Rdma: bytes read.
static const uint16_t kTMCR
TMCR reg offset.
static const uint16_t kTMSR_M_REW
REW: tape rewound.
static const uint16_t kFUNC_REWIND
size_t fPC_tmba
PrimClist: tmba index.
static const uint16_t kTMCR_M_RRLE
void AddFastExit(RlinkCommandList &clist, int opcode, size_t ndone)
FIXME_docs.
static const uint16_t kRFUNC_WUNIT
Rw11Rdma fRdma
Rdma controller.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kTMBA
TMBA reg offset.
size_t fPC_tmbc
PrimClist: tmbc index.
static const uint16_t kTMCR_V_REA
static const uint16_t kIbaddr
TM11 default address.
virtual void Start()
FIXME_docs.
uint16_t fRd_tmcr
Rdma: request tmcr.
std::vector< uint16_t > fBuf
data buffer
void WriteLog(const char *func, RerrMsg &emsg)
FIXME_docs.
static const uint16_t kTMSR_M_EOF
EOF: end-of-file seen.
static const uint16_t kTMRL
TMRL reg offset.
static const uint16_t kTMCR_M_REAENA
~Rw11CntlTM11()
Destructor.
static const uint16_t kTMCR_M_RDY
uint16_t fRd_tmba
Rdma: request tmba.
static const uint16_t kRFUNC_DONE
static const uint16_t kTMSR_M_BOT
BOT: at begin-of-tape.
static const uint16_t kTMCR_B_EA
static const uint16_t kTMCR_V_DEN
static const uint16_t kFUNC_SFORW
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
@ kStatNFuncSback
func SBACK
@ kStatNFuncRead
func READ
@ kStatNFuncRewind
func REWIND
@ kStatNFuncWrite
func WRITE
@ kStatNFuncSforw
func SFORW
@ kStatNFuncUnload
func UNLOAD
@ kStatNFuncWeof
func WEOF
@ kStatNFuncWrteg
func WRTEG
static const uint16_t kTMSR_M_ICMD
ICMD: invalid cmd.
static const uint16_t kTMSR_M_PAE
PAE: parity error.
static const uint16_t kFUNC_READ
static const uint16_t kTMCR_B_UNIT
void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext, RlinkCommandList &clist)
FIXME_docs.
Rw11CntlTM11()
Default constructor.
static const uint16_t kTMCR_M_RBTE
static const uint16_t kTMCR_M_RNXM
void AddNormalExit(RlinkCommandList &clist, size_t ndone, uint16_t tmcr=0)
FIXME_docs.
uint32_t fRd_nwrd
Rdma: current nwrd.
static const uint16_t kTMCR_V_FUNC
static const uint16_t kTMCR_B_DEN
static const uint16_t kTMRL_M_EOT
EOT: end-of-tape seen.
static const uint16_t kTMSR_M_RLE
RLE: record lgth error.
static const bool kProbeInt
probe int active
static const uint16_t kTMCR_V_UNIT
static const uint16_t kTMRL_M_EOF
EOF: end-of-file seen.
static const uint16_t kFUNC_WEIRG
static const uint16_t kProbeOff
probe address offset (tmcr)
static const uint16_t kTMRL_M_BOT
BOT: at begin-of-tape.
static const uint16_t kFUNC_WRITE
size_t fPC_tmcr
PrimClist: tmcr index.
static const uint16_t kTMBC
TMBC reg offset.
static const uint16_t kTMCR_V_RUNIT
void AddErrorExit(RlinkCommandList &clist, uint16_t tmcr)
FIXME_docs.
static const uint16_t kFUNC_WEOF
static const uint16_t kTMCR_V_ERR
uint16_t fRd_tmsr
Rdma: request tmsr.
int fLam
attn bit number (-1 of none)
uint32_t fTraceLevel
trace level; 0=off;1=cntl
RlinkCommandList fPrimClist
clist for attn primary info
uint16_t Base() const
FIXME_docs.
Rw11Probe fProbe
controller probe context
Rw11Cpu & Cpu() const
FIXME_docs.
void ConfigCntl(const std::string &name, uint16_t base, int lam, uint16_t probeoff, bool probeint, bool proberem)
FIXME_docs.
bool fStarted
true if Start() called
RlinkServer & Server() const
FIXME_docs.
const std::string & Name() const
FIXME_docs.
RlogFile & LogFile() const
FIXME_docs.
virtual void UnitSetupAll()
FIXME_docs.
uint16_t fBase
controller base address
static const uint16_t kCPMEM
CPMEM reg offset.
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
static const uint16_t kCPMEMBE_M_BE0
membe: be0 flag
int AddLalh(RlinkCommandList &clist, uint32_t addr, uint16_t mode=kCPAH_M_22BIT)
FIXME_docs.
void ExecWibr(uint16_t ibaddr0, uint16_t data0, uint16_t ibaddr1=0, uint16_t data1=0, uint16_t ibaddr2=0, uint16_t data2=0)
FIXME_docs.
int AddMembe(RlinkCommandList &clist, uint16_t be, bool stick=false)
FIXME_docs.
int AddWibr(RlinkCommandList &clist, uint16_t ibaddr, uint16_t data)
FIXME_docs.
int AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
static const uint16_t kCPAH_M_UBM22
ubmap+22bit
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
bool IsActive() const
FIXME_docs.
@ kStatusFailRdma
last rdma transfer failed
@ kStatusBusy
more chunks to come
void QueueWMem(uint32_t addr, const uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
void QueueRMem(uint32_t addr, uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
void SetTmds(uint16_t tmds)
FIXME_docs.
bool VirtWriteRecord(size_t nbyte, const uint8_t *data, int &opcode, RerrMsg &emsg)
FIXME_docs.
bool VirtSpaceForw(size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)
FIXME_docs.
bool VirtSpaceBack(size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)
FIXME_docs.
bool VirtRewind(int &opcode, RerrMsg &emsg)
FIXME_docs.
bool VirtWriteEof(RerrMsg &emsg)
FIXME_docs.
bool VirtReadRecord(size_t nbyte, uint8_t *data, size_t &ndone, int &opcode, RerrMsg &emsg)
FIXME_docs.
virtual void Detach()
FIXME_docs.
bool HasVirt() const
FIXME_docs.
@ kOpCodeRecLenErr
record length error
@ kOpCodeBadParity
record with parity error
bool Eot() const
FIXME_docs.
bool Bot() const
FIXME_docs.
virtual bool WProt() const
FIXME_docs.
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Declaration of class ReventLoop.
bool Found() const
FIXME_docs.