OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librw11/] [Rw11RdmaDisk.hpp] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
// $Id: Rw11RdmaDisk.hpp 648 2015-02-20 20:16:21Z mueller $
2 28 wfjm
//
3
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16
// 2015-01-04   627   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
 
20
/*!
21
  \file
22 29 wfjm
  \version $Id: Rw11RdmaDisk.hpp 648 2015-02-20 20:16:21Z mueller $
23 28 wfjm
  \brief   Declaration of class Rw11RdmaDisk.
24
*/
25
 
26
#ifndef included_Retro_Rw11RdmaDisk
27
#define included_Retro_Rw11RdmaDisk 1
28
 
29
#include <vector>
30
 
31
#include "Rw11Rdma.hpp"
32
#include "Rw11UnitDisk.hpp"
33
 
34
namespace Retro {
35
 
36
  class Rw11RdmaDisk : public Rw11Rdma {
37
    public:
38
                    Rw11RdmaDisk(Rw11Cntl* pcntl, const precb_t& precb,
39
                                 const postcb_t& postcb);
40
                   ~Rw11RdmaDisk();
41
 
42
      void          QueueDiskRead(uint32_t addr, size_t size, uint16_t mode,
43
                                  uint32_t lba, Rw11UnitDisk* punit);
44
      void          QueueDiskWrite(uint32_t addr, size_t size, uint16_t mode,
45
                                   uint32_t lba, Rw11UnitDisk* punit);
46
      void          QueueDiskWriteCheck(uint32_t addr, size_t size,
47
                                        uint16_t mode, uint32_t lba,
48
                                        Rw11UnitDisk* punit);
49
 
50 29 wfjm
      size_t        WriteCheck(size_t nwdone);
51 28 wfjm
 
52
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
53
 
54
    // statistics counter indices
55
      enum stats {
56
        kStatNWritePadded = Rw11Rdma::kDimStat,//!< padded disk write
57
        kStatNWChkFail,                        //!< write check failed
58
        kDimStat
59
      };
60
 
61
    protected:
62
    // function code values
63
      enum func {
64
        kFuncRead,                          //!< read function
65
        kFuncWrite,                         //!< write function
66
        kFuncWriteCheck                     //!< write check function
67
      };
68
 
69
      void          SetupDisk(size_t size, uint32_t lba, Rw11UnitDisk* punit,
70
                              Rw11RdmaDisk::func func);
71
      virtual void  PreRdmaHook();
72 29 wfjm
      virtual void  PostRdmaHook(size_t nwdone);
73 28 wfjm
 
74
    protected:
75
      std::vector<uint16_t>  fBuf;          //!< data buffer
76
      Rw11UnitDisk* fpUnit;                 //!< UnitDisk to read VirtDisk
77
      size_t        fNWord;                 //!< words to transfer
78
      size_t        fNBlock;                //!< disk blocks to transfer
79
      size_t        fLba;                   //!< disk lba
80
      enum func     fFunc;                  //!< current function
81
  };
82
 
83
} // end namespace Retro
84
 
85
#include "Rw11RdmaDisk.ipp"
86
 
87
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.