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

Subversion Repositories scarm

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 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
 
17
///////////////////////////////////////////////////////////////////              
18
//          
19
//  Original Author: Allen Tao Zhong,
20
//  University of Electronic Science and Technology in China
21
//  email: zhong@opencores.org
22
//  info   This is a SystemC ARM model
23
// scID.cpp: implementation of the scID class.
24
//
25
//////////////////////////////////////////////////////////////////////
26
 
27
#include "..\pipeline\scID.h"
28
#include "..\instructions\scARMInstruction.h"
29
//////////////////////////////////////////////////////////////////////
30
// Construction/Destruction
31
//////////////////////////////////////////////////////////////////////
32
 
33
 
34
 
35
 
36
scID::~scID()
37
{
38
 
39
}
40
 
41
void  scID::entry()
42
{
43
//if branch is taken
44
  if(s_b_Branch==0)
45
  {
46
        s_n_IR=in_n_Instruction;
47
  } else
48
  {
49
    s_n_IR=0;
50
  }
51
}
52
 
53
 
54
 
55
void scID::output()
56
{
57
  out_b_MEM=s_b_MEM;
58
  out_Rd=s_Rd;
59
  out_OP=s_OP;
60
  out_COND=s_COND;
61
sc_time local_time = sc_time_stamp();
62
cout<<"ID time="<<local_time<<"--"<<endl;
63
 
64
  //Is the excutive order  important?
65
  out_SHIFT=s_SHIFT_TYPE;
66
  out_n_Dist=s_ShiftDist;
67
//choose the suitable output;
68
  cout<<"  OPCODE="<<s_OP;
69
  cout<<"  SHIFT="<<s_SHIFT_TYPE<<" Dist="<<s_ShiftDist;
70
  cout<<"  Rd="<<s_Rd;
71
  //A Bus
72
  if(1)
73
  {
74
  out_REG=s_Rn;
75
  out_n_A=in_n_RegData;
76
  cout<<"  R"<<s_Rn<<"="<<in_n_RegData;
77
  }else
78
  {
79
    cout<<"  Branch="<<in_n_NPC<<endl;
80
        out_n_A=in_n_NPC;
81
        ;// Rn=PC
82
  }
83
 
84
  //B bus
85
  bool_t bSet=s_Set;
86
  if(bSet==0)
87
  {
88
          out_REG=s_Rm;
89
      out_n_B=in_n_RegData;
90
          cout<<"  R"<<s_Rm<<"="<<in_n_RegData<<endl;
91
  }
92
  else if(bSet==1)
93
  {
94
          out_n_B=s_n_Imm;
95
          cout<<"  Imm"<<"="<<s_n_Imm<<endl;
96
  }
97
 
98
 
99
}

powered by: WebSVN 2.1.0

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