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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [iss/] [cpu/] [FetchUnit.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
 
20 199 sybreon
#include <assert.h>
21
#include "FetchUnit.hh"
22 198 sybreon
 
23 199 sybreon
namespace aemb
24 198 sybreon
{
25 199 sybreon
 
26
int FetchUnit::getPC()
27
{
28
        return r_pc;
29 198 sybreon
}
30
 
31 199 sybreon
void FetchUnit::setPC(const int pc)
32 198 sybreon
{
33 199 sybreon
        assert( !(pc & 0x03) ); // check for alignment
34
        r_pc = pc;
35 198 sybreon
}
36 199 sybreon
 
37
InstFormat FetchUnit::tokInst(const int opc)
38
{
39
        InstFormat tmp;
40
        tmp.word = opc;
41
        return tmp;
42
}
43 198 sybreon
 
44 199 sybreon
void FetchUnit::reset()
45 198 sybreon
{
46 199 sybreon
        setPC(0);
47 198 sybreon
}
48
 
49 199 sybreon
FetchUnit::FetchUnit()
50
{
51 198 sybreon
}
52 199 sybreon
 
53
FetchUnit::~FetchUnit()
54
{
55
}
56
 
57
}

powered by: WebSVN 2.1.0

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