w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlRHRP.hpp
Go to the documentation of this file.
1// $Id: Rw11CntlRHRP.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-06-07 1160 1.0.2 RdmaStats() not longer const
8// 2017-04-02 865 1.0.1 Dump(): add detail arg
9// 2015-05-14 680 1.0 Initial version
10// 2015-03-21 659 0.1 First draft
11// ---------------------------------------------------------------------------
12
13
18#ifndef included_Retro_Rw11CntlRHRP
19#define included_Retro_Rw11CntlRHRP 1
20
21#include "Rw11CntlBase.hpp"
22#include "Rw11UnitRHRP.hpp"
23#include "Rw11RdmaDisk.hpp"
24
25namespace Retro {
26
27 class Rw11CntlRHRP : public Rw11CntlBase<Rw11UnitRHRP,4> {
28 public:
29
32
33 void Config(const std::string& name, uint16_t base, int lam);
34
35 virtual void Start();
36
37 virtual bool BootCode(size_t unit, std::vector<uint16_t>& code,
38 uint16_t& aload, uint16_t& astart);
39
40 virtual void UnitSetup(size_t ind);
41
42 void SetChunkSize(size_t chunk);
43 size_t ChunkSize() const;
44
46
47 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
48 int detail=0) const;
49
50 // some constants (also defined in cpp)
51 static const uint16_t kIbaddr = 0176700;
52 static const int kLam = 6;
53
54 static const uint16_t kRPCS1 = 000;
55 static const uint16_t kRPWC = 002;
56 static const uint16_t kRPBA = 004;
57 static const uint16_t kRPDA = 006;
58 static const uint16_t kRPCS2 = 010;
59 static const uint16_t kRPDS = 012;
60 static const uint16_t kRPER1 = 014;
61 static const uint16_t kRPAS = 016;
62 static const uint16_t kRPLA = 020;
63 static const uint16_t kRPDB = 022;
64 static const uint16_t kRPMR1 = 024;
65 static const uint16_t kRPDT = 026;
66 static const uint16_t kRPSN = 030;
67 static const uint16_t kRPOF = 032;
68 static const uint16_t kRPDC = 034;
69 static const uint16_t kRxM13 = 036;
70 static const uint16_t kRxM14 = 040;
71 static const uint16_t kRxM15 = 042;
72 static const uint16_t kRPEC1 = 044;
73 static const uint16_t kRPEC2 = 046;
74 static const uint16_t kRPBAE = 050;
75 static const uint16_t kRPCS3 = 052;
76
77 static const uint16_t kProbeOff = kRPCS2;
78 static const bool kProbeInt = true;
79 static const bool kProbeRem = true;
80
81 static const uint16_t kRPCS1_M_SC = kWBit15;
82 static const uint16_t kRPCS1_M_TRE = kWBit14;
83 static const uint16_t kRPCS1_M_DVA = kWBit11;
84 static const uint16_t kRPCS1_M_BAE = 001400;
85 static const uint16_t kRPCS1_V_BAE = 8;
86 static const uint16_t kRPCS1_B_BAE = 0003;
87 static const uint16_t kRPCS1_M_RDY = kWBit07;
88 static const uint16_t kRPCS1_M_IE = kWBit06;
89 static const uint16_t kRPCS1_V_FUNC = 1;
90 static const uint16_t kRPCS1_B_FUNC = 0037;
91 static const uint16_t kRPCS1_M_GO = kWBit00;
92
93 // only function codes handled in backend are defined
94 static const uint16_t kFUNC_WCD = 024;
95 static const uint16_t kFUNC_WCHD = 025;
96 static const uint16_t kFUNC_WRITE = 030;
97 static const uint16_t kFUNC_WHD = 031;
98 static const uint16_t kFUNC_READ = 034;
99 static const uint16_t kFUNC_RHD = 035;
100 // remote function codes
101 static const uint16_t kRFUNC_WUNIT = 001;
102 static const uint16_t kRFUNC_CUNIT = 002;
103 static const uint16_t kRFUNC_DONE = 003;
104 static const uint16_t kRFUNC_WIDLY = 004;
105
106 // cs1 usage or rem func=wunit
107 static const uint16_t kRPCS1_V_RUNIT = 8;
108 static const uint16_t kRPCS1_B_RUNIT = 0003;
109 // cs1 usage or rem func=done
110 static const uint16_t kRPCS1_M_RATA = kWBit08;
111 // cs1 usage or rem func=widly
112 static const uint16_t kRPCS1_V_RIDLY = 8;
113 static const uint16_t kRPCS1_B_RIDLY = 0377;
114
115 static const uint16_t kRPDA_V_TA = 8;
116 static const uint16_t kRPDA_B_TA = 0037;
117 static const uint16_t kRPDA_B_SA = 0077;
118
119 static const uint16_t kRPCS2_M_RWCO = kWBit15;
120 static const uint16_t kRPCS2_M_WCE = kWBit14;
121 static const uint16_t kRPCS2_M_NED = kWBit12;
122 static const uint16_t kRPCS2_M_NEM = kWBit11;
123 static const uint16_t kRPCS2_M_PGE = kWBit10;
124 static const uint16_t kRPCS2_M_MXF = kWBit09;
125 static const uint16_t kRPCS2_M_OR = kWBit07;
126 static const uint16_t kRPCS2_M_IR = kWBit06;
127 static const uint16_t kRPCS2_M_CLR = kWBit05;
128 static const uint16_t kRPCS2_M_PAT = kWBit04;
129 static const uint16_t kRPCS2_M_BAI = kWBit03;
130 static const uint16_t kRPCS2_M_UNIT2 = kWBit02;
131 static const uint16_t kRPCS2_B_UNIT = 0003;
132
133 static const uint16_t kRPDS_M_ATA = kWBit15;
134 static const uint16_t kRPDS_M_ERP = kWBit14;
135 static const uint16_t kRPDS_M_MOL = kWBit12;
136 static const uint16_t kRPDS_M_WRL = kWBit11;
137 static const uint16_t kRPDS_M_LBT = kWBit10;
138 static const uint16_t kRPDS_M_DPR = kWBit08;
139 static const uint16_t kRPDS_M_DRY = kWBit07;
140 static const uint16_t kRPDS_M_VV = kWBit06;
141 static const uint16_t kRPDS_M_OM = kWBit00;
142
143 static const uint16_t kRPER1_M_UNS = kWBit14;
144 static const uint16_t kRPER1_M_WLE = kWBit11;
145 static const uint16_t kRPER1_M_IAE = kWBit10;
146 static const uint16_t kRPER1_M_AOE = kWBit09;
147 static const uint16_t kRPER1_M_RMR = kWBit02;
148 static const uint16_t kRPER1_M_ILF = kWBit00;
149
150 static const uint16_t kRPDC_B_CA = 01777;
151
152 static const uint16_t kRPCS3_M_IE = kWBit06;
153 static const uint16_t kRPCS3_M_RSEARDONE = kWBit03;
154 static const uint16_t kRPCS3_M_RPACKDONE = kWBit02;
155 static const uint16_t kRPCS3_M_RPOREDONE = kWBit01;
156 static const uint16_t kRPCS3_M_RSEEKDONE = kWBit00;
157
158 // statistics counter indices
159 enum stats {
168 };
169
170 protected:
172 void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext,
173 RlinkCommandList& clist);
174 void RdmaPostExecCB(int stat, size_t ndone,
175 RlinkCommandList& clist, size_t ncmd);
176 void AddErrorExit(RlinkCommandList& clist, uint16_t rper1);
177 void AddNormalExit(RlinkCommandList& clist, size_t ndone,
178 uint16_t rper1=0, uint16_t rpcs2=0);
179
180 protected:
181 size_t fPC_rpcs1;
182 size_t fPC_rpcs2;
183 size_t fPC_rpcs3;
184 size_t fPC_rpwc;
185 size_t fPC_rpba;
186 size_t fPC_rpbae;
187 size_t fPC_cunit;
188 size_t fPC_rpds;
189 size_t fPC_rpda;
190 size_t fPC_rpdc;
191
192 uint16_t fRd_rpcs1;
193 uint16_t fRd_rpcs2;
194 uint16_t fRd_rpcs3;
195 uint16_t fRd_rpwc;
196 uint16_t fRd_rpba;
197 uint16_t fRd_rpbae;
198 uint16_t fRd_rpds;
199 uint16_t fRd_rpda;
200 uint16_t fRd_rpdc;
201 uint32_t fRd_addr;
202 uint32_t fRd_lba;
203 uint32_t fRd_nwrd;
204 uint16_t fRd_fu;
205 bool fRd_ovr;
207 };
208
209} // end namespace Retro
210
211#include "Rw11CntlRHRP.ipp"
212
213#endif
static const uint16_t kWBit14
Definition: Rbits.hpp:46
static const uint16_t kWBit06
Definition: Rbits.hpp:38
static const uint16_t kWBit12
Definition: Rbits.hpp:44
static const uint16_t kWBit01
Definition: Rbits.hpp:33
static const uint16_t kWBit15
Definition: Rbits.hpp:47
static const uint16_t kWBit08
Definition: Rbits.hpp:40
static const uint16_t kWBit09
Definition: Rbits.hpp:41
static const uint16_t kWBit00
Definition: Rbits.hpp:32
static const uint16_t kWBit03
Definition: Rbits.hpp:35
static const uint16_t kWBit04
Definition: Rbits.hpp:36
static const uint16_t kWBit11
Definition: Rbits.hpp:43
static const uint16_t kWBit07
Definition: Rbits.hpp:39
static const uint16_t kWBit10
Definition: Rbits.hpp:42
static const uint16_t kWBit05
Definition: Rbits.hpp:37
static const uint16_t kWBit02
Definition: Rbits.hpp:34
FIXME_docs.
Definition: Rstats.hpp:28
Implemenation (inline) of Rw11CntlBase.
static const uint16_t kRPCS1_B_BAE
virtual bool BootCode(size_t unit, std::vector< uint16_t > &code, uint16_t &aload, uint16_t &astart)
FIXME_docs.
static const uint16_t kFUNC_READ
func: read
uint16_t fRd_rpdc
Rdma: request rpdc.
static const uint16_t kRPCS1_M_TRE
static const uint16_t kRPCS1_V_RIDLY
static const uint16_t kProbeOff
probe address offset (rxcs2)
static const uint16_t kRPCS1_B_RIDLY
static const uint16_t kRPCS1_V_RUNIT
static const uint16_t kRPCS1_B_FUNC
static const uint16_t kRFUNC_WIDLY
rfunc: write idly
static const uint16_t kRPDA
RPDA reg offset.
static const uint16_t kRPDS_M_DPR
static const uint16_t kRPCS3_M_RSEEKDONE
static const uint16_t kRPDS_M_LBT
size_t fPC_rpcs3
PrimClist: rpcs3 index.
static const uint16_t kRPCS1_M_SC
uint16_t fRd_rpcs3
Rdma: request rpcs3.
static const bool kProbeRem
probr rem active
static const uint16_t kRPCS2_M_UNIT2
static const uint16_t kRPCS2_M_WCE
static const uint16_t kRPCS1_M_RATA
size_t fPC_rpba
PrimClist: rpba index.
static const uint16_t kRPDT
RPDT reg offset.
static const uint16_t kRPDS_M_ATA
static const uint16_t kRPDS_M_MOL
void RdmaPostExecCB(int stat, size_t ndone, RlinkCommandList &clist, size_t ncmd)
FIXME_docs.
static const uint16_t kRPDC
RPDC reg offset.
static const uint16_t kRPCS3_M_IE
static const uint16_t kRPBAE
RPBAE reg offset.
bool fRd_ovr
Rdma: overrun condition found.
static const uint16_t kRPCS1
RPCS1 reg offset.
static const uint16_t kRPER1_M_WLE
static const uint16_t kRPCS2_M_NEM
static const uint16_t kRPER1_M_ILF
static const uint16_t kRPER1_M_AOE
static const uint16_t kRPCS3
RPCS3 reg offset.
static const uint16_t kRPEC1
RPEC1 reg offset.
static const uint16_t kFUNC_WHD
func: write head&data
static const uint16_t kRPDC_B_CA
uint16_t fRd_rpda
Rdma: request rpda.
size_t fPC_cunit
PrimClist: copy unit.
static const uint16_t kRPDA_V_TA
static const uint16_t kFUNC_WRITE
func: write
static const int kLam
RHRP default lam.
static const uint16_t kRPCS1_M_RDY
static const uint16_t kRPCS1_V_BAE
static const uint16_t kRPDA_B_TA
virtual void Start()
FIXME_docs.
static const uint16_t kRPDS_M_DRY
static const uint16_t kRFUNC_DONE
rfunc: done (set rdy)
static const uint16_t kRPBA
RPBA reg offset.
static const uint16_t kRPCS2_B_UNIT
static const uint16_t kRPCS1_B_RUNIT
static const uint16_t kFUNC_WCHD
func: write chk head&data
static const uint16_t kRPCS2_M_PAT
void SetChunkSize(size_t chunk)
FIXME_docs.
static const uint16_t kRPCS2_M_OR
static const uint16_t kRFUNC_WUNIT
rfunc: write runit
~Rw11CntlRHRP()
Destructor.
static const bool kProbeInt
probe int active
static const uint16_t kRPDA_B_SA
uint16_t fRd_rpwc
Rdma: request rpwc.
static const uint16_t kRPMR1
RPMR1 reg offset.
static const uint16_t kRPCS2_M_NED
static const uint16_t kRPWC
RPWC reg offset.
static const uint16_t kRPCS3_M_RSEARDONE
static const uint16_t kRPLA
RPLA reg offset.
Rstats & RdmaStats()
FIXME_docs.
static const uint16_t kRPDS_M_VV
static const uint16_t kRxM14
MB reg 14 reg offset.
Rw11RdmaDisk fRdma
Rdma controller.
uint32_t fRd_nwrd
Rdma: current nwrd.
static const uint16_t kRPSN
RPSN reg offset.
void AddNormalExit(RlinkCommandList &clist, size_t ndone, uint16_t rper1=0, uint16_t rpcs2=0)
FIXME_docs.
static const uint16_t kRPCS2_M_RWCO
uint16_t fRd_fu
Rdma: request fu code.
static const uint16_t kRPER1_M_IAE
Rw11CntlRHRP()
Default constructor.
static const uint16_t kRPCS2_M_MXF
static const uint16_t kRPER1_M_RMR
uint16_t fRd_rpcs1
Rdma: request rpcs1.
static const uint16_t kRPDB
RPDB reg offset.
static const uint16_t kRPCS1_M_DVA
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
uint16_t fRd_rpbae
Rdma: request rpbae.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kRPCS2_M_PGE
static const uint16_t kRPCS1_M_IE
size_t fPC_rpda
PrimClist: rpda index.
static const uint16_t kFUNC_RHD
func: read head&data
static const uint16_t kRFUNC_CUNIT
rfunc: copy funit->runit
uint16_t fRd_rpcs2
Rdma: request rpcs2.
static const uint16_t kIbaddr
RHRP default address.
static const uint16_t kRPDS_M_ERP
size_t fPC_rpcs1
PrimClist: rpcs1 index.
uint16_t fRd_rpds
Rdma: request rpds.
static const uint16_t kRPCS3_M_RPOREDONE
static const uint16_t kRxM15
MB reg 15 reg offset.
static const uint16_t kRPCS2_M_IR
static const uint16_t kRPCS1_V_FUNC
static const uint16_t kRPER1_M_UNS
static const uint16_t kRPCS1_M_GO
void AddErrorExit(RlinkCommandList &clist, uint16_t rper1)
FIXME_docs.
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kRPCS2_M_CLR
static const uint16_t kRPDS
RPDS reg offset.
uint32_t fRd_addr
Rdma: current addr.
static const uint16_t kRPEC2
RPEC2 reg offset.
size_t fPC_rpcs2
PrimClist: rpcs2 index.
static const uint16_t kRPDS_M_OM
static const uint16_t kRPCS1_M_BAE
static const uint16_t kRPAS
RPAS reg offset.
static const uint16_t kRPCS3_M_RPACKDONE
size_t fPC_rpds
PrimClist: rpds index.
static const uint16_t kRPCS2_M_BAI
size_t fPC_rpbae
PrimClist: rpbae index.
static const uint16_t kRPOF
RPOF reg offset.
size_t fPC_rpwc
PrimClist: rpwc index.
void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext, RlinkCommandList &clist)
FIXME_docs.
uint32_t fRd_lba
Rdma: current lba.
size_t fPC_rpdc
PrimClist: rpdc index.
static const uint16_t kFUNC_WCD
func: write chk data
static const uint16_t kRPCS2
RPCS2 reg offset.
static const uint16_t kRxM13
MB reg 13 reg offset.
static const uint16_t kRPER1
RPER1 reg offset.
static const uint16_t kRPDS_M_WRL
size_t ChunkSize() const
FIXME_docs.
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
uint16_t fRd_rpba
Rdma: request rpba.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47