OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [RspPacket.h] - Blame information for rev 197

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

Line No. Rev Author Line
1 63 julius
// ----------------------------------------------------------------------------
2
 
3
// RSP packet: definition
4
 
5
// Copyright (C) 2008  Embecosm Limited <info@embecosm.com>
6
 
7
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
8
 
9
// This file is part of the cycle accurate model of the OpenRISC 1000 based
10
// system-on-chip, ORPSoC, built using Verilator.
11
 
12
// This program is free software: you can redistribute it and/or modify it
13
// under the terms of the GNU Lesser General Public License as published by
14
// the Free Software Foundation, either version 3 of the License, or (at your
15
// option) any later version.
16
 
17
// This program is distributed in the hope that it will be useful, but WITHOUT
18
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
20
// License for more details.
21
 
22
// You should have received a copy of the GNU Lesser General Public License
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 
25
// ----------------------------------------------------------------------------
26
 
27
// $Id: RspPacket.h 326 2009-03-07 16:47:31Z jeremy $
28
 
29
#ifndef RSP_PACKET__H
30
#define RSP_PACKET__H
31
 
32
#include <iostream>
33
 
34
 
35
//-----------------------------------------------------------------------------
36
//! Class for RSP packets
37
 
38
//! Can't be null terminated, since it may include zero bytes
39
//-----------------------------------------------------------------------------
40
class RspPacket
41
{
42
public:
43
 
44
  //! The data buffer. Allow direct access to avoid unnecessary copying.
45
  char *data;
46
 
47
  // Constructor and destructor
48
  RspPacket (int  _bufSize);
49
  ~RspPacket ();
50
 
51
  // Pack a constant string into a packet
52
  void  packStr (const char *str);      // For fixed packets
53
 
54
  // Accessors
55
  int   getBufSize ();
56
  int   getLen ();
57
  void  setLen (int  _len);
58
 
59
 
60
private:
61
 
62
  //! The data buffer size
63
  int   bufSize;
64
 
65
  //! Number of chars in the data buffer (<= bufSize)
66
  int   len;
67
 
68
};
69
 
70
 
71
//! Stream output
72
std::ostream &operator<< (std::ostream &s,
73
                          RspPacket    &p);
74
 
75
 
76
#endif  // RSP_PACKET_SC__H

powered by: WebSVN 2.1.0

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