w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlPC11.cpp
Go to the documentation of this file.
1// $Id: Rw11CntlPC11.cpp 1185 2019-07-12 17:29:12Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-05-31 1156 1.5.2 size->fuse rename
8// 2019-04-27 1140 1.5.1 use RtraceTools::
9// 2019-04-20 1134 1.5 add pc11_buf readout
10// 2019-04-13 1131 1.4.1 BootCode(): boot loader rewritten
11// remove SetOnline(), use UnitSetup()
12// 2019-04-06 1126 1.4 pbuf.val in msb; rbusy in rbuf (new unbuf iface)
13// Start(): ensure unit offline; BootCode(): 56k top
14// 2019-02-23 1114 1.3.4 use std::bind instead of lambda
15// 2018-12-15 1082 1.3.3 use lambda instead of boost::bind
16// 2018-12-09 1080 1.3.2 use HasVirt(); Virt() returns ref
17// 2018-10-28 1062 1.3.1 replace boost/foreach
18// 2017-05-14 897 1.3 trace received chars
19// 2017-04-02 865 1.2.2 Dump(): add detail arg
20// 2017-03-03 858 1.2.1 use cntl name as message prefix
21// 2014-12-30 625 1.2 adopt to Rlink V4 attn logic
22// 2014-12-25 621 1.1 adopt to 4k word ibus window
23// 2013-05-03 515 1.0 Initial version
24// ---------------------------------------------------------------------------
25
30#include <functional>
31#include <algorithm>
32#include <vector>
33
34#include "librtools/RosFill.hpp"
38#include "librtools/RlogMsg.hpp"
39
40#include "RtraceTools.hpp"
41#include "Rw11CntlPC11.hpp"
42
43using namespace std;
44using namespace std::placeholders;
45
51// all method definitions in namespace Retro
52namespace Retro {
53
54//------------------------------------------+-----------------------------------
55// constants definitions
56
57const uint16_t Rw11CntlPC11::kIbaddr;
58const int Rw11CntlPC11::kLam;
59
60const uint16_t Rw11CntlPC11::kRCSR;
61const uint16_t Rw11CntlPC11::kRBUF;
62const uint16_t Rw11CntlPC11::kPCSR;
63const uint16_t Rw11CntlPC11::kPBUF;
64
65const uint16_t Rw11CntlPC11::kUnit_PR;
66const uint16_t Rw11CntlPC11::kUnit_PP;
67
68const uint16_t Rw11CntlPC11::kProbeOff;
71
72const uint16_t Rw11CntlPC11::kFifoMaxSize;
73
74const uint16_t Rw11CntlPC11::kRCSR_M_ERROR;
75const uint16_t Rw11CntlPC11::kRCSR_V_RLIM;
76const uint16_t Rw11CntlPC11::kRCSR_B_RLIM;
77const uint16_t Rw11CntlPC11::kRCSR_V_TYPE;
78const uint16_t Rw11CntlPC11::kRCSR_B_TYPE;
79const uint16_t Rw11CntlPC11::kRCSR_M_FCLR;
80const uint16_t Rw11CntlPC11::kRBUF_M_RBUSY;
81const uint16_t Rw11CntlPC11::kRBUF_V_FUSE;
82const uint16_t Rw11CntlPC11::kRBUF_B_FUSE;
83const uint16_t Rw11CntlPC11::kRBUF_M_DATA;
84
85const uint16_t Rw11CntlPC11::kPCSR_M_ERROR;
86const uint16_t Rw11CntlPC11::kPCSR_V_RLIM;
87const uint16_t Rw11CntlPC11::kPCSR_B_RLIM;
88const uint16_t Rw11CntlPC11::kPBUF_M_VAL;
89const uint16_t Rw11CntlPC11::kPBUF_V_FUSE;
90const uint16_t Rw11CntlPC11::kPBUF_B_FUSE;
91const uint16_t Rw11CntlPC11::kPBUF_M_DATA;
92
93//------------------------------------------+-----------------------------------
95
97 : Rw11CntlBase<Rw11UnitPC11,2>("pc11"),
98 fPC_pbuf(0),
99 fPC_rbuf(0),
100 fPrQlim(1),
101 fPrRlim(0),
102 fPpRlim(0),
103 fItype(0),
104 fFsize(0),
105 fPpRblkSize(4),
106 fPpQueBusy(false),
107 fPrDrain(kPrDrain_Idle)
108{
109 // must be here because Units have a back-ptr (not available at Rw11CntlBase)
110 for (size_t i=0; i<NUnit(); i++) {
111 fspUnit[i].reset(new Rw11UnitPC11(this, i));
112 }
113
114 fStats.Define(kStatNPrBlk, "NPrBlk" , "wblk done");
115 fStats.Define(kStatNPpQue, "NPpQue" , "rblk queued");
116}
117
118//------------------------------------------+-----------------------------------
120
122{}
123
124//------------------------------------------+-----------------------------------
126
127void Rw11CntlPC11::Config(const std::string& name, uint16_t base, int lam)
128{
129 ConfigCntl(name, base, lam, kProbeOff, kProbeInt, kProbeRem);
130 return;
131}
132
133//------------------------------------------+-----------------------------------
135
137{
138 if (fStarted || fLam<0 || !fEnable || !fProbe.Found())
139 throw Rexception("Rw11CntlPC11::Start",
140 "Bad state: started, no lam, not enable, not found");
141
142 // add device register address ibus and rbus mappings
143 // done here because now Cntl bound to Cpu and Cntl probed
144 Cpu().AllIAddrMapInsert(Name()+".rcsr", Base() + kRCSR);
145 Cpu().AllIAddrMapInsert(Name()+".rbuf", Base() + kRBUF);
146 Cpu().AllIAddrMapInsert(Name()+".pcsr", Base() + kPCSR);
147 Cpu().AllIAddrMapInsert(Name()+".pbuf", Base() + kPBUF);
148
149 // detect device type
151 fFsize = (1<<fItype) - 1;
152 fPrQlim = fFsize;
153
154 // ensure unit status is initialized (online, rlim,...)
155 UnitSetupAll();
156
157 // setup primary info clist
160 if (!Buffered()) {
162 } else {
166 }
168
169 // add attn handler
171 uint16_t(1)<<fLam, this);
172
173 fStarted = true;
174 return;
175}
176
177//------------------------------------------+-----------------------------------
179
180bool Rw11CntlPC11::BootCode(size_t /*unit*/, std::vector<uint16_t>& code,
181 uint16_t& aload, uint16_t& astart)
182{
183 uint16_t bootcode[] = { // papertape lda loader (see pc11boot.mac)
184 0000000, // halt
185 0010706, // start: mov pc,sp ; setup stack
186 0024646, // cmp -(sp),-(sp)
187 0012705, 0177550, // mov #pr.csr,r5
188 0005715, // 1$: tst (r5) ; error bit set ?
189 0100776, // bmi 1$ ; if mi yes, wait
190 0005002, // rdrec: clr r2 ; check checksum
191 0004767, 0000142, // 1$: jsr pc,rdbyte ; read 000 or 001
192 0105700, // tstb r0 ; is zero ?
193 0001774, // beq 1$ ; if eq yes, retry
194 0005300, // dec r0 ; test for 001
195 0001030, // bne err1 ; if ne not, quit
196 0004767, 0000126, // jsr pc,rdbyte ; read 000
197 0105700, // tstb r0 ; is zero ?
198 0001024, // bne err1 ; if ne not, quit
199 0004767, 0000076, // jsr pc,rdword ; read count
200 0010104, // mov r1,r4 ; store count
201 0004767, 0000070, // jsr pc,rdword ; read addr
202 0010103, // mov r1,r3 ; store addr
203 0162704, 0000006, // sub #6,r4 ; sub 6 from count
204 0002414, // blt err2 ; if <6 halt
205 0003016, // bgt rddata ; if >6 read data
206 0004767, 0000072, // jsr pc,rdbyte ; read checksum
207 0105702, // tstb r2 ; test checksum
208 0001010, // bne err3 ; if ne bad, quit
209 0032703, 0000001, // bit #1,r3 ; address odd ?
210 0001402, // beq 2$ ; if eq not
211 0012703, 0000200, // mov #200,r3 ; else use #200
212 0000113, // 2$: jmp (r3) ; start code
213 0000000, // err1: halt ; halt: bad frame
214 0000000, // err2: halt ; halt: bad count
215 0000000, // err3: halt ; halt: bad chksum
216 0000000, // err4: halt ; halt: csr.err
217 0004767, 0000036, // rddata: jsr pc,rdbyte ; read byte
218 0110023, // movb r0,(r3)+ ; store byte
219 0077404, // sob r4,rddata ; loop till done
220 0004767, 0000026, // jsr pc,rdbyte ; read checksum
221 0105702, // tstb r2 ; test checksum
222 0001366, // bne err3 ; if ne bad, quit
223 0000724, // br rdrec ; next record
224 0004767, 0000014, // rdword: jsr pc,rdbyte ; read low byte
225 0010001, // mov r0,r1 ; low byte to r1
226 0004767, 0000006, // jsr pc,rdbyte ; read high byte
227 0000300, // swab r0
228 0050001, // bis r0,r1 ; high byte to r1
229 0000207, // rts pc
230 0005215, // rdbyte: inc (r5) ; set enable
231 0005715, // 1$: tst (r5) ; error set ?
232 0100753, // bmi err4 ; if mi yes, quit
233 0105715, // tstb (r5) ; done set ?
234 0100374, // bpl 1$ ; if pl not, retry
235 0016500, 0000002, // mov 2(r5),r0 ; read byte
236 0060002, // add r0,r2 ; sum checksum
237 0000207 // rts pc
238 };
239
240 code.clear();
241 code.insert(code.end(), std::begin(bootcode), std::end(bootcode));
242
243 uint32_t memsize = Cpu().MemSize();
244 uint16_t boottop = (memsize > 56*1024) ? 56*1024 : memsize;
245 aload = boottop - sizeof(bootcode);
246 astart = aload+2;
247 return true;
248}
249
250//------------------------------------------+-----------------------------------
252
254{
255 Rw11UnitPC11& unit = *fspUnit[ind];
256
257 if (ind == kUnit_PR) { // reader
258 // reader is online when attached but not when virt in eof or error state
259 // and the reader fifo has been emptied
260 bool online = unit.HasVirt() && !
261 ( (unit.Virt().Eof() || unit.Virt().Error()) &&
262 ! (fPrDrain == kPrDrain_Pend) );
263 uint16_t rcsr = (online ? 0 : kRCSR_M_ERROR) | // err field
264 ((fPrRlim & kRCSR_B_RLIM) << kRCSR_V_RLIM); // rlim field
265 Cpu().ExecWibr(fBase+kRCSR, rcsr);
266
267 } else { // puncher
268 // puncher is online when attached and virt not in error state
269 bool online = unit.HasVirt() && ! unit.Virt().Error();
270 uint16_t pcsr = (online ? 0 : kPCSR_M_ERROR) | // err field
271 ((fPpRlim & kPCSR_B_RLIM) << kPCSR_V_RLIM); // rlim field
272 Cpu().ExecWibr(fBase+kPCSR, pcsr);
273 }
274
275 return;
276}
277
278//------------------------------------------+-----------------------------------
280
281void Rw11CntlPC11::SetPrQlim(uint16_t qlim)
282{
283 if (qlim == 0) qlim = fFsize;
284 if (qlim > fFsize)
285 throw Rexception("Rw11CntlPC11::SetPrQlim",
286 "Bad args: qlim larger than fifosize");
287
288 fPrQlim = qlim;
289 return;
290}
291
292//------------------------------------------+-----------------------------------
294
295void Rw11CntlPC11::SetPrRlim(uint16_t rlim)
296{
297 if (rlim > kRCSR_B_RLIM)
298 throw Rexception("Rw11CntlPC11::SetPrRlim","Bad args: rlim too large");
299
300 fPrRlim = rlim;
302 return;
303}
304
305//------------------------------------------+-----------------------------------
307
308void Rw11CntlPC11::SetPpRlim(uint16_t rlim)
309{
310 if (rlim > kPCSR_B_RLIM)
311 throw Rexception("Rw11CntlPC11::SetPpRlim","Bad args: rlim too large");
312
313 fPpRlim = rlim;
315 return;
316}
317
318//------------------------------------------+-----------------------------------
320
322{
323 // if reader is attached pre-fill the fifo
324 if (ind == kUnit_PR && Buffered()) {
325 fPrDrain = kPrDrain_Idle; // clear drain state
326 PrProcessBuf(kRBUF_M_RBUSY); // and pre-fill
327 }
328 return;
329}
330
331//------------------------------------------+-----------------------------------
333
334void Rw11CntlPC11::Dump(std::ostream& os, int ind, const char* text,
335 int detail) const
336{
337 RosFill bl(ind);
338 os << bl << (text?text:"--") << "Rw11CntlPC11 @ " << this << endl;
339 os << bl << " fPC_pbuf: " << fPC_pbuf << endl;
340 os << bl << " fPC_rbuf: " << fPC_rbuf << endl;
341 os << bl << " fPrQlim: " << RosPrintf(fPrQlim,"d",3) << endl;
342 os << bl << " fPrRlim: " << RosPrintf(fPrRlim,"d",3) << endl;
343 os << bl << " fPpRlim: " << RosPrintf(fPpRlim,"d",3) << endl;
344 os << bl << " fItype: " << RosPrintf(fItype,"d",3) << endl;
345 os << bl << " fFsize: " << RosPrintf(fFsize,"d",3) << endl;
346 os << bl << " fPpRblkSize: " << RosPrintf(fPpRblkSize,"d",3) << endl;
347 os << bl << " fPpQueBusy: " << RosPrintf(fPpQueBusy) << endl;
348 os << bl << " fPrDrain: ";
349 switch (fPrDrain) {
350 case kPrDrain_Idle: os << "Idle"; break;
351 case kPrDrain_Pend: os << "Pend"; break;
352 case kPrDrain_Done: os << "Done"; break;
353 default: os << "????";
354 };
355 os << endl;
356 Rw11CntlBase<Rw11UnitPC11,2>::Dump(os, ind, " ^", detail);
357 return;
358}
359
360//------------------------------------------+-----------------------------------
362
364{
367
368 if (!Buffered()) { // un-buffered iface -------------
370 fPrimClist[fPC_pbuf].Data());
371 } else { // buffered iface ----------------
374 }
375
376 return 0;
377}
378
379//------------------------------------------+-----------------------------------
381
382void Rw11CntlPC11::ProcessUnbuf(uint16_t rbuf, uint16_t pbuf)
383{
384 bool rbusy = rbuf & kRBUF_M_RBUSY;
385 bool pval = pbuf & kPBUF_M_VAL;
386 uint8_t ochr = pbuf & kPBUF_M_DATA;
387
388 if (pval) { // punch valid -------------------
389 if (pval) PpWriteChar(ochr);
390 if (fTraceLevel>0) {
391 RlogMsg lmsg(LogFile());
392 lmsg << "-I " << Name() << ": pp"
393 << " pbuf=" << RosPrintBvi(pbuf,8)
394 << " pval=" << pval
395 << " rbusy=" << rbusy
396 << " char=" << RosPrintBvi(ochr,8) << " ";
397 RtraceTools::TraceChar(lmsg, ochr);
398 }
399 }
400
401 if (rbusy) { // reader busy -------------------
402 uint8_t ichr = 0;
403 RerrMsg emsg;
404 int irc = fspUnit[kUnit_PR]->VirtRead(&ichr, 1, emsg);
405 if (irc < 0) {
406 RlogMsg lmsg(LogFile());
407 lmsg << "-E " << Name() << ":" << emsg;
408 }
409
410 if (irc <= 0) {
411 if (fTraceLevel>0) {
412 RlogMsg lmsg(LogFile());
413 lmsg << "-I " << Name() << ": set reader offline";
414 }
416
417 } else {
418 if (fTraceLevel>0) {
419 RlogMsg lmsg(LogFile());
420 lmsg << "-I " << Name() << ": pr"
421 << " rbusy=" << rbusy
422 << " char=" << RosPrintBvi(ichr,8) << " ";
423 RtraceTools::TraceChar(lmsg, ochr);
424 }
425
426 Cpu().ExecWibr(fBase+kRBUF, ichr);
427 }
428 }
429 return;
430}
431
432//------------------------------------------+-----------------------------------
434
436{
437 RerrMsg emsg;
438 bool rc = fspUnit[kUnit_PP]->VirtWrite(&ochr, 1, emsg);
439 if (!rc) {
440 RlogMsg lmsg(LogFile());
441 lmsg << "-E " << Name() << ":" << emsg;
443 }
444
445 return;
446}
447
448//------------------------------------------+-----------------------------------
450
451void Rw11CntlPC11::PrProcessBuf(uint16_t rbuf)
452{
453 bool rbusy = rbuf & kRBUF_M_RBUSY;
454 uint16_t rfuse = (rbuf >>kRBUF_V_FUSE) & kRBUF_B_FUSE;
455 uint8_t ichr = 0;
456 RerrMsg emsg;
457
458 if (! rbusy) return; // quit if no data requested
459
460 if (fPrDrain == kPrDrain_Pend) { // eof/err seen and draining
461 if (rfuse == 0) { // draining done, last char read
462 if (fTraceLevel>0) {
463 RlogMsg lmsg(LogFile());
464 lmsg << "-I " << Name() << ": set reader offline after fifo drained";
465 }
468 }
469 return;
470 }
471
472 if (fPrDrain == kPrDrain_Pend || // draining ongoing or done -> quit
473 fPrDrain == kPrDrain_Done) return;
474 if (rfuse >= fPrQlim) return; // no space in fifo -> quit
475
476 uint16_t nmax = fPrQlim - rfuse;
477 vector<uint16_t> iblock;
478 iblock.reserve(nmax);
479 for (uint16_t i = 0; i<nmax; i++) {
480 int irc = fspUnit[kUnit_PR]->VirtRead(&ichr, 1, emsg);
481 if (irc <= 0) {
482 if (irc < 0) {
483 RlogMsg lmsg(LogFile());
484 lmsg << "-E " << Name() << ":" << emsg;
485 }
486 if (irc == 0 && fTraceLevel>0) {
487 RlogMsg lmsg(LogFile());
488 lmsg << "-I " << Name() << ": eof seen on input stream";
489 }
491 break;
492 } else {
493 iblock.push_back(uint16_t(ichr));
494 }
495 }
496
497 if (iblock.size() > 0) {
498 if (fTraceLevel > 0) {
499 RlogMsg lmsg(LogFile());
500 lmsg << "-I " << Name() << ": pr"
501 << " rfuse=" << RosPrintf(rfuse,"d",3)
502 << " drain=" << fPrDrain
503 << " size=" << RosPrintf(iblock.size(),"d",3);
504 if (fTraceLevel > 1) RtraceTools::TraceBuffer(lmsg, iblock.data(),
505 iblock.size(), fTraceLevel);
506 }
507
509 RlinkCommandList clist;
510 Cpu().AddWbibr(clist, fBase+kRBUF, move(iblock));
511 Server().Exec(clist);
512
513 } else {
514 // if no byte to send, eof seen, and fifo empty --> go offline immediately
515 if (rfuse == 0 && fPrDrain == kPrDrain_Pend) {
516 if (fTraceLevel>0) {
517 RlogMsg lmsg(LogFile());
518 lmsg << "-I " << Name() << ": set reader offline immediately";
519 }
522 }
523 }
524
525 return;
526}
527
528//------------------------------------------+-----------------------------------
530
531void Rw11CntlPC11::PpProcessBuf(const RlinkCommand& cmd, bool prim,
532 uint16_t rbuf)
533{
534 const uint16_t* pbuf = cmd.BlockPointer();
535 size_t done = cmd.BlockDone();
536 if (done == 0) return;
537
538 uint16_t fbeg = 0;
539 uint16_t fend = 0;
540 uint16_t fdel = 0;
541 uint16_t fumin = 0;
542 uint16_t fumax = 0;
543
544 fbeg = (pbuf[0] >>kPBUF_V_FUSE) & kPBUF_B_FUSE;
545 fend = (pbuf[done-1]>>kPBUF_V_FUSE) & kPBUF_B_FUSE;
546 fdel = fbeg-fend+1;
547 fumin = kFifoMaxSize;
548
549 for (size_t i=0; i < done; i++) {
550 uint8_t ochr = pbuf[i] & kPBUF_M_DATA;
551 uint16_t fuse = (pbuf[i]>>kPBUF_V_FUSE) & kPBUF_B_FUSE;
552 fumin = min(fumin,fuse);
553 fumax = max(fumax,fuse);
554 PpWriteChar(ochr);
555 }
556
557 // determine next chunk size from highest fifo 'fuse' field, at least 4
558 fPpRblkSize = max(uint16_t(4), max(uint16_t(done),fumax));
559
560 // queue further reads when queue idle and fifo not emptied
561 // check for 'fuse==1' not seen in current read
562 if ((!fPpQueBusy) && fumin > 1) { // if fumin>1 no fuse==1 seen
564 fPpQueBusy = true;
566 }
567
568 if (fTraceLevel > 0) {
569 RlogMsg lmsg(LogFile());
570 lmsg << "-I " << Name() << ": pp"
571 << " pr,si,do=" << prim
572 << "," << RosPrintf(cmd.BlockSize(),"d",3)
573 << "," << RosPrintf(done,"d",3)
574 << " fifo=" << RosPrintf(fbeg,"d",3)
575 << "," << RosPrintf(fend,"d",3)
576 << ";" << RosPrintf(fdel,"d",3)
577 << "," << RosPrintf(done-fdel,"d",3)
578 << ";" << RosPrintf(fumax,"d",3)
579 << "," << RosPrintf(fumin,"d",3)
580 << " que=" << fPpQueBusy;
581 if (prim) {
582 uint16_t rfuse = (rbuf >>kRBUF_V_FUSE) & kRBUF_B_FUSE;
583 lmsg << " rfuse=" << RosPrintf(rfuse,"d",3);
584 }
585
586 if (fTraceLevel > 1) RtraceTools::TraceBuffer(lmsg, pbuf,
587 done, fTraceLevel);
588 }
589
590 // re-sizing the prim rblk invalidates pbuf -> so must be done last
591 if (prim) { // if primary list
592 fPrimClist[fPC_pbuf].SetBlockRead(fPpRblkSize); // setup size for next attn
593 }
594
595 return;
596}
597
598//------------------------------------------+-----------------------------------
600
602{
603 fPpQueBusy = false;
604 RlinkCommandList clist;
606 clist[0].SetExpectStatus(0, RlinkCommand::kStat_M_RbTout |
608 Server().Exec(clist);
609 PpProcessBuf(clist[0], false, 0);
610 return 0;
611}
612
613} // end namespace Retro
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rexception.hpp:29
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.
Definition: RlinkServer.ipp:60
FIXME_docs.
Definition: RlogMsg.hpp:24
I/O appicator to generate fill characters.
Definition: RosFill.hpp:24
void Inc(size_t ind, double val=1.)
FIXME_docs.
Definition: Rstats.ipp:29
void Define(size_t ind, const std::string &name, const std::string &text)
FIXME_docs.
Definition: Rstats.cpp:72
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
uint16_t fFsize
fifo size
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.
@ kStatNPpQue
queue rblk
@ kStatNPrBlk
done wblk
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)
Definition: Rw11Cntl.hpp:110
uint32_t fTraceLevel
trace level; 0=off;1=cntl
Definition: Rw11Cntl.hpp:114
RlinkCommandList fPrimClist
clist for attn primary info
Definition: Rw11Cntl.hpp:115
uint16_t Base() const
FIXME_docs.
Definition: Rw11Cntl.ipp:88
Rstats fStats
statistics
Definition: Rw11Cntl.hpp:116
Rw11Probe fProbe
controller probe context
Definition: Rw11Cntl.hpp:113
Rw11Cpu & Cpu() const
FIXME_docs.
Definition: Rw11Cntl.ipp:32
void ConfigCntl(const std::string &name, uint16_t base, int lam, uint16_t probeoff, bool probeint, bool proberem)
FIXME_docs.
Definition: Rw11Cntl.cpp:156
bool fStarted
true if Start() called
Definition: Rw11Cntl.hpp:112
bool fEnable
enable flag
Definition: Rw11Cntl.hpp:111
RlinkServer & Server() const
FIXME_docs.
Definition: Rw11Cntl.ipp:48
const std::string & Name() const
FIXME_docs.
Definition: Rw11Cntl.ipp:80
RlogFile & LogFile() const
FIXME_docs.
Definition: Rw11Cntl.ipp:64
virtual void UnitSetupAll()
FIXME_docs.
Definition: Rw11Cntl.cpp:113
uint16_t fBase
controller base address
Definition: Rw11Cntl.hpp:109
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:902
int AddRbibr(RlinkCommandList &clist, uint16_t ibaddr, size_t size)
FIXME_docs.
Definition: Rw11Cpu.cpp:375
uint32_t MemSize() const
FIXME_docs.
Definition: Rw11Cpu.ipp:94
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.
Definition: Rw11Cpu.cpp:491
int AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:354
int AddWbibr(RlinkCommandList &clist, uint16_t ibaddr, const std::vector< uint16_t > &block)
FIXME_docs.
Definition: Rw11Cpu.cpp:385
TV & Virt()
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.
Definition: RosPrintf.ipp:38
void TraceBuffer(RlogMsg &lmsg, const uint16_t *pbuf, size_t done, uint32_t level)
FIXME_docs.
Definition: RtraceTools.cpp:34
void TraceChar(RlogMsg &lmsg, uint8_t chr)
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
bool Found() const
FIXME_docs.
Definition: Rw11Probe.cpp:52
uint16_t DataRem() const
FIXME_docs.
Definition: Rw11Probe.ipp:28