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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librwxxtpp/] [RtclRw11CntlRK11.cpp] - 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: RtclRw11CntlRK11.cpp 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-06   495   1.0    Initial version
17
// 2013-02-02   480   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22
  \version $Id: RtclRw11CntlRK11.cpp 509 2013-04-21 20:46:20Z mueller $
23
  \brief   Implemenation of RtclRw11CntlRK11.
24
*/
25
 
26
#include "librtcltools/RtclNameSet.hpp"
27
 
28
#include "RtclRw11CntlRK11.hpp"
29
#include "RtclRw11UnitRK11.hpp"
30
 
31
using namespace std;
32
 
33
/*!
34
  \class Retro::RtclRw11CntlRK11
35
  \brief FIXME_docs
36
*/
37
 
38
// all method definitions in namespace Retro
39
namespace Retro {
40
 
41
//------------------------------------------+-----------------------------------
42
//! Constructor
43
 
44
RtclRw11CntlRK11::RtclRw11CntlRK11()
45
  : RtclRw11CntlBase<Rw11CntlRK11>("Rw11CntlRK11")
46
{}
47
 
48
//------------------------------------------+-----------------------------------
49
//! Destructor
50
 
51
RtclRw11CntlRK11::~RtclRw11CntlRK11()
52
{}
53
 
54
//------------------------------------------+-----------------------------------
55
//! FIXME_docs
56
 
57
int RtclRw11CntlRK11::FactoryCmdConfig(RtclArgs& args, RtclRw11Cpu& cpu)
58
{
59
  static RtclNameSet optset("-base|-lam");
60
 
61
  string cntlname(cpu.Obj().NextCntlName("rk"));
62
  string cntlcmd = cpu.CommandName() + cntlname;
63
 
64
  uint16_t base = Rw11CntlRK11::kIbaddr;
65
  int      lam  = Rw11CntlRK11::kLam;
66
 
67
  string opt;
68
  while (args.NextOpt(opt, optset)) {
69
    if        (opt == "-base") {
70
      if (!args.GetArg("base", base, 0177776, 0160000)) return kERR;
71
    } else if (opt == "-lam") {
72
      if (!args.GetArg("lam",  lam,  0, 15)) return kERR;
73
    }
74
  }
75
  if (!args.AllDone()) return kERR;
76
 
77
  // configure controller
78
  Obj().Config(cntlname, base, lam);
79
 
80
  // install in CPU
81
  cpu.Obj().AddCntl(dynamic_pointer_cast<Rw11Cntl>(ObjSPtr()));
82
  // finally create tcl command
83
  CreateObjectCmd(args.Interp(), cntlcmd.c_str());
84
 
85
  // and create unit commands
86
  for (size_t i=0; i<Obj().NUnit(); i++) {
87
    string unitcmd = cpu.CommandName() + Obj().UnitName(i);
88
    new RtclRw11UnitRK11(args.Interp(), unitcmd, Obj().UnitSPtr(i));
89
  }
90
 
91
  return kOK;
92
}
93
 
94
} // end namespace Retro

powered by: WebSVN 2.1.0

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