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

Subversion Repositories scarm

[/] [scarm/] [trunk/] [src/] [pipeline/] [scIF.cpp] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 zhong
// scIF.cpp: implementation of the scIF class.
2
//
3
//////////////////////////////////////////////////////////////////////
4
 
5
#include "scIF.h"
6
 
7
//////////////////////////////////////////////////////////////////////
8
// Construction/Destruction
9
//////////////////////////////////////////////////////////////////////
10
 
11
 
12
 
13
scIF::~scIF()
14
{
15
 
16
}
17
 
18
void scIF::entry()
19
{
20
  uint32_t addr=in_n_PC;
21
 
22
  s_n_IR=read_mem_data(addr);
23
  out_n_Instruction=s_n_IR;//output instruction
24
 
25
sc_time local_time = sc_time_stamp();
26
cout<<"IF time="<<local_time<<" Addr="<<addr<<" CurrentIR="<<hex<<s_n_IR<<endl;
27
 
28
}
29
 
30
 
31
 
32
uint32_t  scIF::read_mem_data(uint32_t addr)
33
{
34
 
35
  out_n_Addr=addr;
36
  uint32_t temp;
37
  temp=inout_n_Data;
38
  return temp;
39
}
40
 
41
void scIF::increase_pc()
42
{
43
 
44
   out_n_NPC=in_n_PC+4;
45
 
46
}

powered by: WebSVN 2.1.0

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