44using namespace std::placeholders;
107 fPrDrain(kPrDrain_Idle)
110 for (
size_t i=0; i<
NUnit(); i++) {
140 "Bad state: started, no lam, not enable, not found");
171 uint16_t(1)<<
fLam,
this);
181 uint16_t& aload, uint16_t& astart)
183 uint16_t bootcode[] = {
241 code.insert(code.end(), std::begin(bootcode), std::end(bootcode));
244 uint16_t boottop = (memsize > 56*1024) ? 56*1024 : memsize;
245 aload = boottop -
sizeof(bootcode);
260 bool online = unit.
HasVirt() && !
283 if (qlim == 0) qlim =
fFsize;
286 "Bad args: qlim larger than fifosize");
298 throw Rexception(
"Rw11CntlPC11::SetPrRlim",
"Bad args: rlim too large");
311 throw Rexception(
"Rw11CntlPC11::SetPpRlim",
"Bad args: rlim too large");
338 os << bl << (text?text:
"--") <<
"Rw11CntlPC11 @ " <<
this << endl;
339 os << bl <<
" fPC_pbuf: " <<
fPC_pbuf << endl;
340 os << bl <<
" fPC_rbuf: " <<
fPC_rbuf << endl;
348 os << bl <<
" fPrDrain: ";
353 default: os <<
"????";
392 lmsg <<
"-I " <<
Name() <<
": pp"
395 <<
" rbusy=" << rbusy
407 lmsg <<
"-E " <<
Name() <<
":" << emsg;
413 lmsg <<
"-I " <<
Name() <<
": set reader offline";
420 lmsg <<
"-I " <<
Name() <<
": pr"
421 <<
" rbusy=" << rbusy
441 lmsg <<
"-E " <<
Name() <<
":" << emsg;
464 lmsg <<
"-I " <<
Name() <<
": set reader offline after fifo drained";
476 uint16_t nmax =
fPrQlim - rfuse;
477 vector<uint16_t> iblock;
478 iblock.reserve(nmax);
479 for (uint16_t i = 0; i<nmax; i++) {
484 lmsg <<
"-E " <<
Name() <<
":" << emsg;
488 lmsg <<
"-I " <<
Name() <<
": eof seen on input stream";
493 iblock.push_back(uint16_t(ichr));
497 if (iblock.size() > 0) {
500 lmsg <<
"-I " <<
Name() <<
": pr"
503 <<
" size=" <<
RosPrintf(iblock.size(),
"d",3);
518 lmsg <<
"-I " <<
Name() <<
": set reader offline immediately";
536 if (done == 0)
return;
549 for (
size_t i=0; i < done; i++) {
552 fumin = min(fumin,fuse);
553 fumax = max(fumax,fuse);
558 fPpRblkSize = max(uint16_t(4), max(uint16_t(done),fumax));
570 lmsg <<
"-I " <<
Name() <<
": pp"
571 <<
" pr,si,do=" << prim
583 lmsg <<
" rfuse=" <<
RosPrintf(rfuse,
"d",3);
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.
virtual size_t NUnit() const
FIXME_docs.
std::shared_ptr< Rw11UnitPC11 > fspUnit[NU]
void PrProcessBuf(uint16_t rbuf)
FIXME_docs.
~Rw11CntlPC11()
Destructor.
static const uint16_t kUnit_PP
unit number of paper puncher
static const uint16_t kRBUF_M_DATA
rbuf data mask
static const uint16_t kRBUF_V_FUSE
rbuf.fuse shift
void PpWriteChar(uint8_t ochr)
FIXME_docs.
static const uint16_t kPBUF_B_FUSE
pbuf.fuse bit mask
static const int kLam
PC11 default lam.
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kRCSR_M_FCLR
rcsr.fclr mask
static const uint16_t kPBUF
PBUF reg offset.
static const uint16_t kPBUF_M_VAL
pbuf.val mask
static const uint16_t kRCSR
RCSR reg offset.
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
void PpProcessBuf(const RlinkCommand &cmd, bool prim, uint16_t rbuf)
FIXME_docs.
static const bool kProbeRem
probr rem active
static const uint16_t kRCSR_M_ERROR
rcsr.err mask
static const uint16_t kProbeOff
probe address offset (rcsr)
static const uint16_t kRCSR_B_TYPE
rcsr.type bit mask
static const uint16_t kPCSR_B_RLIM
pcsr.rlim bit mask
static const uint16_t kPBUF_M_DATA
pbuf data mask
uint16_t fPpRlim
puncher interrupt rate limit
void ProcessUnbuf(uint16_t rbuf, uint16_t pbuf)
FIXME_docs.
bool fPpQueBusy
puncher queue busy
static const uint16_t kFifoMaxSize
maximal fifo size
static const uint16_t kPCSR
PCSR reg offset.
static const uint16_t kRBUF_M_RBUSY
rbuf.rbusy mask
static const uint16_t kPBUF_V_FUSE
pbuf.fuse shift
static const uint16_t kRCSR_V_RLIM
rcsr.rlim shift
@ kPrDrain_Idle
draining not active
@ kPrDrain_Done
draining done
@ kPrDrain_Pend
draining pending
uint16_t fPrQlim
reader queue limit
uint16_t fPpRblkSize
puncher rblk chunk size
static const bool kProbeInt
probe int active
bool Buffered() const
FIXME_docs.
size_t fPC_rbuf
PrimClist: rbuf index.
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
uint16_t fItype
interface type
static const uint16_t kRCSR_B_RLIM
rcsr.rlim bit mask
static const uint16_t kRBUF
RBUF reg offset.
uint16_t fPrRlim
reader interrupt rate limit
void AttachDone(size_t ind)
FIXME_docs.
void SetPpRlim(uint16_t rlim)
FIXME_docs.
void SetPrRlim(uint16_t rlim)
FIXME_docs.
int fPrDrain
reader drain state
static const uint16_t kIbaddr
PC11 default address.
static const uint16_t kPCSR_M_ERROR
pcsr.err mask
int PpRcvHandler()
FIXME_docs.
static const uint16_t kRCSR_V_TYPE
rcsr.type shift
static const uint16_t kPCSR_V_RLIM
pcsr.rlim shift
Rw11CntlPC11()
Default constructor.
virtual bool BootCode(size_t unit, std::vector< uint16_t > &code, uint16_t &aload, uint16_t &astart)
FIXME_docs.
void SetPrQlim(uint16_t qlim)
FIXME_docs.
static const uint16_t kRBUF_B_FUSE
rbuf.fuse bit mask
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kUnit_PR
unit number of paper reader
virtual void Start()
FIXME_docs.
size_t fPC_pbuf
PrimClist: pbuf index.
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.
int AddRbibr(RlinkCommandList &clist, uint16_t ibaddr, size_t size)
FIXME_docs.
uint32_t MemSize() const
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.
bool HasVirt() const
FIXME_docs.
bool Eof() const
FIXME_docs.
bool Error() 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.
uint16_t DataRem() const
FIXME_docs.