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

Subversion Repositories scarm

[/] [scarm/] [trunk/] [src/] [components/] [barrelshifter/] [scBarrelShifter.h] - Blame information for rev 10

Go to most recent revision | 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
//   
24
//
25
///////////////////////////////////////////////////////////////////////////////
26
 
27
/*****************************************************************************
28
 
29
  scBarrelShifter.h: interface for the scBarrelShifter class.
30
 
31
  Original Author: Allen Tao Zhong, University of Electronic Science and
32
                   Technology in China
33
 
34
 *****************************************************************************/
35
#ifndef scBarrelShifter_H
36
#define scBarrelShifter_H
37
 
38
 
39
#include"scTypes.h"
40
#include<systemc.h>
41
#include<sc_mslib.h>
42
#include ".\components\registers\scRegisterFile.h"
43
#include".\instructions\scARMInstruction.h"
44
//////////////////////////////////////
45
//
46
//  parameters of barrelshifter
47
//
48
////////////////////////////////////////
49
 
50
enum SHIFT {S_LSL = 0, S_LSR = 1, S_ASR = 2, S_ROR, S_RRX, S_ASL};
51
//control signals for barrel shifter
52
 
53
 
54
 
55
//////////////////////////////
56
//the interface of barrelshifter
57
//////////////////////////////
58
 
59
class scBarrelShifter:public sc_module
60
{
61
public://ports
62
 
63
     sc_in<uint32_t> in_n_Val;
64
         sc_in<SHIFT>  in_SHIFT_TYPE;
65
         sc_in<uint32_t>  in_n_Dist;
66
         sc_out<uint32_t> out_n_NewVal;
67
         sc_outmaster<REGS>    out_CPSR;
68
         sc_inoutslave<uint32_t>  inout_n_Flag;
69
 
70
public:
71
        SC_HAS_PROCESS(scBarrelShifter);//
72
        scBarrelShifter(sc_module_name name) : sc_module(name)
73
    {
74
 
75
        SC_METHOD(entry);
76
                sensitive<<in_n_Val<<in_SHIFT_TYPE<<in_n_Dist;
77
 
78
    }
79
private://data
80
        uint32_t m_nShiftCarryBit;
81
 
82
 
83
        uint32_t m_nShiftType;
84
        uint32_t m_nShiftDist;
85
private:
86
 
87
        void entry(void);
88
 
89
uint32_t Shift(uint32_t nVal, enum SHIFT type, int nDist);// behavoir implementation
90
 
91
};
92
 
93
 
94
#endif

powered by: WebSVN 2.1.0

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