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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librwxxtpp/] [RtclRw11CntlBase.ipp] - Blame information for rev 40

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

Line No. Rev Author Line
1 22 wfjm
// $Id: RtclRw11CntlBase.ipp 521 2013-05-20 22:16:45Z mueller $
2 19 wfjm
//
3
// Copyright 2013- by Walter F.J. Mueller 
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-08   484   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22 22 wfjm
  \version $Id: RtclRw11CntlBase.ipp 521 2013-05-20 22:16:45Z mueller $
23 19 wfjm
  \brief   Implemenation (all inline) of RtclRw11CntlBase.
24
*/
25
 
26
/*!
27
  \class Retro::RtclRw11CntlBase
28
  \brief FIXME_docs
29
*/
30
 
31
#include "librtcltools/Rtcl.hpp"
32
#include "librtcltools/RtclOPtr.hpp"
33
 
34
// all method definitions in namespace Retro
35
namespace Retro {
36
 
37
//------------------------------------------+-----------------------------------
38
//! Constructor
39
 
40
template 
41
inline RtclRw11CntlBase::RtclRw11CntlBase(const std::string& type)
42
  : RtclRw11Cntl(type),
43
    fspObj(new TO())
44
{
45
  AddMeth("bootcode", boost::bind(&RtclRw11CntlBase::M_bootcode,this, _1));
46
 
47
  TO* pobj = fspObj.get();
48
  fGets.Add("type",  boost::bind(&TO::Type, pobj));
49
  fGets.Add("name",  boost::bind(&TO::Name, pobj));
50
  fGets.Add          ("base",  boost::bind(&TO::Base, pobj));
51
  fGets.Add               ("lam",   boost::bind(&TO::Lam,  pobj));
52
  fGets.Add              ("enable",boost::bind(&TO::Enable, pobj));
53
  fGets.Add              ("started",boost::bind(&TO::IsStarted, pobj));
54
  fGets.Add    ("trace", boost::bind(&TO::TraceLevel,pobj));
55
 
56
  fSets.Add        ("enable", boost::bind(&TO::SetEnable,pobj,_1));
57
  fSets.Add    ("trace", boost::bind(&TO::SetTraceLevel,pobj,_1));
58
}
59
 
60
//------------------------------------------+-----------------------------------
61
//! FIXME_docs
62
 
63
template 
64
inline RtclRw11CntlBase::~RtclRw11CntlBase()
65
{}
66
 
67
//------------------------------------------+-----------------------------------
68
//! FIXME_docs
69
 
70
template 
71
inline TO& RtclRw11CntlBase::Obj()
72
{
73
  return *fspObj;
74
}
75
 
76
//------------------------------------------+-----------------------------------
77
//! FIXME_docs
78
 
79
template 
80
inline const boost::shared_ptr& RtclRw11CntlBase::ObjSPtr()
81
{
82
  return fspObj;
83
}
84
 
85
//------------------------------------------+-----------------------------------
86
//! FIXME_docs
87
 
88
template 
89
int RtclRw11CntlBase::M_bootcode(RtclArgs& args)
90
{
91
  int unit = 0;
92
  if (!args.GetArg("?unit", unit, 0, Obj().NUnit()-1)) return kERR;
93
  if (!args.AllDone()) return kERR;
94
 
95
  std::vector code;
96
  uint16_t aload;
97
  uint16_t astart;
98
  if (Obj().BootCode(unit, code, aload, astart)) {
99 22 wfjm
    RtclOPtr pres(Tcl_NewListObj(0, NULL));
100 19 wfjm
    Tcl_ListObjAppendElement(NULL, pres, Tcl_NewIntObj((int)aload));
101
    Tcl_ListObjAppendElement(NULL, pres, Tcl_NewIntObj((int)astart));
102
    Tcl_ListObjAppendElement(NULL, pres, Rtcl::NewListIntObj(code));
103
    args.SetResult(pres);
104
  }
105
 
106
  return kOK;
107
}
108
 
109
} // end namespace Retro

powered by: WebSVN 2.1.0

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