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 509

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
//! Class for RSP packets
36
 
37
//! Can't be null terminated, since it may include zero bytes
38
//-----------------------------------------------------------------------------
39 462 julius
class RspPacket {
40 63 julius
public:
41
 
42 462 julius
        //! The data buffer. Allow direct access to avoid unnecessary copying.
43
        char *data;
44 63 julius
 
45 462 julius
        // Constructor and destructor
46
         RspPacket(int _bufSize);
47
        ~RspPacket();
48 63 julius
 
49 462 julius
        // Pack a constant string into a packet
50
        void packStr(const char *str);  // For fixed packets
51 63 julius
 
52 462 julius
        // Accessors
53
        int getBufSize();
54
        int getLen();
55
        void setLen(int _len);
56 63 julius
 
57
private:
58
 
59 462 julius
        //! The data buffer size
60
        int bufSize;
61 63 julius
 
62 462 julius
        //! Number of chars in the data buffer (<= bufSize)
63
        int len;
64 63 julius
 
65
};
66
 
67
//! Stream output
68 462 julius
std::ostream & operator<<(std::ostream & s, RspPacket & p);
69 63 julius
 
70 462 julius
#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.