w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11Cpu.hpp
Go to the documentation of this file.
1// $Id: Rw11Cpu.hpp 1346 2023-01-06 12:56:08Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2023-01-05 1346 1.2.22 add kCPUUBMAP
8// 2022-08-08 1274 1.2.21 ssr->mmr rename
9// 2019-06-07 1160 1.2.20 Stats() not longer const
10// 2019-04-30 1143 1.2.19 add HasM9312()
11// 2019-04-19 1133 1.2.18 add ExecWibr(),ExecRibr()
12// 2019-04-13 1131 1.2.17 add defs for w11 cpu component addresses; add
13// MemSize(),MemWriteByte(); LoadAbs() returns start
14// 2019-02-15 1112 1.2.16 add HasIbtst()
15// 2018-12-23 1091 1.2.15 AddWbibr(): add move version
16// 2018-12-17 1085 1.2.14 use std::mutex,condition_variable instead of boost
17// 2018-12-16 1084 1.2.13 use =delete for noncopyable instead of boost
18// 2018-12-07 1078 1.2.12 use std::shared_ptr instead of boost
19// 2018-09-23 1050 1.2.11 add HasPcnt()
20// 2017-04-07 868 1.2.10 Dump(): add detail arg
21// 2017-02-26 857 1.2.9 add kCPAH_M_UBM22
22// 2017-02-19 853 1.2.8 use Rtime
23// 2017-02-17 851 1.2.7 probe/setup auxilliary devices: kw11l,kw11p,iist
24// 2017-02-10 850 1.2.6 add ModLalh()
25// 2015-12-28 721 1.2.5 BUGFIX: IM* correct register offset definitions
26// 2015-07-12 700 1.2.4 use ..CpuAct instead ..CpuGo (new active based lam);
27// add probe and map setup for optional cpu components
28// 2015-05-08 675 1.2.3 w11a start/stop/suspend overhaul
29// 2015-04-25 668 1.2.2 add AddRbibr(), AddWbibr()
30// 2015-04-03 661 1.2.1 add kStat_M_* defs
31// 2015-03-21 659 1.2 add RAddrMap(); add AllRAddrMapInsert();
32// 2015-01-01 626 1.1 Adopt for rlink v4 and 4k ibus window; add IAddrMap
33// 2013-04-14 506 1.0.1 add AddLalh(),AddRMem(),AddWMem()
34// 2013-04-12 504 1.0 Initial version
35// 2013-01-27 478 0.1 First draft
36// ---------------------------------------------------------------------------
37
42#ifndef included_Retro_Rw11Cpu
43#define included_Retro_Rw11Cpu 1
44
45#include <string>
46#include <vector>
47#include <memory>
48#include <map>
49#include <mutex>
50#include <condition_variable>
51
52#include "librtools/Rstats.hpp"
53#include "librtools/RerrMsg.hpp"
56
57#include "Rw11Probe.hpp"
58
59#include "librtools/Rbits.hpp"
60#include "Rw11.hpp"
61
62namespace Retro {
63
64 class Rw11Cntl; // forw decl to avoid circular incl
65
66 class Rw11Cpu : public Rbits {
67 public:
68 typedef std::map<std::string, std::shared_ptr<Rw11Cntl>> cmap_t;
69
70 explicit Rw11Cpu(const std::string& type);
71 virtual ~Rw11Cpu();
72
73 Rw11Cpu(const Rw11Cpu&) = delete; // noncopyable
74 Rw11Cpu& operator=(const Rw11Cpu&) = delete; // noncopyable
75
76 void Setup(Rw11* pw11);
77 Rw11& W11() const;
78 RlinkServer& Server() const;
79 RlinkConnect& Connect() const;
80 RlogFile& LogFile() const;
81
82 const std::string& Type() const;
83 size_t Index() const;
84 uint16_t Base() const;
85 uint16_t IBase() const;
86
87 uint32_t MemSize() const;
88 bool HasScnt() const;
89 bool HasPcnt() const;
90 bool HasCmon() const;
91 uint16_t HasHbpt() const;
92 bool HasIbmon() const;
93 bool HasIbtst() const;
94 bool HasM9312() const;
95 bool HasKw11l() const;
96 bool HasKw11p() const;
97 bool HasIist() const;
98
99 void AddCntl(const std::shared_ptr<Rw11Cntl>& spcntl);
100 bool TestCntl(const std::string& name) const;
101 void ListCntl(std::vector<std::string>& list) const;
102 Rw11Cntl& Cntl(const std::string& name) const;
103
104 void Start();
105
106 std::string NextCntlName(const std::string& base) const;
107
108 int AddMembe(RlinkCommandList& clist, uint16_t be,
109 bool stick=false);
110 int AddRibr(RlinkCommandList& clist, uint16_t ibaddr);
111 int AddWibr(RlinkCommandList& clist, uint16_t ibaddr,
112 uint16_t data);
113
114 int AddRbibr(RlinkCommandList& clist, uint16_t ibaddr,
115 size_t size);
116 int AddWbibr(RlinkCommandList& clist, uint16_t ibaddr,
117 const std::vector<uint16_t>& block);
118 int AddWbibr(RlinkCommandList& clist, uint16_t ibaddr,
119 std::vector<uint16_t>&& block);
120
121 int AddLalh(RlinkCommandList& clist, uint32_t addr,
122 uint16_t mode=kCPAH_M_22BIT);
123 void ModLalh(RlinkCommandList& clist, size_t ind, uint32_t addr,
124 uint16_t mode=kCPAH_M_22BIT);
125
126 int AddRMem(RlinkCommandList& clist, uint32_t addr,
127 uint16_t* buf, size_t size,
128 uint16_t mode=kCPAH_M_22BIT,
129 bool singleblk=false);
130 int AddWMem(RlinkCommandList& clist, uint32_t addr,
131 const uint16_t* buf, size_t size,
132 uint16_t mode=kCPAH_M_22BIT,
133 bool singleblk=false);
134
135 void ExecWibr(uint16_t ibaddr0, uint16_t data0,
136 uint16_t ibaddr1=0, uint16_t data1=0,
137 uint16_t ibaddr2=0, uint16_t data2=0);
138 uint16_t ExecRibr(uint16_t ibaddr);
139
140 bool MemRead(uint16_t addr, std::vector<uint16_t>& data,
141 size_t nword, RerrMsg& emsg);
142 bool MemWrite(uint16_t addr, const std::vector<uint16_t>& data,
143 RerrMsg& emsg);
144 bool MemWriteByte(uint32_t addr, uint8_t data, RerrMsg& emsg);
145
146 bool ProbeCntl(Rw11Probe& dsc);
147
148 bool LoadAbs(const std::string& fname, RerrMsg& emsg,
149 uint16_t& start, bool trace=false);
150 bool Boot(const std::string& uname, RerrMsg& emsg);
151
152 void SetCpuActUp();
153 void SetCpuActDown(uint16_t stat);
154 int WaitCpuActDown(const Rtime& tout, Rtime&twait);
155 bool CpuAct() const;
156 uint16_t CpuStat() const;
157
158 uint16_t IbusRemoteAddr(uint16_t ibaddr) const;
159 void AllIAddrMapInsert(const std::string& name, uint16_t ibaddr);
160 void AllRAddrMapInsert(const std::string& name, uint16_t rbaddr);
161
162 bool IAddrMapInsert(const std::string& name, uint16_t ibaddr);
163 bool IAddrMapErase(const std::string& name);
164 bool IAddrMapErase(uint16_t ibaddr);
165 void IAddrMapClear();
166 const RlinkAddrMap& IAddrMap() const;
167
168 bool RAddrMapInsert(const std::string& name, uint16_t rbaddr);
169 bool RAddrMapErase(const std::string& name);
170 bool RAddrMapErase(uint16_t rbaddr);
171 void RAddrMapClear();
172 const RlinkAddrMap& RAddrMap() const;
173
174 void W11AttnHandler();
175
176 Rstats& Stats();
177 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
178 int detail=0) const;
179
180 // some constants (also defined in cpp)
181 static const uint16_t kCPCONF = 0x0000;
182 static const uint16_t kCPCNTL = 0x0001;
183 static const uint16_t kCPSTAT = 0x0002;
184 static const uint16_t kCPPSW = 0x0003;
185 static const uint16_t kCPAL = 0x0004;
186 static const uint16_t kCPAH = 0x0005;
187 static const uint16_t kCPMEM = 0x0006;
188 static const uint16_t kCPMEMI = 0x0007;
189 static const uint16_t kCPR0 = 0x0008;
190 static const uint16_t kCPPC = 0x000f;
191 static const uint16_t kCPMEMBE = 0x0010;
192
193 static const uint16_t kCPFUNC_NOOP = 0x0000;
194 static const uint16_t kCPFUNC_START = 0x0001;
195 static const uint16_t kCPFUNC_STOP = 0x0002;
196 static const uint16_t kCPFUNC_STEP = 0x0003;
197 static const uint16_t kCPFUNC_CRESET = 0x0004;
198 static const uint16_t kCPFUNC_BRESET = 0x0005;
199 static const uint16_t kCPFUNC_SUSPEND = 0x0006;
200 static const uint16_t kCPFUNC_RESUME = 0x0007;
201
202 static const uint16_t kCPSTAT_M_SuspExt = kWBit09;
203 static const uint16_t kCPSTAT_M_SuspInt = kWBit08;
204 static const uint16_t kCPSTAT_M_CpuRust = 0x00f0;
205 static const uint16_t kCPSTAT_V_CpuRust = 4;
206 static const uint16_t kCPSTAT_B_CpuRust = 0x000f;
207 static const uint16_t kCPSTAT_M_CpuSusp = kWBit03;
208 static const uint16_t kCPSTAT_M_CpuGo = kWBit02;
209 static const uint16_t kCPSTAT_M_CmdMErr = kWBit01;
210 static const uint16_t kCPSTAT_M_CmdErr = kWBit00;
211
212 static const uint16_t kCPURUST_INIT = 0x0;
213 static const uint16_t kCPURUST_HALT = 0x1;
214 static const uint16_t kCPURUST_RESET = 0x2;
215 static const uint16_t kCPURUST_STOP = 0x3;
216 static const uint16_t kCPURUST_STEP = 0x4;
217 static const uint16_t kCPURUST_SUSP = 0x5;
218 static const uint16_t kCPURUST_HBPT = 0x6;
219 static const uint16_t kCPURUST_RUNS = 0x7;
220 static const uint16_t kCPURUST_VECFET = 0x8;
221 static const uint16_t kCPURUST_RECRSV = 0x9;
222 static const uint16_t kCPURUST_SFAIL = 0xa;
223 static const uint16_t kCPURUST_VFAIL = 0xb;
224
225 static const uint16_t kCPAH_M_ADDR = 0x003f;
226 static const uint16_t kCPAH_M_22BIT = kWBit06;
227 static const uint16_t kCPAH_M_UBMAP = kWBit07;
228 static const uint16_t kCPAH_M_UBM22 = kWBit06|kWBit07;
229
230 static const uint16_t kCPMEMBE_M_STICK = kWBit02;
231 static const uint16_t kCPMEMBE_M_BE = 0x0003;
232 static const uint16_t kCPMEMBE_M_BE0 = 0x0001;
233 static const uint16_t kCPMEMBE_M_BE1 = 0x0002;
234
235 // defs for the four status bits defined by w11 rbus iface
236 static const uint8_t kStat_M_CmdErr = kBBit07;
237 static const uint8_t kStat_M_CmdMErr = kBBit06;
238 static const uint8_t kStat_M_CpuSusp = kBBit05;
239 static const uint8_t kStat_M_CpuGo = kBBit04;
240
241 // defs for w11 cpu components (ibus addresses)
242 static const uint16_t kCPUPSW = 0177776;
243 static const uint16_t kCPUSTKLIM = 0177774;
244 static const uint16_t kCPUPIRQ = 0177772;
245 static const uint16_t kCPUMBRK = 0177770;
246 static const uint16_t kCPUERR = 0177766;
247 static const uint16_t kCPUSYSID = 0177764;
248 static const uint16_t kCPUSDREG = 0177570;
249 static const uint16_t kCPUUBMAP = 0170200;
250
251 static const uint16_t kMEMHISIZE = 0177762;
252 static const uint16_t kMEMLOSIZE = 0177760;
253 static const uint16_t kMEMHM = 0177752;
254 static const uint16_t kMEMMAINT = 0177750;
255 static const uint16_t kMEMCNTRL = 0177746;
256 static const uint16_t kMEMSYSERR = 0177744;
257 static const uint16_t kMEMHIADDR = 0177742;
258 static const uint16_t kMEMLOADDR = 0177740;
259
260 static const uint16_t kMMUMMR3 = 0172516;
261 static const uint16_t kMMUMMR2 = 0177576;
262 static const uint16_t kMMUMMR1 = 0177574;
263 static const uint16_t kMMUMMR0 = 0177572;
264
265 static const uint16_t kMMUPDRK = 0172300;
266 static const uint16_t kMMUPARK = 0172340;
267 static const uint16_t kMMUPDRS = 0172200;
268 static const uint16_t kMMUPARS = 0172240;
269 static const uint16_t kMMUPDRU = 0177600;
270 static const uint16_t kMMUPARU = 0177640;
271
272 // defs for optional w11 cpu components
273 static const uint16_t kSCBASE = 0x0040;
274 static const uint16_t kSCCNTL = 0x0000;
275 static const uint16_t kSCADDR = 0x0001;
276 static const uint16_t kSCDATA = 0x0002;
277
278 static const uint16_t kCMBASE = 0x0048;
279 static const uint16_t kCMCNTL = 0x0000;
280 static const uint16_t kCMSTAT = 0x0001;
281 static const uint16_t kCMADDR = 0x0002;
282 static const uint16_t kCMDATA = 0x0003;
283 static const uint16_t kCMIADDR = 0x0004;
284 static const uint16_t kCMIPC = 0x0005;
285 static const uint16_t kCMIREG = 0x0006;
286 static const uint16_t kCMIMAL = 0x0007;
287
288 static const uint16_t kHBBASE = 0x0050;
289 static const uint16_t kHBSIZE = 0x0004;
290 static const uint16_t kHBNMAX = 0x0004;
291 static const uint16_t kHBCNTL = 0x0000;
292 static const uint16_t kHBSTAT = 0x0001;
293 static const uint16_t kHBHILIM = 0x0002;
294 static const uint16_t kHBLOLIM = 0x0003;
295
296 static const uint16_t kPCBASE = 0x0060;
297 static const uint16_t kPCCNTL = 0x0000;
298 static const uint16_t kPCSTAT = 0x0001;
299 static const uint16_t kPCDATA = 0x0002;
300
301 static const uint16_t kIMBASE = 0160000;
302 static const uint16_t kIMCNTL = 0x0000;
303 static const uint16_t kIMSTAT = 0x0002;
304 static const uint16_t kIMHILIM = 0x0004;
305 static const uint16_t kIMLOLIM = 0x0006;
306 static const uint16_t kIMADDR = 0x0008;
307 static const uint16_t kIMDATA = 0x000a;
308
309 static const uint16_t kITBASE = 0170000;
310 static const uint16_t kITCNTL = 0x0000;
311 static const uint16_t kITSTAT = 0x0002;
312 static const uint16_t kITDATA = 0x0004;
313 static const uint16_t kITFIFO = 0x0006;
314
315 // defs for optional w11 aux components
316 static const uint16_t kM9BASE = 0165000;
317 static const uint16_t kKWLBASE = 0177546;
318 static const uint16_t kKWPBASE = 0172540;
319 static const uint16_t kKWPCSR = 0x0000;
320 static const uint16_t kKWPCSB = 0x0002;
321 static const uint16_t kKWPCTR = 0x0004;
322 static const uint16_t kIISTBASE= 0177500;
323 static const uint16_t kIISTACR = 0x0000;
324 static const uint16_t kIISTADR = 0x0002;
325
326 protected:
327 void SetupStd();
328 void SetupOpt();
329
330 private:
332
333 protected:
335 std::string fType;
336 size_t fIndex;
337 uint16_t fBase;
338 uint16_t fIBase;
339 uint32_t fMemSize;
340 bool fHasScnt;
341 bool fHasPcnt;
342 bool fHasCmon;
343 uint16_t fHasHbpt;
349 bool fHasIist;
351 uint16_t fCpuStat;
352 std::mutex fCpuActMutex;
353 std::condition_variable fCpuActCond;
358 };
359
360} // end namespace Retro
361
362#include "Rw11Cpu.ipp"
363
364#endif
static const uint8_t kBBit06
Definition: Rbits.hpp:29
static const uint16_t kWBit06
Definition: Rbits.hpp:38
static const uint16_t kWBit01
Definition: Rbits.hpp:33
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 uint8_t kBBit07
Definition: Rbits.hpp:30
static const uint8_t kBBit04
Definition: Rbits.hpp:27
static const uint16_t kWBit07
Definition: Rbits.hpp:39
static const uint8_t kBBit05
Definition: Rbits.hpp:28
static const uint16_t kWBit02
Definition: Rbits.hpp:34
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: RlogFile.hpp:34
FIXME_docs.
Definition: Rstats.hpp:28
FIXME_docs.
Definition: Rtime.hpp:25
FIXME_docs.
Definition: Rw11Cntl.hpp:42
FIXME_docs.
Definition: Rw11Cpu.hpp:66
static const uint16_t kITSTAT
IT.STAT reg offset.
Definition: Rw11Cpu.hpp:311
static const uint16_t kMEMLOSIZE
MEM LOSIZE address.
Definition: Rw11Cpu.hpp:252
static const uint8_t kStat_M_CmdMErr
stat: cmdmerr flag
Definition: Rw11Cpu.hpp:237
static const uint16_t kCPURUST_STEP
cpu was stepped
Definition: Rw11Cpu.hpp:216
bool HasPcnt() const
FIXME_docs.
Definition: Rw11Cpu.ipp:110
static const uint16_t kPCDATA
PC.DATA reg offset.
Definition: Rw11Cpu.hpp:299
static const uint16_t kCPURUST_VECFET
vector fetch halt
Definition: Rw11Cpu.hpp:220
static const uint16_t kHBSTAT
HB.STAT reg offset.
Definition: Rw11Cpu.hpp:292
const RlinkAddrMap & IAddrMap() const
FIXME_docs.
Definition: Rw11Cpu.ipp:238
bool HasIbmon() const
FIXME_docs.
Definition: Rw11Cpu.ipp:134
static const uint16_t kCPUUBMAP
UBMAP base address.
Definition: Rw11Cpu.hpp:249
static const uint16_t kIISTADR
II.ADR reg offset.
Definition: Rw11Cpu.hpp:324
void SetCpuActDown(uint16_t stat)
FIXME_docs.
Definition: Rw11Cpu.cpp:868
static const uint16_t kMEMCNTRL
MEM CNTRL address.
Definition: Rw11Cpu.hpp:255
static const uint16_t kCPURUST_RUNS
cpu running
Definition: Rw11Cpu.hpp:219
uint16_t Base() const
FIXME_docs.
Definition: Rw11Cpu.ipp:78
bool fHasIbtst
has ibtst (ibus tester)
Definition: Rw11Cpu.hpp:345
static const uint16_t kHBHILIM
HB.HILIM reg offset.
Definition: Rw11Cpu.hpp:293
static const uint16_t kIMSTAT
IM.STAT reg offset.
Definition: Rw11Cpu.hpp:303
void Setup(Rw11 *pw11)
FIXME_docs.
Definition: Rw11Cpu.cpp:255
static const uint16_t kKWPCTR
KWP.CTR reg offset.
Definition: Rw11Cpu.hpp:321
static const uint16_t kCPMEM
CPMEM reg offset.
Definition: Rw11Cpu.hpp:187
Rw11Cpu(const Rw11Cpu &)=delete
void SetupOpt()
FIXME_docs.
Definition: Rw11Cpu.cpp:1056
static const uint16_t kMMUPDRU
MMU PDRU address.
Definition: Rw11Cpu.hpp:269
static const uint16_t kITBASE
Ibtst ibus address.
Definition: Rw11Cpu.hpp:309
std::condition_variable fCpuActCond
Definition: Rw11Cpu.hpp:353
static const uint16_t kCPUPIRQ
CPU PIRQ address.
Definition: Rw11Cpu.hpp:244
static const uint16_t kCMIREG
CM.IREG reg offset.
Definition: Rw11Cpu.hpp:285
static const uint16_t kCPFUNC_STOP
STOP func code.
Definition: Rw11Cpu.hpp:195
std::mutex fCpuActMutex
Definition: Rw11Cpu.hpp:352
bool fHasIist
has iist (smp comm)
Definition: Rw11Cpu.hpp:349
static const uint16_t kCPR0
CPR0 reg offset.
Definition: Rw11Cpu.hpp:189
static const uint16_t kKWPCSB
KWP.CSB reg offset.
Definition: Rw11Cpu.hpp:320
void IAddrMapClear()
FIXME_docs.
Definition: Rw11Cpu.ipp:230
bool Boot(const std::string &uname, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11Cpu.cpp:798
static const uint16_t kCPFUNC_NOOP
NOOP func code.
Definition: Rw11Cpu.hpp:193
static const uint16_t kIMLOLIM
IM.LOLIM reg offset.
Definition: Rw11Cpu.hpp:305
static const uint16_t kIMADDR
IM.ADDR reg offset.
Definition: Rw11Cpu.hpp:306
RlinkConnect & Connect() const
FIXME_docs.
Definition: Rw11Cpu.ipp:46
static const uint16_t kCPMEMBE_M_BE
membe: be field
Definition: Rw11Cpu.hpp:231
static const uint16_t kSCBASE
DMSCNT reg base offset.
Definition: Rw11Cpu.hpp:273
bool CpuAct() const
FIXME_docs.
Definition: Rw11Cpu.ipp:190
static const uint16_t kHBNMAX
DMHBPT max number units.
Definition: Rw11Cpu.hpp:290
Rw11Cpu & operator=(const Rw11Cpu &)=delete
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:902
uint16_t ExecRibr(uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:506
static const uint16_t kIMHILIM
IM.HILIM reg offset.
Definition: Rw11Cpu.hpp:304
static const uint16_t kCPMEMBE_M_BE0
membe: be0 flag
Definition: Rw11Cpu.hpp:232
static const uint16_t kCPSTAT_M_CpuGo
cpugo mask
Definition: Rw11Cpu.hpp:208
void RAddrMapClear()
FIXME_docs.
Definition: Rw11Cpu.ipp:270
void ListCntl(std::vector< std::string > &list) const
FIXME_docs.
Definition: Rw11Cpu.cpp:292
static const uint16_t kCPSTAT_M_SuspInt
suspint mask
Definition: Rw11Cpu.hpp:203
static const uint16_t kMMUPDRS
MMU PDRS address.
Definition: Rw11Cpu.hpp:267
static const uint16_t kCPURUST_SFAIL
sequencer failure
Definition: Rw11Cpu.hpp:222
static const uint16_t kCMIPC
CM.IPC reg offset.
Definition: Rw11Cpu.hpp:284
uint16_t IBase() const
FIXME_docs.
Definition: Rw11Cpu.ipp:86
static const uint16_t kCPAH
CPAH reg offset.
Definition: Rw11Cpu.hpp:186
bool fHasM9312
has m9312 (boot rom)
Definition: Rw11Cpu.hpp:346
void SetCpuActUp()
FIXME_docs.
Definition: Rw11Cpu.cpp:856
static const uint16_t kIMDATA
IM.DATA reg offset.
Definition: Rw11Cpu.hpp:307
static const uint16_t kCPFUNC_STEP
STEP func code.
Definition: Rw11Cpu.hpp:196
int AddRbibr(RlinkCommandList &clist, uint16_t ibaddr, size_t size)
FIXME_docs.
Definition: Rw11Cpu.cpp:375
static const uint16_t kHBLOLIM
HB.LOLIM reg offset.
Definition: Rw11Cpu.hpp:294
static const uint16_t kCPCONF
CPCONF reg offset.
Definition: Rw11Cpu.hpp:181
static const uint16_t kCPSTAT_B_CpuRust
cpurust bit mask
Definition: Rw11Cpu.hpp:206
void Start()
FIXME_docs.
Definition: Rw11Cpu.cpp:316
uint16_t fHasHbpt
has dmhbpt (hardware breakpoint)
Definition: Rw11Cpu.hpp:343
static const uint16_t kPCBASE
DMPCNT reg base offset.
Definition: Rw11Cpu.hpp:296
RlinkAddrMap fRAddrMap
rbus name<->address mapping
Definition: Rw11Cpu.hpp:356
RlogFile & LogFile() const
FIXME_docs.
Definition: Rw11Cpu.ipp:54
static const uint16_t kCPAL
CPAL reg offset.
Definition: Rw11Cpu.hpp:185
Rstats fStats
statistics
Definition: Rw11Cpu.hpp:357
std::string NextCntlName(const std::string &base) const
FIXME_docs.
Definition: Rw11Cpu.cpp:331
bool HasM9312() const
FIXME_docs.
Definition: Rw11Cpu.ipp:150
RlinkServer & Server() const
FIXME_docs.
Definition: Rw11Cpu.ipp:38
static const uint16_t kCMIADDR
CM.IADDR reg offset.
Definition: Rw11Cpu.hpp:283
static const uint16_t kMEMHIADDR
MEM HIADDR address.
Definition: Rw11Cpu.hpp:257
static const uint16_t kMMUMMR0
MMU MMR0 address.
Definition: Rw11Cpu.hpp:263
static const uint16_t kCMDATA
CM.DATA reg offset.
Definition: Rw11Cpu.hpp:282
bool IAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.ipp:206
uint16_t fIBase
Definition: Rw11Cpu.hpp:338
bool HasIbtst() const
FIXME_docs.
Definition: Rw11Cpu.ipp:142
static const uint16_t kCPURUST_VFAIL
vmbox failure
Definition: Rw11Cpu.hpp:223
static const uint16_t kCPPSW
CPPSW reg offset.
Definition: Rw11Cpu.hpp:184
void ModLalh(RlinkCommandList &clist, size_t ind, uint32_t addr, uint16_t mode=kCPAH_M_22BIT)
FIXME_docs.
Definition: Rw11Cpu.cpp:421
static const uint16_t kSCCNTL
SC.CNTL reg offset.
Definition: Rw11Cpu.hpp:274
static const uint16_t kCMADDR
CM.ADDR reg offset.
Definition: Rw11Cpu.hpp:281
static const uint16_t kCPFUNC_RESUME
RESUME func code.
Definition: Rw11Cpu.hpp:200
static const uint16_t kCPUSTKLIM
CPU STKLIM address.
Definition: Rw11Cpu.hpp:243
static const uint16_t kHBBASE
DMHBPT reg base offset.
Definition: Rw11Cpu.hpp:288
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rw11Cpu.cpp:950
bool HasKw11p() const
FIXME_docs.
Definition: Rw11Cpu.ipp:166
static const uint16_t kCPFUNC_CRESET
CRESET func code.
Definition: Rw11Cpu.hpp:197
int AddLalh(RlinkCommandList &clist, uint32_t addr, uint16_t mode=kCPAH_M_22BIT)
FIXME_docs.
Definition: Rw11Cpu.cpp:408
uint16_t HasHbpt() const
FIXME_docs.
Definition: Rw11Cpu.ipp:126
static const uint16_t kCPURUST_SUSP
cpu was suspended
Definition: Rw11Cpu.hpp:217
static const uint16_t kITDATA
IT.DATA reg offset.
Definition: Rw11Cpu.hpp:312
size_t Index() const
FIXME_docs.
Definition: Rw11Cpu.ipp:70
void SetupStd()
FIXME_docs.
Definition: Rw11Cpu.cpp:987
static const uint16_t kCPMEMBE_M_STICK
membe: sticky flag
Definition: Rw11Cpu.hpp:230
static const uint16_t kCPSTAT_M_CmdMErr
cmdmerr mask
Definition: Rw11Cpu.hpp:209
static const uint16_t kCPURUST_RECRSV
rec red-stack halt
Definition: Rw11Cpu.hpp:221
static const uint16_t kCPURUST_STOP
cpu was stopped
Definition: Rw11Cpu.hpp:215
bool fHasIbmon
has ibmon (ibus monitor)
Definition: Rw11Cpu.hpp:344
static const uint16_t kIISTBASE
IIST ibus address.
Definition: Rw11Cpu.hpp:322
static const uint16_t kCPSTAT_M_CmdErr
cmderr mask
Definition: Rw11Cpu.hpp:210
static const uint16_t kMEMLOADDR
MEM LOADDR address.
Definition: Rw11Cpu.hpp:258
uint32_t fMemSize
memory size in byte
Definition: Rw11Cpu.hpp:339
static const uint16_t kPCSTAT
PC.STAT reg offset.
Definition: Rw11Cpu.hpp:298
static const uint16_t kKWPCSR
KWP.CSR reg offset.
Definition: Rw11Cpu.hpp:319
static const uint16_t kCPFUNC_BRESET
BRESET func code.
Definition: Rw11Cpu.hpp:198
bool fHasScnt
has dmscnt (state counter)
Definition: Rw11Cpu.hpp:340
uint16_t fBase
Definition: Rw11Cpu.hpp:337
static const uint16_t kMMUPDRK
MMU PDRK address.
Definition: Rw11Cpu.hpp:265
int AddWMem(RlinkCommandList &clist, uint32_t addr, const uint16_t *buf, size_t size, uint16_t mode=kCPAH_M_22BIT, bool singleblk=false)
FIXME_docs.
Definition: Rw11Cpu.cpp:469
static const uint16_t kCPURUST_HALT
cpu executed HALT
Definition: Rw11Cpu.hpp:213
static const uint16_t kCPURUST_RESET
cpu was reset
Definition: Rw11Cpu.hpp:214
static const uint8_t kStat_M_CpuGo
stat: cpugo flag
Definition: Rw11Cpu.hpp:239
bool HasKw11l() const
FIXME_docs.
Definition: Rw11Cpu.ipp:158
static const uint16_t kCPUERR
CPU CPUERR address.
Definition: Rw11Cpu.hpp:246
Rw11 * fpW11
Definition: Rw11Cpu.hpp:334
static const uint16_t kCPAH_M_22BIT
ena 22bit addressing
Definition: Rw11Cpu.hpp:226
static const uint16_t kPCCNTL
PC.CNTL reg offset.
Definition: Rw11Cpu.hpp:297
bool LoadAbs(const std::string &fname, RerrMsg &emsg, uint16_t &start, bool trace=false)
FIXME_docs.
Definition: Rw11Cpu.cpp:629
static const uint16_t kITFIFO
IT.FIFO reg offset.
Definition: Rw11Cpu.hpp:313
static const uint16_t kCPUSDREG
CPU SDREG address.
Definition: Rw11Cpu.hpp:248
uint32_t MemSize() const
FIXME_docs.
Definition: Rw11Cpu.ipp:94
int AddRMem(RlinkCommandList &clist, uint32_t addr, uint16_t *buf, size_t size, uint16_t mode=kCPAH_M_22BIT, bool singleblk=false)
FIXME_docs.
Definition: Rw11Cpu.cpp:448
static const uint16_t kMEMHISIZE
MEM HISIZE address.
Definition: Rw11Cpu.hpp:251
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
static const uint8_t kStat_M_CmdErr
stat: cmderr flag
Definition: Rw11Cpu.hpp:236
static const uint16_t kMEMMAINT
MEM MAINT address.
Definition: Rw11Cpu.hpp:254
bool ProbeCntl(Rw11Probe &dsc)
FIXME_docs.
Definition: Rw11Cpu.cpp:577
bool MemWriteByte(uint32_t addr, uint8_t data, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11Cpu.cpp:557
bool IAddrMapErase(const std::string &name)
FIXME_docs.
Definition: Rw11Cpu.ipp:214
int AddMembe(RlinkCommandList &clist, uint16_t be, bool stick=false)
FIXME_docs.
Definition: Rw11Cpu.cpp:344
bool HasIist() const
FIXME_docs.
Definition: Rw11Cpu.ipp:174
bool fHasPcnt
has dmpcnt (perf counters)
Definition: Rw11Cpu.hpp:341
Rw11Cntl & Cntl(const std::string &name) const
FIXME_docs.
Definition: Rw11Cpu.cpp:304
static const uint16_t kCPAH_M_ADDR
mask for 6bit msb
Definition: Rw11Cpu.hpp:225
static const uint16_t kMMUPARK
MMU PARK address.
Definition: Rw11Cpu.hpp:266
static const uint16_t kCPUMBRK
CPU MBRK address.
Definition: Rw11Cpu.hpp:245
uint16_t IbusRemoteAddr(uint16_t ibaddr) const
FIXME_docs.
Definition: Rw11Cpu.ipp:198
const RlinkAddrMap & RAddrMap() const
FIXME_docs.
Definition: Rw11Cpu.ipp:278
size_t fIndex
Definition: Rw11Cpu.hpp:336
static const uint16_t kCPSTAT_V_CpuRust
cpurust shift
Definition: Rw11Cpu.hpp:205
std::map< std::string, std::shared_ptr< Rw11Cntl > > cmap_t
Definition: Rw11Cpu.hpp:68
bool MemRead(uint16_t addr, std::vector< uint16_t > &data, size_t nword, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11Cpu.cpp:517
static const uint16_t kHBCNTL
HB.CNTL reg offset.
Definition: Rw11Cpu.hpp:291
static const uint16_t kHBSIZE
DMHBPT unit size.
Definition: Rw11Cpu.hpp:289
static const uint16_t kIMBASE
Ibmon ibus address.
Definition: Rw11Cpu.hpp:301
Rw11 & W11() const
FIXME_docs.
Definition: Rw11Cpu.ipp:30
static const uint16_t kCPSTAT_M_CpuRust
cpurust mask
Definition: Rw11Cpu.hpp:204
static const uint16_t kCPMEMBE_M_BE1
membe: be1 flag
Definition: Rw11Cpu.hpp:233
cmap_t fCntlMap
name->cntl map
Definition: Rw11Cpu.hpp:354
static const uint16_t kCPPC
CPPC reg offset.
Definition: Rw11Cpu.hpp:190
static const uint16_t kCPFUNC_START
START func code.
Definition: Rw11Cpu.hpp:194
uint16_t fCpuStat
Definition: Rw11Cpu.hpp:351
static const uint16_t kCPMEMI
CPMEMI reg offset.
Definition: Rw11Cpu.hpp:188
bool HasScnt() const
FIXME_docs.
Definition: Rw11Cpu.ipp:102
static const uint16_t kCPMEMBE
CPMEMBE reg offset.
Definition: Rw11Cpu.hpp:191
virtual ~Rw11Cpu()
Destructor.
Definition: Rw11Cpu.cpp:249
bool HasCmon() const
FIXME_docs.
Definition: Rw11Cpu.ipp:118
void AddCntl(const std::shared_ptr< Rw11Cntl > &spcntl)
FIXME_docs.
Definition: Rw11Cpu.cpp:266
bool fHasKw11l
has kw11-l (line clock)
Definition: Rw11Cpu.hpp:347
int AddWibr(RlinkCommandList &clist, uint16_t ibaddr, uint16_t data)
FIXME_docs.
Definition: Rw11Cpu.cpp:365
static const uint16_t kSCADDR
SC.ADDR reg offset.
Definition: Rw11Cpu.hpp:275
static const uint16_t kM9BASE
M9312 ibus address.
Definition: Rw11Cpu.hpp:316
int WaitCpuActDown(const Rtime &tout, Rtime &twait)
FIXME_docs.
Definition: Rw11Cpu.cpp:882
Rw11Cpu()
default ctor blocker
Definition: Rw11Cpu.hpp:331
static const uint8_t kStat_M_CpuSusp
stat: cpususp flag
Definition: Rw11Cpu.hpp:238
void W11AttnHandler()
FIXME_docs.
Definition: Rw11Cpu.cpp:938
static const uint16_t kMMUMMR3
MMU MMR3 address.
Definition: Rw11Cpu.hpp:260
static const uint16_t kCPUPSW
CPU PSW address.
Definition: Rw11Cpu.hpp:242
RlinkAddrMap fIAddrMap
ibus name<->address mapping
Definition: Rw11Cpu.hpp:355
static const uint16_t kMMUPARU
MMU PARU address.
Definition: Rw11Cpu.hpp:270
bool MemWrite(uint16_t addr, const std::vector< uint16_t > &data, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11Cpu.cpp:537
static const uint16_t kCPUSYSID
CPU SYSID address.
Definition: Rw11Cpu.hpp:247
static const uint16_t kKWLBASE
KW11-L ibus address.
Definition: Rw11Cpu.hpp:317
static const uint16_t kCPURUST_INIT
cpu in init state
Definition: Rw11Cpu.hpp:212
static const uint16_t kMMUMMR2
MMU MMR2 address.
Definition: Rw11Cpu.hpp:261
bool RAddrMapErase(const std::string &name)
FIXME_docs.
Definition: Rw11Cpu.ipp:254
int AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:354
static const uint16_t kCMBASE
DMCMON reg base offset.
Definition: Rw11Cpu.hpp:278
static const uint16_t kCPAH_M_UBM22
ubmap+22bit
Definition: Rw11Cpu.hpp:228
uint16_t CpuStat() const
FIXME_docs.
Definition: Rw11Cpu.ipp:182
void AllRAddrMapInsert(const std::string &name, uint16_t rbaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:921
static const uint16_t kMMUMMR1
MMU MMR1 address.
Definition: Rw11Cpu.hpp:262
static const uint16_t kCMIMAL
CM.IMAL reg offset.
Definition: Rw11Cpu.hpp:286
bool RAddrMapInsert(const std::string &name, uint16_t rbaddr)
FIXME_docs.
Definition: Rw11Cpu.ipp:246
static const uint16_t kKWPBASE
KW11-P ibus address.
Definition: Rw11Cpu.hpp:318
int AddWbibr(RlinkCommandList &clist, uint16_t ibaddr, const std::vector< uint16_t > &block)
FIXME_docs.
Definition: Rw11Cpu.cpp:385
static const uint16_t kITCNTL
IT.CNTL reg offset.
Definition: Rw11Cpu.hpp:310
static const uint16_t kCPSTAT
CPSTAT reg offset.
Definition: Rw11Cpu.hpp:183
std::string fType
Definition: Rw11Cpu.hpp:335
static const uint16_t kSCDATA
SC.DATA reg offset.
Definition: Rw11Cpu.hpp:276
static const uint16_t kIISTACR
II.ACR reg offset.
Definition: Rw11Cpu.hpp:323
static const uint16_t kCPSTAT_M_SuspExt
suspext mask
Definition: Rw11Cpu.hpp:202
static const uint16_t kMMUPARS
MMU PARS address.
Definition: Rw11Cpu.hpp:268
static const uint16_t kCPCNTL
CPADDR reg offset.
Definition: Rw11Cpu.hpp:182
bool fHasCmon
has dmcmon (cpu monitor)
Definition: Rw11Cpu.hpp:342
static const uint16_t kCMCNTL
CM.CNTL reg offset.
Definition: Rw11Cpu.hpp:279
bool fHasKw11p
has kw11-p (prog clock)
Definition: Rw11Cpu.hpp:348
Rstats & Stats()
FIXME_docs.
Definition: Rw11Cpu.ipp:286
static const uint16_t kCPSTAT_M_CpuSusp
cpususp mask
Definition: Rw11Cpu.hpp:207
static const uint16_t kCMSTAT
CM.STAT reg offset.
Definition: Rw11Cpu.hpp:280
static const uint16_t kCPAH_M_UBMAP
ena ubmap
Definition: Rw11Cpu.hpp:227
static const uint16_t kMEMHM
MEM HM address.
Definition: Rw11Cpu.hpp:253
static const uint16_t kCPURUST_HBPT
cpu hardware bpt
Definition: Rw11Cpu.hpp:218
static const uint16_t kCPFUNC_SUSPEND
SUSPEND func code.
Definition: Rw11Cpu.hpp:199
static const uint16_t kMEMSYSERR
MEM SYSERR address.
Definition: Rw11Cpu.hpp:256
static const uint16_t kIMCNTL
IM.CNTL reg offset.
Definition: Rw11Cpu.hpp:302
bool TestCntl(const std::string &name) const
FIXME_docs.
Definition: Rw11Cpu.cpp:284
const std::string & Type() const
FIXME_docs.
Definition: Rw11Cpu.ipp:62
FIXME_docs.
Definition: Rw11.hpp:31
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
FIXME_docs.
Definition: Rw11Probe.hpp:23