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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [iss/] [mem/] [DataMemory.cc] - Blame information for rev 199

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 198 sybreon
/*!
2
  AEMB INSTRUCTION SET SIMULATOR
3
  Copyright (C) 2009 Shawn Tan <shawn.tan@aeste.net>
4
 
5
  This program is free software: you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
7
  the Free Software Foundation, either version 3 of the License, or
8
  (at your option) any later version.
9
 
10
  This program is distributed in the hope that it will be useful, but
11
  WITHOUT ANY WARRANTY; without even the implied warranty of
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
  General Public License for more details.
14
 
15
  You should have received a copy of the GNU General Public License
16
  along with this program.  If not, see
17
  <http://www.gnu.org/licenses/>.
18
*/
19 199 sybreon
#include "DataMemory.hh"
20 198 sybreon
#include <utility>
21
 
22
using std::map;
23
using std::make_pair;
24
 
25 199 sybreon
void DataMemory::putData(const int addr, const int data)
26 198 sybreon
{
27
        int word = addr >> 2; // word align the address
28
        mem.insert(make_pair(word, data));
29
}
30
 
31 199 sybreon
int DataMemory::getData(const int addr)
32 198 sybreon
{
33
        int word = addr >> 2; // word align the address
34
        map<int,int>::iterator data = mem.find(word);
35
        return data->second;
36
}
37
 
38 199 sybreon
DataMemory::DataMemory()
39 198 sybreon
{
40
}
41
 
42 199 sybreon
DataMemory::~DataMemory()
43 198 sybreon
{
44
}

powered by: WebSVN 2.1.0

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