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

Subversion Repositories scarm

[/] [scarm/] [trunk/] [src/] [scRAM.h] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 zhong
///////////////////////////////////////////////////////////////////////////////
2
// This program is free software; you can redistribute it and/or
3
// modify it under the terms of the GNU General Public License
4
// as published by the Free Software Foundation; either version 2
5
// of the License, or (at your option) any later version.
6
//
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
// GNU General Public License for more details.
11
//
12
// You should have received a copy of the GNU General Public License
13
// along with this program; if not, write to the Free Software
14
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
15
//
16
//  scRAM.h: interface for the scRAM class.
17
//          
18
//  Original Author: Allen Tao Zhong,
19
//  University of Electronic Science and Technology in China
20
//  email: zhong@opencores.org
21
//  header n/a
22
//  info   This is a simple ARM modeling using SystemC.
23
//               Architecure defined by Allen Tao Zhong. 
24
//
25
///////////////////////////////////////////////////////////////////////////////
26
 
27
/*****************************************************************************
28
 
29
  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
30
  changes you are making here.
31
 
32
      Name, Affiliation, Date:
33
  Description of Modification:
34
 
35
 *****************************************************************************/
36
#if !defined(SCRAM_H)
37
#define SCRAM_H
38
#include<systemc.h>
39
#include <sc_mslib.h>
40
#include"scTypes.h"
41
const int SIZE_OF_MEM=1024*64;
42
class scRAM  : public sc_module
43
{
44
public:
45
        sc_in<bool>         clock;
46
        sc_inslave<bool>               nRW;
47
        sc_inslave<uint32_t>      A;
48
        sc_inoutmaster<uint32_t>  D;
49
public:
50
        void interrupt();
51
        void rw();
52
        void entry();
53
        void dump(uint32_t);
54
        bool load_program(char*);
55
        SC_HAS_PROCESS(scRAM);
56
        scRAM(sc_module_name name_);
57
        virtual ~scRAM();
58
 
59
private:
60
        uint32_t m_data[SIZE_OF_MEM];
61
        bool m_rw;
62
 
63
private:
64
 
65
        void read_data(void);
66
        void write_data(void);
67
 
68
};
69
#endif

powered by: WebSVN 2.1.0

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