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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librw11/] [Rw11UnitRL11.cpp] - Blame information for rev 36

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

Line No. Rev Author Line
1 30 wfjm
// $Id: Rw11UnitRL11.cpp 659 2015-03-22 23:15:51Z mueller $
2 29 wfjm
//
3
// Copyright 2014- 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 30 wfjm
// 2015-03-21   659   1.0.1  BUGFIX: SetType(): set fType;
17 29 wfjm
// 2014-06-08   561   1.0    Initial version
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22 30 wfjm
  \version $Id: Rw11UnitRL11.cpp 659 2015-03-22 23:15:51Z mueller $
23 29 wfjm
  \brief   Implemenation of Rw11UnitRL11.
24
*/
25
 
26
#include "boost/bind.hpp"
27
 
28
#include "librtools/Rexception.hpp"
29
#include "librtools/RosFill.hpp"
30
#include "Rw11CntlRL11.hpp"
31
 
32
#include "Rw11UnitRL11.hpp"
33
 
34
using namespace std;
35
 
36
/*!
37
  \class Retro::Rw11UnitRL11
38
  \brief FIXME_docs
39
*/
40
 
41
// all method definitions in namespace Retro
42
namespace Retro {
43
 
44
//------------------------------------------+-----------------------------------
45
//! Constructor
46
 
47
Rw11UnitRL11::Rw11UnitRL11(Rw11CntlRL11* pcntl, size_t index)
48
  : Rw11UnitDiskBase<Rw11CntlRL11>(pcntl, index),
49
    fRlsta(0),
50
    fRlpos(0)
51
{
52
  // setup disk geometry: rl01 and rl02 supported, default rl02
53
  fType    = "rl02";
54 30 wfjm
  fEnabled = true;
55 29 wfjm
  fNCyl    = 512;
56
  fNHead   =   2;
57
  fNSect   =  40;
58
  fBlksize = 256;
59
  fNBlock  = fNCyl*fNHead*fNSect;
60
}
61
 
62
//------------------------------------------+-----------------------------------
63
//! Destructor
64
 
65
Rw11UnitRL11::~Rw11UnitRL11()
66
{}
67
 
68
//------------------------------------------+-----------------------------------
69
//! FIXME_docs
70
 
71
void Rw11UnitRL11::SetType(const std::string& type)
72
{
73
  if (Virt()) {
74
    throw Rexception("Rw11UnitRL11::SetType",
75
                     string("Bad state: file attached"));
76
  }
77
 
78
  if (type == "rl01") {
79
    fNCyl    = 256;
80
  } else if (type == "rl02") {
81
    fNCyl    = 512;
82
  } else {
83
    throw Rexception("Rw11UnitRL11::SetType",
84
                     string("Bad args: only types 'rl01' and 'rl02' supported"));
85
  }
86 30 wfjm
 
87
  fType    = type;
88 29 wfjm
  fNBlock  = fNCyl*fNHead*fNSect;
89
  return;
90
}
91
 
92
//------------------------------------------+-----------------------------------
93
//! FIXME_docs
94
 
95
void Rw11UnitRL11::Dump(std::ostream& os, int ind, const char* text) const
96
{
97
  RosFill bl(ind);
98
  os << bl << (text?text:"--") << "Rw11UnitRL11 @ " << this << endl;
99
  os << bl << "  fRlsta:          " << RosPrintf(fRlsta,"o",6)   << endl;
100
  os << bl << "  fRlpos:          " << RosPrintf(fRlpos,"o",6)   << endl;
101
 
102
  Rw11UnitDiskBase<Rw11CntlRL11>::Dump(os, ind, " ^");
103
  return;
104
}
105
 
106
} // end namespace Retro

powered by: WebSVN 2.1.0

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