w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11Rdma.hpp
Go to the documentation of this file.
1// $Id: Rw11Rdma.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.1.5 Stats() not longer const
8// 2018-12-16 1084 1.1.4 use =delete for noncopyable instead of boost
9// 2018-12-15 1083 1.1.3 for std::function setups: use rval ref and move
10// 2018-12-14 1081 1.1.2 use std::function instead of boost
11// 2017-04-02 865 1.1.1 Dump(): add detail arg
12// 2015-02-17 647 1.1 PreExecCB with nwdone and nwnext
13// 2015-01-04 627 1.0 Initial version
14// ---------------------------------------------------------------------------
15
16
21#ifndef included_Retro_Rw11Rdma
22#define included_Retro_Rw11Rdma 1
23
24#include <functional>
25
26#include "librtools/Rstats.hpp"
27#include "librtools/RerrMsg.hpp"
28
29#include "librtools/Rbits.hpp"
30#include "Rw11Cntl.hpp"
31
32namespace Retro {
33
34 class Rw11Rdma : public Rbits {
35 public:
36
37 typedef std::function<void(int,size_t,size_t,
39 typedef std::function<void(int,size_t,
41
42 Rw11Rdma(Rw11Cntl* pcntl, precb_t&& precb,
43 postcb_t&& postcb);
44 virtual ~Rw11Rdma();
45
46 Rw11Rdma(const Rw11Rdma&) = delete; // noncopyable
47 Rw11Rdma& operator=(const Rw11Rdma&) = delete; // noncopyable
48
49 Rw11Cntl& CntlBase() const;
50 Rw11Cpu& Cpu() const;
51 Rw11& W11() const;
52 RlinkServer& Server() const;
53 RlinkConnect& Connect() const;
54 RlogFile& LogFile() const;
55
56 void SetChunkSize(size_t chunk);
57 size_t ChunkSize() const;
58
59 bool IsActive() const;
60
61 void QueueRMem(uint32_t addr, uint16_t* block, size_t size,
62 uint16_t mode);
63 void QueueWMem(uint32_t addr, const uint16_t* block, size_t size,
64 uint16_t mode);
65
66 Rstats& Stats();
67 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
68 int detail=0) const;
69
70 // statistics counter indices
71 enum stats {
79 };
80
81 // status values
82 enum status {
87 };
88
89 protected:
90 void SetupRdma(bool iswmem, uint32_t addr, uint16_t* block,
91 size_t size, uint16_t mode);
92 int RdmaHandler();
93 virtual void PreRdmaHook();
94 virtual void PostRdmaHook(size_t nwdone);
95
96 protected:
100 size_t fChunksize;
102 bool fIsWMem;
103 uint32_t fAddr;
104 uint16_t fMode;
105 size_t fNWordMax;
106 size_t fNWordRest;
107 size_t fNWordDone;
108 uint16_t* fpBlock;
110 };
111
112} // end namespace Retro
113
114#include "Rw11Rdma.ipp"
115
116#endif
FIXME_docs.
Definition: RlogFile.hpp:34
FIXME_docs.
Definition: Rstats.hpp:28
FIXME_docs.
Definition: Rw11Cntl.hpp:42
FIXME_docs.
Definition: Rw11Cpu.hpp:66
FIXME_docs.
Definition: Rw11Rdma.hpp:34
int RdmaHandler()
FIXME_docs.
Definition: Rw11Rdma.cpp:157
virtual void PostRdmaHook(size_t nwdone)
FIXME_docs.
Definition: Rw11Rdma.cpp:223
virtual ~Rw11Rdma()
Destructor.
Definition: Rw11Rdma.cpp:69
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rw11Rdma.cpp:110
Rw11Cntl & CntlBase() const
FIXME_docs.
Definition: Rw11Rdma.ipp:21
postcb_t fPostExecCB
post Exec callback
Definition: Rw11Rdma.hpp:99
enum status fStatus
dma status
Definition: Rw11Rdma.hpp:101
size_t fNWordRest
words to be done
Definition: Rw11Rdma.hpp:106
void SetupRdma(bool iswmem, uint32_t addr, uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
Definition: Rw11Rdma.cpp:132
bool IsActive() const
FIXME_docs.
Definition: Rw11Rdma.ipp:77
RlogFile & LogFile() const
FIXME_docs.
Definition: Rw11Rdma.ipp:61
@ kStatNQueWMem
WMem chains queued.
Definition: Rw11Rdma.hpp:73
@ kStatNExtClist
clist extended
Definition: Rw11Rdma.hpp:76
@ kStatNRdmaWMem
WMem chunks done.
Definition: Rw11Rdma.hpp:75
@ kStatNRdmaRMem
RMem chunks done.
Definition: Rw11Rdma.hpp:74
@ kStatNFailRdma
Rdma failures.
Definition: Rw11Rdma.hpp:77
@ kStatNQueRMem
RMem chains queued.
Definition: Rw11Rdma.hpp:72
Rw11Rdma(const Rw11Rdma &)=delete
std::function< void(int, size_t, RlinkCommandList &, size_t)> postcb_t
Definition: Rw11Rdma.hpp:40
precb_t fPreExecCB
pre Exec callback
Definition: Rw11Rdma.hpp:98
uint32_t fAddr
current mem address
Definition: Rw11Rdma.hpp:103
RlinkServer & Server() const
FIXME_docs.
Definition: Rw11Rdma.ipp:45
@ kStatusBusyLast
last chunk to come
Definition: Rw11Rdma.hpp:85
@ kStatusFailRdma
last rdma transfer failed
Definition: Rw11Rdma.hpp:86
@ kStatusBusy
more chunks to come
Definition: Rw11Rdma.hpp:84
@ kStatusDone
all chunks done and ok
Definition: Rw11Rdma.hpp:83
void QueueWMem(uint32_t addr, const uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
Definition: Rw11Rdma.cpp:98
bool fIsWMem
is memory write
Definition: Rw11Rdma.hpp:102
uint16_t fMode
current mode
Definition: Rw11Rdma.hpp:104
Rw11 & W11() const
FIXME_docs.
Definition: Rw11Rdma.ipp:37
Rw11Cpu & Cpu() const
FIXME_docs.
Definition: Rw11Rdma.ipp:29
std::function< void(int, size_t, size_t, RlinkCommandList &)> precb_t
Definition: Rw11Rdma.hpp:38
size_t fChunksize
channel chunk size
Definition: Rw11Rdma.hpp:100
Rstats & Stats()
FIXME_docs.
Definition: Rw11Rdma.ipp:85
void QueueRMem(uint32_t addr, uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
Definition: Rw11Rdma.cpp:86
size_t fNWordMax
transfer chunk size
Definition: Rw11Rdma.hpp:105
Rw11Rdma & operator=(const Rw11Rdma &)=delete
size_t ChunkSize() const
FIXME_docs.
Definition: Rw11Rdma.ipp:69
void SetChunkSize(size_t chunk)
FIXME_docs.
Definition: Rw11Rdma.cpp:75
virtual void PreRdmaHook()
FIXME_docs.
Definition: Rw11Rdma.cpp:215
Rstats fStats
statistics
Definition: Rw11Rdma.hpp:109
uint16_t * fpBlock
current buffer pointer
Definition: Rw11Rdma.hpp:108
Rw11Cntl * fpCntlBase
plain Rw11Cntl ptr
Definition: Rw11Rdma.hpp:97
size_t fNWordDone
words transfered
Definition: Rw11Rdma.hpp:107
RlinkConnect & Connect() const
FIXME_docs.
Definition: Rw11Rdma.ipp:53
FIXME_docs.
Definition: Rw11.hpp:31
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47