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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librwxxtpp/] [RtclRw11CntlLP11.cpp] - Blame information for rev 40

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

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

powered by: WebSVN 2.1.0

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