1 |
16 |
dgisselq |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// Filename: pddrsim.h
|
4 |
|
|
//
|
5 |
|
|
// Project: A wishbone controlled DDR3 SDRAM memory controller.
|
6 |
|
|
//
|
7 |
|
|
// Purpose: To expand a DDR3 SDRAM controllers influence across multiple
|
8 |
|
|
// clocks. Hence, if the DDR3 SDRAM controller runs at half
|
9 |
|
|
// the clock rate of the DDR3-SDRAM, this will expand it to the full
|
10 |
|
|
// clock rate.
|
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 PDDRSIM_H
|
42 |
|
|
#define PDDRSIM_H
|
43 |
|
|
|
44 |
|
|
#include "ddrsdramsim.h"
|
45 |
|
|
|
46 |
|
|
class PDDRSIM : protected DDRSDRAMSIM {
|
47 |
|
|
public:
|
48 |
|
|
PDDRSIM(int lglen) : DDRSDRAMSIM(lglen) {};
|
49 |
18 |
dgisselq |
void operator()(int, int, int, unsigned, unsigned, unsigned, unsigned,
|
50 |
|
|
const unsigned *, unsigned *);
|
51 |
|
|
unsigned operator[](unsigned addr) { return mem(addr); };
|
52 |
|
|
void set(unsigned addr, unsigned data) { mem(addr) = data; };
|
53 |
16 |
dgisselq |
unsigned bank_state(int bankid) {
|
54 |
|
|
return (m_bank[bankid].m_state & 0x0ffff); };
|
55 |
|
|
};
|
56 |
|
|
|
57 |
|
|
#endif
|