w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlPC11.hpp
Go to the documentation of this file.
1// $Id: Rw11CntlPC11.hpp 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-30 1155 1.4.1 size->fuse rename
8// 2019-04-20 1134 1.4 add pc11_buf readout
9// 2019-04-14 1131 1.3.1 remove SetOnline(), use UnitSetup()
10// 2019-04-06 1126 1.3 pbuf.val in msb; rbusy in rbuf (new iface)
11// 2017-04-02 865 1.2.1 Dump(): add detail arg
12// 2014-12-29 623 1.1 adapt to Rlink V4 attn logic
13// 2013-05-03 515 1.0 Initial version
14// ---------------------------------------------------------------------------
15
16
21#ifndef included_Retro_Rw11CntlPC11
22#define included_Retro_Rw11CntlPC11 1
23
24#include "Rw11CntlBase.hpp"
25#include "Rw11UnitPC11.hpp"
26
27namespace Retro {
28
29 class Rw11CntlPC11 : public Rw11CntlBase<Rw11UnitPC11,2> {
30 public:
31
34
35 void Config(const std::string& name, uint16_t base, int lam);
36
37 virtual void Start();
38
39 virtual bool BootCode(size_t unit, std::vector<uint16_t>& code,
40 uint16_t& aload, uint16_t& astart);
41
42 virtual void UnitSetup(size_t ind);
43
44 void SetPrQlim(uint16_t qlim);
45 uint16_t PrQlim() const;
46 void SetPrRlim(uint16_t rlim);
47 uint16_t PrRlim() const;
48 void SetPpRlim(uint16_t rlim);
49 uint16_t PpRlim() const;
50
51 uint16_t Itype() const;
52 bool Buffered() const;
53 uint16_t FifoSize() const;
54
55 void AttachDone(size_t ind);
56
57 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
58 int detail=0) const;
59
60 // some constants (also defined in cpp)
61 static const uint16_t kIbaddr = 0177550;
62 static const int kLam = 10;
63
64 static const uint16_t kRCSR = 000;
65 static const uint16_t kRBUF = 002;
66 static const uint16_t kPCSR = 004;
67 static const uint16_t kPBUF = 006;
68
69 static const uint16_t kUnit_PR = 0;
70 static const uint16_t kUnit_PP = 1;
71
72 static const uint16_t kProbeOff = kRCSR;
73 static const bool kProbeInt = true;
74 static const bool kProbeRem = true;
75
76 static const uint16_t kFifoMaxSize = 127;
77
78 static const uint16_t kRCSR_M_ERROR = kWBit15;
79 static const uint16_t kRCSR_V_RLIM = 12;
80 static const uint16_t kRCSR_B_RLIM = 007;
81 static const uint16_t kRCSR_V_TYPE = 8;
82 static const uint16_t kRCSR_B_TYPE = 0007;
83 static const uint16_t kRCSR_M_FCLR = kWBit01;
84 static const uint16_t kRBUF_M_RBUSY = kWBit15;
85 static const uint16_t kRBUF_V_FUSE = 8;
86 static const uint16_t kRBUF_B_FUSE = 0177;
87 static const uint16_t kRBUF_M_DATA = 0377;
88
89 static const uint16_t kPCSR_M_ERROR = kWBit15;
90 static const uint16_t kPCSR_V_RLIM = 12;
91 static const uint16_t kPCSR_B_RLIM = 007;
92 static const uint16_t kPBUF_M_VAL = kWBit15;
93 static const uint16_t kPBUF_V_FUSE = 8;
94 static const uint16_t kPBUF_B_FUSE = 0177;
95 static const uint16_t kPBUF_M_DATA = 0377;
96
97 // statistics counter indices
98 enum stats {
102 };
103
104 // PrDrain state definitions
105 enum prdrain {
109 };
110
111 protected:
113 void ProcessUnbuf(uint16_t rbuf, uint16_t pbuf);
114 void PpWriteChar(uint8_t ochr);
115 void PrProcessBuf(uint16_t rbuf);
116 void PpProcessBuf(const RlinkCommand& cmd, bool prim,
117 uint16_t rbuf);
118 int PpRcvHandler();
119
120 protected:
121 size_t fPC_pbuf;
122 size_t fPC_rbuf;
123 uint16_t fPrQlim;
124 uint16_t fPrRlim;
125 uint16_t fPpRlim;
126 uint16_t fItype;
127 uint16_t fFsize;
128 uint16_t fPpRblkSize;
131 };
132
133} // end namespace Retro
134
135#include "Rw11CntlPC11.ipp"
136
137#endif
static const uint16_t kWBit01
Definition: Rbits.hpp:33
static const uint16_t kWBit15
Definition: Rbits.hpp:47
Implemenation (inline) of Rw11CntlBase.
void PrProcessBuf(uint16_t rbuf)
FIXME_docs.
~Rw11CntlPC11()
Destructor.
uint16_t FifoSize() const
FIXME_docs.
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.
uint16_t Itype() const
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.
uint16_t PrRlim() const
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 PpRlim() const
FIXME_docs.
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
uint16_t PrQlim() const
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 kUnit_PR
unit number of paper reader
virtual void Start()
FIXME_docs.
size_t fPC_pbuf
PrimClist: pbuf index.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47