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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11VirtDisk.hpp] - Blame information for rev 40

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 wfjm
// $Id: Rw11VirtDisk.hpp 509 2013-04-21 20:46:20Z mueller $
2
//
3
// Copyright 2013- 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
// 2013-03-03   494   1.0    Initial version
17
// 2013-02-13   488   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
 
21
/*!
22
  \file
23
  \version $Id: Rw11VirtDisk.hpp 509 2013-04-21 20:46:20Z mueller $
24
  \brief   Declaration of class Rw11VirtDisk.
25
*/
26
 
27
#ifndef included_Retro_Rw11VirtDisk
28
#define included_Retro_Rw11VirtDisk 1
29
 
30
#include "Rw11Virt.hpp"
31
 
32
namespace Retro {
33
 
34
  class Rw11VirtDisk : public Rw11Virt {
35
    public:
36
      explicit      Rw11VirtDisk(Rw11Unit* punit);
37
                   ~Rw11VirtDisk();
38
 
39
      void          Setup(size_t blksize, size_t nblock);
40
      size_t        BlockSize() const;
41
      size_t        NBlock() const;
42
 
43
      virtual bool  Read(size_t lba, size_t nblk, uint8_t* data,
44
                         RerrMsg& emsg) = 0;
45
      virtual bool  Write(size_t lba, size_t nblk, const uint8_t* data,
46
                          RerrMsg& emsg) = 0;
47
 
48
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
49
 
50
      static Rw11VirtDisk* New(const std::string& url, Rw11Unit* punit,
51
                               RerrMsg& emsg);
52
 
53
    // statistics counter indices
54
      enum stats {
55
        kStatNVDRead = Rw11Virt::kDimStat,
56
        kStatNVDReadBlk,
57
        kStatNVDWrite,
58
        kStatNVDWriteBlk,
59
        kDimStat
60
      };
61
 
62
    protected:
63
      size_t        fBlkSize;               //<! block size in byte
64
      size_t        fNBlock;                //<! disk size in blocks
65
  };
66
 
67
} // end namespace Retro
68
 
69
#include "Rw11VirtDisk.ipp"
70
 
71
#endif

powered by: WebSVN 2.1.0

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