w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlDL11.hpp
Go to the documentation of this file.
1// $Id: Rw11CntlDL11.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; use unit.StatInc[RT]x
8// 2019-04-26 1139 1.4 add dl11_buf readout
9// 2019-04-06 1126 1.3 xbuf.val in msb; rrdy in rbuf (new iface)
10// 2017-05-14 897 1.2 add RcvChar(),TraceChar()
11// 2017-04-02 865 1.1.1 Dump(): add detail arg
12// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
13// 2013-05-04 516 1.0.1 add RxRlim support (receive interrupt rate limit)
14// 2013-03-06 495 1.0 Initial version
15// 2013-02-05 483 0.1 First draft
16// ---------------------------------------------------------------------------
17
18
23#ifndef included_Retro_Rw11CntlDL11
24#define included_Retro_Rw11CntlDL11 1
25
26#include "Rw11CntlBase.hpp"
27#include "Rw11UnitDL11.hpp"
28
29namespace Retro {
30
31 class Rw11CntlDL11 : public Rw11CntlBase<Rw11UnitDL11,1> {
32 public:
33
36
37 void Config(const std::string& name, uint16_t base, int lam);
38
39 virtual void Start();
40
41 virtual void UnitSetup(size_t ind);
42 void Wakeup();
43
44 void SetRxQlim(uint16_t qlim);
45 uint16_t RxQlim() const;
46 void SetRxRlim(uint16_t rlim);
47 uint16_t RxRlim() const;
48 void SetTxRlim(uint16_t rlim);
49 uint16_t TxRlim() const;
50
51 uint16_t Itype() const;
52 bool Buffered() const;
53 uint16_t FifoSize() const;
54
55 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
56 int detail=0) const;
57
58 // some constants (also defined in cpp)
59 static const uint16_t kIbaddr = 0177560;
60 static const int kLam = 1;
61
62 static const uint16_t kRCSR = 000;
63 static const uint16_t kRBUF = 002;
64 static const uint16_t kXCSR = 004;
65 static const uint16_t kXBUF = 006;
66
67 static const uint16_t kProbeOff = kRCSR;
68 static const bool kProbeInt = true;
69 static const bool kProbeRem = true;
70
71 static const uint16_t kFifoMaxSize = 127;
72
73 static const uint16_t kRCSR_V_RLIM = 12;
74 static const uint16_t kRCSR_B_RLIM = 007;
75 static const uint16_t kRCSR_V_TYPE = 8;
76 static const uint16_t kRCSR_B_TYPE = 0007;
77 static const uint16_t kRCSR_M_RDONE = kWBit07;
78 static const uint16_t kRCSR_M_FCLR = kWBit01;
79 static const uint16_t kRBUF_V_RFUSE = 8;
80 static const uint16_t kRBUF_B_RFUSE = 0177;
81 static const uint16_t kRBUF_M_DATA = 0377;
82
83 static const uint16_t kXCSR_V_RLIM = 12;
84 static const uint16_t kXCSR_B_RLIM = 007;
85 static const uint16_t kXCSR_M_XRDY = kWBit07;
86 static const uint16_t kXCSR_M_FCLR = kWBit01;
87 static const uint16_t kXBUF_M_VAL = kWBit15;
88 static const uint16_t kXBUF_V_FUSE = 8;
89 static const uint16_t kXBUF_B_FUSE = 0177;
90 static const uint16_t kXBUF_M_DATA = 0xff;
91
92 // statistics counter indices
93 enum stats {
97 };
98
99 protected:
101 void ProcessUnbuf(uint16_t rbuf, uint16_t xbuf);
102 void RxProcessUnbuf();
103 void RxProcessBuf(uint16_t rbuf);
104 void TxProcessBuf(const RlinkCommand& cmd, bool prim,
105 uint16_t rbuf);
106 int TxRcvHandler();
107 void TraceChar(char dir, uint16_t xbuf, uint8_t chr);
108
109 protected:
110 size_t fPC_xbuf;
111 size_t fPC_rbuf;
112 uint16_t fRxQlim;
113 uint16_t fRxRlim;
114 uint16_t fTxRlim;
115 uint16_t fItype;
116 uint16_t fFsize;
117 uint16_t fTxRblkSize;
119 uint16_t fLastRbuf;
120 };
121
122} // end namespace Retro
123
124#include "Rw11CntlDL11.ipp"
125
126#endif
static const uint16_t kWBit01
Definition: Rbits.hpp:33
static const uint16_t kWBit15
Definition: Rbits.hpp:47
static const uint16_t kWBit07
Definition: Rbits.hpp:39
Implemenation (inline) of Rw11CntlBase.
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
@ kStatNRxBlk
done wblk
@ kStatNTxQue
queue rblk
uint16_t fLastRbuf
last seen rbuf
static const uint16_t kIbaddr
DL11 default address.
void RxProcessBuf(uint16_t rbuf)
FIXME_docs.
uint16_t RxRlim() const
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
uint16_t TxRlim() const
FIXME_docs.
uint16_t RxQlim() const
FIXME_docs.
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.
void Wakeup()
FIXME_docs.
static const uint16_t kXCSR
XCSR reg offset.
uint16_t fFsize
fifo size
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.
uint16_t Itype() const
FIXME_docs.
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
uint16_t FifoSize() const
FIXME_docs.
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
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47