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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 30 wfjm
// $Id: RlinkCommandExpect.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.2    expect logic: remove stat from Expect, invert mask
17 28 wfjm
// 2014-12-20   616   1.1    add Done count methods (for rblk/wblk)
18 10 wfjm
// 2011-03-12   368   1.0    Initial version
19
// 2011-01-15   355   0.1    First draft
20
// ---------------------------------------------------------------------------
21
 
22
 
23
/*!
24
  \file
25 30 wfjm
  \version $Id: RlinkCommandExpect.hpp 661 2015-04-03 18:28:41Z mueller $
26 10 wfjm
  \brief   Declaration of class RlinkCommandExpect.
27
*/
28
 
29
#ifndef included_Retro_RlinkCommandExpect
30
#define included_Retro_RlinkCommandExpect 1
31
 
32
#include <cstdint>
33
#include <vector>
34
 
35
namespace Retro {
36
 
37
  class RlinkCommandExpect {
38
    public:
39
 
40
                    RlinkCommandExpect();
41 30 wfjm
                    RlinkCommandExpect(uint16_t data, uint16_t datamsk=0xffff);
42
                    RlinkCommandExpect(const std::vector<uint16_t>& block);
43
                    RlinkCommandExpect(const std::vector<uint16_t>& block,
44 10 wfjm
                                       const std::vector<uint16_t>& blockmsk);
45 19 wfjm
                   ~RlinkCommandExpect();
46 10 wfjm
 
47
      void          SetData(uint16_t data, uint16_t datamsk=0);
48 28 wfjm
      void          SetDone(uint16_t done, bool check=true);
49 10 wfjm
      void          SetBlock(const std::vector<uint16_t>& block);
50
      void          SetBlock(const std::vector<uint16_t>& block,
51
                             const std::vector<uint16_t>& blockmsk);
52
 
53
      uint16_t      DataValue() const;
54
      uint16_t      DataMask() const;
55 28 wfjm
      uint16_t      DoneValue() const;
56 10 wfjm
      const std::vector<uint16_t>& BlockValue() const;
57
      const std::vector<uint16_t>& BlockMask() const;
58
 
59
      bool          DataCheck(uint16_t val) const;
60 28 wfjm
      bool          DoneCheck(uint16_t val) const;
61 10 wfjm
      bool          BlockCheck(size_t ind, uint16_t val) const;
62
      size_t        BlockCheck(const uint16_t* pval, size_t size) const;
63
 
64
      bool          DataIsChecked() const;
65 28 wfjm
      bool          DoneIsChecked() const;
66 10 wfjm
      bool          BlockIsChecked(size_t ind) const;
67
 
68
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
69
 
70
    protected:
71
      uint16_t      fDataVal;               //!< data value
72
      uint16_t      fDataMsk;               //!< data mask
73
      std::vector<uint16_t> fBlockVal;      //!< block value
74
      std::vector<uint16_t> fBlockMsk;      //!< block mask
75
  };
76
 
77
} // end namespace Retro
78
 
79
#include "RlinkCommandExpect.ipp"
80
 
81
#endif

powered by: WebSVN 2.1.0

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