43using namespace std::placeholders;
134 "Bad state: started, no lam, not enable, not found");
167 uint16_t(1)<<
fLam,
this);
188 if (
fspUnit[0]->RcvQueueEmpty())
return;
210 if (qlim == 0) qlim =
fFsize;
213 "Bad args: qlim larger than fifosize");
225 throw Rexception(
"Rw11CntlDL11::SetRxRlim",
"Bad args: rlim too large");
238 throw Rexception(
"Rw11CntlDL11::SetTxRlim",
"Bad args: rlim too large");
252 os << bl << (text?text:
"--") <<
"Rw11CntlDL11 @ " <<
this << endl;
253 os << bl <<
" fPC_xbuf: " <<
fPC_xbuf << endl;
254 os << bl <<
" fPC_rbuf: " <<
fPC_rbuf << endl;
311 uint8_t ichr =
fspUnit[0]->RcvQueueNext();
326 if (
fspUnit[0]->RcvQueueEmpty())
return;
328 uint16_t qsiz =
fspUnit[0]->RcvQueueSize();
329 uint16_t nmax =
fRxQlim - rfuse;
330 if (qsiz < nmax) nmax = qsiz;
332 vector<uint16_t> iblock;
333 iblock.reserve(nmax);
334 for (uint16_t i = 0; i<nmax; i++) {
335 uint8_t ichr =
fspUnit[0]->RcvQueueNext();
336 iblock.push_back(uint16_t(ichr));
342 lmsg <<
"-I " <<
Name() <<
": rx"
344 <<
" size=" <<
RosPrintf(iblock.size(),
"d",3);
368 if (done == 0)
return;
382 for (
size_t i=0; i < done; i++) {
385 fumin = min(fumin,fuse);
386 fumax = max(fumax,fuse);
387 fspUnit[0]->StatIncTx(ochr[i]);
392 fTxRblkSize = max(uint16_t(4), max(uint16_t(done),fumax));
404 lmsg <<
"-I " <<
Name() <<
": tx"
405 <<
" pr,si,do=" << prim
417 lmsg <<
" rfuse=" <<
RosPrintf(rfuse,
"d",3);
456 lmsg <<
"-I " <<
Name() <<
":" <<
' ' << dir <<
'x';
464 if (xval || dir !=
't') {
size_t AddAttn()
FIXME_docs.
static const uint8_t kStat_M_RbNak
stat: rbnak flag set
static const uint8_t kStat_M_RbTout
stat: rbtout flag set
size_t BlockSize() const
FIXME_docs.
size_t BlockDone() const
FIXME_docs.
uint16_t * BlockPointer()
FIXME_docs.
void AddAttnHandler(attnhdl_t &&attnhdl, uint16_t mask, void *cdata=nullptr)
FIXME_docs.
void QueueAction(actnhdl_t &&actnhdl)
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.
std::shared_ptr< Rw11UnitDL11 > fspUnit[NU]
uint16_t fItype
interface type
static const bool kProbeInt
probe int active
static const uint16_t kXBUF_M_DATA
xbuf data mask
void SetRxQlim(uint16_t qlim)
FIXME_docs.
static const uint16_t kXCSR_V_RLIM
xcsr.rlim shift
static const uint16_t kRCSR_M_FCLR
rcsr.fclr mask
static const uint16_t kRCSR_V_TYPE
rcsr.type shift
static const int kLam
DL11 default lam.
static const uint16_t kXCSR_M_FCLR
xcsr.fclr mask
uint16_t fLastRbuf
last seen rbuf
static const uint16_t kIbaddr
DL11 default address.
void RxProcessBuf(uint16_t rbuf)
FIXME_docs.
static const uint16_t kXCSR_M_XRDY
xcsr.xrdy mask
int TxRcvHandler()
FIXME_docs.
static const uint16_t kRBUF_B_RFUSE
rbuf.rfuse bit mask
static const uint16_t kRBUF_V_RFUSE
rbuf.rfuse shift
~Rw11CntlDL11()
Destructor.
void SetTxRlim(uint16_t rlim)
FIXME_docs.
static const bool kProbeRem
probr rem active
static const uint16_t kRCSR_M_RDONE
rcsr.rdone mask
static const uint16_t kRCSR_B_TYPE
rcsr.type bit mask
static const uint16_t kRCSR
RCSR reg offset.
void ProcessUnbuf(uint16_t rbuf, uint16_t xbuf)
FIXME_docs.
void TraceChar(char dir, uint16_t xbuf, uint8_t chr)
FIXME_docs.
uint16_t fRxRlim
rx interrupt rate limit
static const uint16_t kXBUF_B_FUSE
xbuf.fuse bit mask
static const uint16_t kXBUF
XBUF reg offset.
void RxProcessUnbuf()
FIXME_docs.
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const uint16_t kXCSR
XCSR reg offset.
static const uint16_t kRBUF_M_DATA
rbuf data mask
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
uint16_t fTxRblkSize
tx rblk chunk size
bool Buffered() const
FIXME_docs.
static const uint16_t kXCSR_B_RLIM
xcsr.rlim bit mask
static const uint16_t kXBUF_M_VAL
xbuf.val mask
bool fTxQueBusy
tx queue busy
static const uint16_t kRCSR_B_RLIM
rcsr.rlim bit mask
Rw11CntlDL11()
Default constructor.
uint16_t fTxRlim
tx interrupt rate limit
static const uint16_t kRBUF
RBUF reg offset.
static const uint16_t kFifoMaxSize
maximal fifo size
void TxProcessBuf(const RlinkCommand &cmd, bool prim, uint16_t rbuf)
FIXME_docs.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kRCSR_V_RLIM
rcsr.rlim shift
void SetRxRlim(uint16_t rlim)
FIXME_docs.
static const uint16_t kProbeOff
probe address offset (rcsr)
uint16_t fRxQlim
rx queue limit
size_t fPC_xbuf
PrimClist: xbuf index.
virtual void UnitSetup(size_t ind)
FIXME_docs.
virtual void Start()
FIXME_docs.
size_t fPC_rbuf
PrimClist: rbuf index.
static const uint16_t kXBUF_V_FUSE
xbuf.fuse shift
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
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
uint16_t ExecRibr(uint16_t ibaddr)
FIXME_docs.
int AddRbibr(RlinkCommandList &clist, uint16_t ibaddr, size_t size)
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 AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
int AddWbibr(RlinkCommandList &clist, uint16_t ibaddr, const std::vector< uint16_t > &block)
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.
uint16_t DataRem() const
FIXME_docs.