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

Subversion Repositories w11

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

powered by: WebSVN 2.1.0

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