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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 25 wfjm
// $Id: Rw11CntlRK11.hpp 562 2014-06-15 17:23:18Z mueller $
2 20 wfjm
//
3 25 wfjm
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 20 wfjm
//
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 25 wfjm
// 2014-06-14   562   1.0.1  Add stats definitions
17 20 wfjm
// 2013-04-20   508   1.0    Initial version
18
// 2013-02-10   485   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
 
22
/*!
23
  \file
24 25 wfjm
  \version $Id: Rw11CntlRK11.hpp 562 2014-06-15 17:23:18Z mueller $
25 20 wfjm
  \brief   Declaration of class Rw11CntlRK11.
26
*/
27
 
28
#ifndef included_Retro_Rw11CntlRK11
29
#define included_Retro_Rw11CntlRK11 1
30
 
31
#include "Rw11CntlBase.hpp"
32
#include "Rw11UnitRK11.hpp"
33
 
34
namespace Retro {
35
 
36
  class Rw11CntlRK11 : public Rw11CntlBase<Rw11UnitRK11,8> {
37
    public:
38
 
39
                    Rw11CntlRK11();
40
                   ~Rw11CntlRK11();
41
 
42
      void          Config(const std::string& name, uint16_t base, int lam);
43
 
44
      virtual void  Start();
45
 
46
      virtual bool  BootCode(size_t unit, std::vector<uint16_t>& code,
47
                             uint16_t& aload, uint16_t& astart);
48
 
49
      virtual void  UnitSetup(size_t ind);
50
 
51
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
52
 
53
    // some constants (also defined in cpp)
54
      static const uint16_t kIbaddr = 0177400; //!< RK11 default address
55
      static const int      kLam    = 4;       //!< RK11 default lam
56
 
57
      static const uint16_t kRKDS = 000; //!< RKDS register address offset
58
      static const uint16_t kRKER = 002; //!< RKER register address offset
59
      static const uint16_t kRKCS = 004; //!< RKCS register address offset
60
      static const uint16_t kRKWC = 006; //!< RKWC register address offset
61
      static const uint16_t kRKBA = 010; //!< RKBA register address offset
62
      static const uint16_t kRKDA = 012; //!< RKDA register address offset
63
      static const uint16_t kRKMR = 014; //!< RKMR register address offset
64
 
65
      static const uint16_t kProbeOff = kRKCS; //!< probe address offset (rkcs)
66
      static const bool     kProbeInt = true;  //!< probe int active
67
      static const bool     kProbeRem = true;  //!< probr rem active
68
 
69
      static const uint16_t kRKDS_M_ID   = 0160000; //!< ID: drive number
70
      static const uint16_t kRKDS_V_ID   = 13;
71
      static const uint16_t kRKDS_B_ID   = 0007;
72
      static const uint16_t kRKDS_M_HDEN = kWBit11; //!< HDEN: high density drv
73
      static const uint16_t kRKDS_M_DRU  = kWBit10; //!< DRU: drive unsafe
74
      static const uint16_t kRKDS_M_SIN  = kWBit09; //!< SIN: seek incomplete
75
      static const uint16_t kRKDS_M_SOK  = kWBit08; //!< SOK: sector counter OK
76
      static const uint16_t kRKDS_M_DRY  = kWBit07; //!< DRY: drive ready
77
      static const uint16_t kRKDS_M_ADRY = kWBit06; //!< ADRY: access ready
78
      static const uint16_t kRKDS_M_WPS  = kWBit05; //!< WPS: write protect
79
      static const uint16_t kRKDS_B_SC   = 0017;    //!< SC: sector counter
80
 
81
      static const uint16_t kRKER_M_DRE  = kWBit15;
82
      static const uint16_t kRKER_M_OVR  = kWBit14;
83
      static const uint16_t kRKER_M_WLO  = kWBit13;
84
      static const uint16_t kRKER_M_PGE  = kWBit11;
85
      static const uint16_t kRKER_M_NXM  = kWBit10;
86
      static const uint16_t kRKER_M_NXD  = kWBit07;
87
      static const uint16_t kRKER_M_NXC  = kWBit06;
88
      static const uint16_t kRKER_M_NXS  = kWBit05;
89
      static const uint16_t kRKER_M_CSE  = kWBit01;
90
      static const uint16_t kRKER_M_WCE  = kWBit00;
91
 
92
      static const uint16_t kRKCS_M_MAINT= kWBit12;
93
      static const uint16_t kRKCS_M_IBA  = kWBit11;
94
      static const uint16_t kRKCS_M_FMT  = kWBit10;
95
      static const uint16_t kRKCS_M_RWA  = kWBit09;
96
      static const uint16_t kRKCS_M_SSE  = kWBit08;
97
      static const uint16_t kRKCS_M_MEX  = 000060;
98
      static const uint16_t kRKCS_V_MEX  = 4;
99
      static const uint16_t kRKCS_B_MEX  = 0003;
100
      static const uint16_t kRKCS_V_FUNC = 1;
101
      static const uint16_t kRKCS_B_FUNC = 0007;
102
      static const uint16_t kRKCS_CRESET = 0;
103
      static const uint16_t kRKCS_WRITE  = 1;
104
      static const uint16_t kRKCS_READ   = 2;
105
      static const uint16_t kRKCS_WCHK   = 3;
106
      static const uint16_t kRKCS_SEEK   = 4;
107
      static const uint16_t kRKCS_RCHK   = 5;
108
      static const uint16_t kRKCS_DRESET = 6;
109
      static const uint16_t kRKCS_WLOCK  = 7;
110
      static const uint16_t kRKCS_M_GO   = kWBit00;
111
 
112
      static const uint16_t kRKDA_M_DRSEL= 0160000;
113
      static const uint16_t kRKDA_V_DRSEL= 13;
114
      static const uint16_t kRKDA_B_DRSEL= 0007;
115
      static const uint16_t kRKDA_M_CYL  = 0017740;
116
      static const uint16_t kRKDA_V_CYL  =  5;
117
      static const uint16_t kRKDA_B_CYL  = 0377;
118
      static const uint16_t kRKDA_M_SUR  = 0000020;
119
      static const uint16_t kRKDA_V_SUR  =  4;
120
      static const uint16_t kRKDA_B_SUR  = 0001;
121
      static const uint16_t kRKDA_B_SC   = 0017;
122
 
123
      static const uint16_t kRKMR_M_RID  = 0160000;
124
      static const uint16_t kRKMR_V_RID  = 13;
125
      static const uint16_t kRKMR_M_CRDONE= kWBit11;
126
      static const uint16_t kRKMR_M_SBCLR = kWBit10;
127
      static const uint16_t kRKMR_M_CRESET= kWBit09;
128
      static const uint16_t kRKMR_M_FDONE = kWBit08;
129
 
130 25 wfjm
    // statistics counter indices
131
      enum stats {
132
        kStatNFuncCreset = Rw11Cntl::kDimStat,
133
        kStatNFuncWrite,
134
        kStatNFuncRead,
135
        kStatNFuncWchk,
136
        kStatNFuncSeek,
137
        kStatNFuncRchk,
138
        kStatNFuncDreset,
139
        kStatNFuncWlock,
140
        kStatNRdmaWrite,
141
        kStatNRdmaRead,
142
        kStatNRdmaWchk,
143
        kStatNRdmaRchk,
144
        kDimStat
145
      };
146
 
147 20 wfjm
    protected:
148
      int           AttnHandler(const RlinkServer::AttnArgs& args);
149
      int           RdmaHandler();
150
      void          LogRker(uint16_t rker);
151
 
152
    protected:
153
      size_t        fPC_rkwc;               //!< PrimClist: rkwc index
154
      size_t        fPC_rkba;               //!< PrimClist: rkba index
155
      size_t        fPC_rkda;               //!< PrimClist: rkda index
156
      size_t        fPC_rkmr;               //!< PrimClist: rkmr index
157
      size_t        fPC_rkcs;               //!< PrimClist: rkcs index
158
 
159
      bool          fRd_busy;               //!< Rdma: busy flag
160
      uint16_t      fRd_rkcs;               //!< Rdma: request rkcs
161
      uint16_t      fRd_rkda;               //!< Rdma: request rkda
162
      uint32_t      fRd_addr;               //!< Rdma: current addr
163
      uint32_t      fRd_lba;                //!< Rdma: current lba
164
      uint32_t      fRd_nwrd;               //!< Rdma: current nwrd
165
      bool          fRd_ovr;                //!< Rdma: overrun condition found
166
  };
167
 
168
} // end namespace Retro
169
 
170
//#include "Rw11CntlRK11.ipp"
171
 
172
#endif

powered by: WebSVN 2.1.0

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