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

Subversion Repositories wb2axip

[/] [wb2axip/] [trunk/] [bench/] [cpp/] [aximemsim.h] - Blame information for rev 15

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

Line No. Rev Author Line
1 8 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    aximemsim.h
4
//
5
// Project:     Pipelined Wishbone to AXI converter
6
//
7
// Purpose:     To attempt to emulate how the MIG responds to AXI requests.
8
//              Of course, this is written with no knowledge of how MIG actually
9
//      responds, just a touch of knowledge regarding how a DDR3 memory works,
10
//      so ... your mileage might vary.
11
//
12
// Creator:     Dan Gisselquist, Ph.D.
13
//              Gisselquist Technology, LLC
14
//
15
////////////////////////////////////////////////////////////////////////////////
16
//
17
// Copyright (C) 2016, Gisselquist Technology, LLC
18
//
19
// This program is free software (firmware): you can redistribute it and/or
20
// modify it under the terms of  the GNU General Public License as published
21
// by the Free Software Foundation, either version 3 of the License, or (at
22
// your option) any later version.
23
//
24
// This program is distributed in the hope that it will be useful, but WITHOUT
25
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
26
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
27
// for more details.
28
//
29
// You should have received a copy of the GNU General Public License along
30
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
31
// target there if the PDF file isn't present.)  If not, see
32
// <http://www.gnu.org/licenses/> for a copy.
33
//
34
// License:     GPL, v3, as defined and found on www.gnu.org,
35
//              http://www.gnu.org/licenses/gpl.html
36
//
37
//
38
////////////////////////////////////////////////////////////////////////////////
39
//
40
//
41
#ifndef AXIMEMSIM_H
42
#define AXIMEMSIM_H
43
 
44
typedef struct {
45
        unsigned        addr;
46
        int             id, len, size, burst, lock, cache, prot, qos;
47
        bool            ready, valid;
48
} AXI_AWBUS;
49
 
50
typedef struct {
51
        unsigned        addr;
52
        int             id, len, size, burst, lock, cache, prot, qos;
53
        bool            ready, valid;
54
} AXI_ARBUS;
55
 
56
typedef struct {
57
        int             strb;
58
        unsigned        data[4];        // 128 bits
59
        int             ready, valid, last;
60
} AXI_WBUS;
61
 
62
typedef struct {
63
        int             id, resp;
64
        int             ready, valid;
65
} AXI_WRESP;
66
 
67
typedef struct {
68
        int             id, resp;
69
        unsigned        data[4];        // 128 bits
70
        int             ready, valid, last;
71
} AXI_RDATA;
72
 
73
typedef struct  {
74
        AXI_AWBUS       aw;
75
        AXI_ARBUS       ar;
76
        AXI_WBUS        w;
77
        AXI_WRESP       b;
78
        AXI_RDATA       r;
79
} AXIBUS;
80
 
81
class   AXIMEMSIM {
82
        unsigned        *m_mem;
83
public:
84
        AXIMEMSIM(unsigned abits);
85
        void    apply(AXIBUS &bus);
86
};
87
 
88
#endif

powered by: WebSVN 2.1.0

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