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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [tools/] [src/] [librlink/] [RlinkCommand.hpp] - Diff between revs 10 and 19

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 10 Rev 19
Line 1... Line 1...
// $Id: RlinkCommand.hpp 375 2011-04-02 07:56:47Z mueller $
// $Id: RlinkCommand.hpp 495 2013-03-06 17:13:48Z mueller $
//
//
// Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
//
// This program is free software; you may redistribute and/or modify it under
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
// Software Foundation, either version 2, or at your option any later version.
//
//
Line 11... Line 11...
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for complete details.
// for complete details.
// 
// 
// Revision History: 
// Revision History: 
// Date         Rev Version  Comment
// Date         Rev Version  Comment
 
// 2013-05-06   495   1.0.1  add RlinkContext to Print() args; drop oper<<()
// 2011-03-27   374   1.0    Initial version
// 2011-03-27   374   1.0    Initial version
// 2011-01-09   354   0.1    First draft
// 2011-01-09   354   0.1    First draft
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
 
 
 
 
/*!
/*!
  \file
  \file
  \version $Id: RlinkCommand.hpp 375 2011-04-02 07:56:47Z mueller $
  \version $Id: RlinkCommand.hpp 495 2013-03-06 17:13:48Z mueller $
  \brief   Declaration of class RlinkCommand.
  \brief   Declaration of class RlinkCommand.
*/
*/
 
 
#ifndef included_Retro_RlinkCommand
#ifndef included_Retro_RlinkCommand
#define included_Retro_RlinkCommand 1
#define included_Retro_RlinkCommand 1
Line 30... Line 31...
#include <cstddef>
#include <cstddef>
#include <cstdint>
#include <cstdint>
#include <vector>
#include <vector>
#include <ostream>
#include <ostream>
 
 
#include "RlinkCommandExpect.hpp"
 
#include "RlinkAddrMap.hpp"
 
#include "librtools/Rtools.hpp"
#include "librtools/Rtools.hpp"
 
 
 
#include "RlinkContext.hpp"
 
#include "RlinkAddrMap.hpp"
 
#include "RlinkCommandExpect.hpp"
 
 
 
#include "librtools/Rbits.hpp"
 
 
namespace Retro {
namespace Retro {
 
 
  class RlinkCommand {
  class RlinkCommand : public Rbits {
    public:
    public:
                    RlinkCommand();
                    RlinkCommand();
                    RlinkCommand(const RlinkCommand& rhs);
                    RlinkCommand(const RlinkCommand& rhs);
                    ~RlinkCommand();
                    ~RlinkCommand();
 
 
Line 84... Line 89...
      bool          TestFlagAny(uint32_t mask) const;
      bool          TestFlagAny(uint32_t mask) const;
      bool          TestFlagAll(uint32_t mask) const;
      bool          TestFlagAll(uint32_t mask) const;
      size_t        RcvSize() const;
      size_t        RcvSize() const;
      RlinkCommandExpect* Expect() const;
      RlinkCommandExpect* Expect() const;
 
 
      void          Print(std::ostream& os, const RlinkAddrMap* pamap=0,
      void          Print(std::ostream& os, const RlinkContext& cntx,
                          size_t abase=16, size_t dbase=16,
                          const RlinkAddrMap* pamap=0, size_t abase=16,
                          size_t sbase=16) const;
                          size_t dbase=16, size_t sbase=16) const;
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
 
 
      static const char* CommandName(uint8_t cmd);
      static const char* CommandName(uint8_t cmd);
      static const RflagName* FlagNames();
      static const RflagName* FlagNames();
 
 
      RlinkCommand& operator=(const RlinkCommand& rhs);
      RlinkCommand& operator=(const RlinkCommand& rhs);
 
 
    // some constants
    // some constants (also defined in cpp)
      static const uint8_t  kCmdRreg = 0;   //!< command code read register
      static const uint8_t  kCmdRreg = 0;   //!< command code read register
      static const uint8_t  kCmdRblk = 1;   //!< command code read block
      static const uint8_t  kCmdRblk = 1;   //!< command code read block
      static const uint8_t  kCmdWreg = 2;   //!< command code write register
      static const uint8_t  kCmdWreg = 2;   //!< command code write register
      static const uint8_t  kCmdWblk = 3;   //!< command code write block
      static const uint8_t  kCmdWblk = 3;   //!< command code write block
      static const uint8_t  kCmdStat = 4;   //!< command code get status
      static const uint8_t  kCmdStat = 4;   //!< command code get status
Line 120... Line 125...
      static const uint32_t kFlagErrCrc = 1u<<11; //!< error: crc check
      static const uint32_t kFlagErrCrc = 1u<<11; //!< error: crc check
 
 
      static const uint32_t kFlagChkStat= 1u<<12; //!< stat expect check failed
      static const uint32_t kFlagChkStat= 1u<<12; //!< stat expect check failed
      static const uint32_t kFlagChkData= 1u<<13; //!< data expect check failed
      static const uint32_t kFlagChkData= 1u<<13; //!< data expect check failed
 
 
      static const uint32_t kFlagVol    = 1<<16; //!< volatile
      static const uint32_t kFlagVol    = 1u<<16; //!< volatile
 
 
 
      static const uint8_t  kStat_M_Stat  = 0xe0; //!< stat: external stat bits
 
      static const uint8_t  kStat_V_Stat  = 5;
 
      static const uint8_t  kStat_B_Stat  = 0x07;
 
      static const uint8_t  kStat_M_Attn  = kBBit04;//!< stat: attn flags set
 
      static const uint8_t  kStat_M_Cerr  = kBBit03;//!< stat: attn flags set
 
      static const uint8_t  kStat_M_Derr  = kBBit02;//!< stat: attn flags set
 
      static const uint8_t  kStat_M_RbNak = kBBit01;//!< stat: attn flags set
 
      static const uint8_t  kStat_M_RbErr = kBBit00;//!< stat: attn flags set
 
 
 
      static const uint16_t kRbaddr_IInt  = 0xff;   //!< iint: rbus address
 
      static const uint16_t kIInt_M_AnEna = kWBit15;//!< iint: attn notify
 
      static const uint16_t kIInt_M_ItoEna= kWBit14;//!< iint: attn/idle timeout
 
      static const uint16_t kIInt_M_ItoVal= 0x00ff; //!< iint: attn/idle timeout
 
 
    protected:
    protected:
      void          SetCmdSimple(uint8_t cmd, uint16_t addr, uint16_t data);
      void          SetCmdSimple(uint8_t cmd, uint16_t addr, uint16_t data);
 
 
    protected:
    protected:
Line 139... Line 158...
      uint32_t      fFlags;                 //!< state bits
      uint32_t      fFlags;                 //!< state bits
      size_t        fRcvSize;               //!< receive size for command
      size_t        fRcvSize;               //!< receive size for command
      RlinkCommandExpect* fpExpect;         //!< pointer to expect container
      RlinkCommandExpect* fpExpect;         //!< pointer to expect container
  };
  };
 
 
  std::ostream& operator<<(std::ostream& os, const RlinkCommand& obj);
 
 
 
 
 
} // end namespace Retro
} // end namespace Retro
 
 
#if !(defined(Retro_NoInline) || defined(Retro_RlinkCommand_NoInline))
 
#include "RlinkCommand.ipp"
#include "RlinkCommand.ipp"
#endif
 
 
 
#endif
#endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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