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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librlink/] [RlinkCommandList.hpp] - Blame information for rev 30

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

Line No. Rev Author Line
1 30 wfjm
// $Id: RlinkCommandList.hpp 661 2015-04-03 18:28:41Z mueller $
2 10 wfjm
//
3 30 wfjm
// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 10 wfjm
//
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-04-02   661   1.3    expect logic: add SetLastExpect methods
17 27 wfjm
// 2014-11-23   606   1.2    new rlink v4 iface
18 25 wfjm
// 2014-08-02   576   1.1    rename LastExpect->SetLastExpect
19 19 wfjm
// 2013-05-06   495   1.0.1  add RlinkContext to Print() args; drop oper<<()
20 10 wfjm
// 2011-03-05   366   1.0    Initial version
21
// 2011-01-09   354   0.1    First draft
22
// ---------------------------------------------------------------------------
23
 
24
 
25
/*!
26
  \file
27 30 wfjm
  \version $Id: RlinkCommandList.hpp 661 2015-04-03 18:28:41Z mueller $
28 10 wfjm
  \brief   Declaration of class RlinkCommandList.
29
*/
30
 
31
#ifndef included_Retro_RlinkCommandList
32
#define included_Retro_RlinkCommandList 1
33
 
34
#include <cstddef>
35
#include <cstdint>
36
#include <vector>
37
#include <iostream>
38
 
39
#include "RlinkCommandExpect.hpp"
40
#include "RlinkCommand.hpp"
41 19 wfjm
#include "RlinkContext.hpp"
42 10 wfjm
#include "RlinkAddrMap.hpp"
43
 
44
namespace Retro {
45
 
46
  class RlinkCommandList {
47
    public:
48
 
49
                    RlinkCommandList();
50
                    RlinkCommandList(const RlinkCommandList&);
51 19 wfjm
                   ~RlinkCommandList();
52 10 wfjm
 
53
      size_t        AddCommand(RlinkCommand* cmd);
54
      size_t        AddCommand(const RlinkCommand& cmd);
55
      size_t        AddCommand(const RlinkCommandList& clist);
56
      size_t        AddRreg(uint16_t addr);
57
      size_t        AddRblk(uint16_t addr, size_t size);
58
      size_t        AddRblk(uint16_t addr, uint16_t* block, size_t size);
59
      size_t        AddWreg(uint16_t addr, uint16_t data);
60
      size_t        AddWblk(uint16_t addr, std::vector<uint16_t> block);
61
      size_t        AddWblk(uint16_t addr, const uint16_t* block, size_t size);
62 27 wfjm
      size_t        AddLabo();
63 10 wfjm
      size_t        AddAttn();
64
      size_t        AddInit(uint16_t addr, uint16_t data);
65
 
66 30 wfjm
      void          SetLastExpectStatus(uint8_t stat, uint8_t statmsk=0xff);
67
      void          SetLastExpectData(uint16_t data, uint16_t datamsk=0xffff);
68
      void          SetLastExpectDone(uint16_t done);
69
      void          SetLastExpectBlock(const std::vector<uint16_t>& block);
70
      void          SetLastExpectBlock(const std::vector<uint16_t>& block,
71
                                       const std::vector<uint16_t>& blockmsk);
72 25 wfjm
      void          SetLastExpect(RlinkCommandExpect* exp);
73 10 wfjm
 
74 27 wfjm
      void          ClearLaboIndex();
75
      void          SetLaboIndex(int ind);
76
      int           LaboIndex() const;
77
      bool          LaboActive() const;
78
 
79 10 wfjm
      void          Clear();
80
      size_t        Size() const;
81
 
82 30 wfjm
      void          Print(std::ostream& os, const RlinkAddrMap* pamap=0,
83
                          size_t abase=16, size_t dbase=16,
84
                          size_t sbase=16) const;
85 10 wfjm
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
86
 
87
      RlinkCommandList& operator=(const RlinkCommandList& rhs);
88
 
89
      RlinkCommand& operator[](size_t ind);
90
      const RlinkCommand& operator[](size_t ind) const;
91
 
92
    protected:
93 27 wfjm
      std::vector<RlinkCommand*> fList;     //!< vector of commands
94
      int           fLaboIndex;             //!< index of active labo (-1 if no)
95 10 wfjm
  };
96
 
97
} // end namespace Retro
98
 
99
#include "RlinkCommandList.ipp"
100
 
101
#endif

powered by: WebSVN 2.1.0

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