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

Subversion Repositories scarm

[/] [scarm/] [trunk/] [src/] [Instructions/] [scARMDPI.h] - 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,I "stole" some codes from 
23
//       "swarm" , author Michael Dales (michael@dcs.gla.ac.uk)
24
// scARMDPI.h: interface for the scARMDPI class.
25
//
26
//////////////////////////////////////////////////////////////////////
27
 
28
#include ".\instructions\scARMInstruction.h"
29
#include ".\components\registers\scRegisterFile.h"      // Added by ClassView
30
#include "scTypes.h"    // Added by ClassView
31
 
32
 
33
/* Data processing instruction - there are 3 types (see Furber book) */
34
typedef struct DP1TAG
35
{
36
  uint32_t imm    : 8;
37
  uint32_t rot    : 4;
38
  uint32_t rd     : 4;
39
  uint32_t rn     : 4;
40
  uint32_t set    : 1;
41
  uint32_t opcode : 4;
42
  uint32_t hash   : 1;
43
  uint32_t pad    : 2;
44
  uint32_t cond   : 4;
45
} DPI1;
46
 
47
typedef struct DP2TAG
48
{
49
  uint32_t rm     : 4;
50
  uint32_t pad2   : 1;
51
  uint32_t type   : 2;
52
  uint32_t shift  : 5;
53
  uint32_t rd     : 4;
54
  uint32_t rn     : 4;
55
  bool_t   set    : 1;
56
  uint32_t opcode : 4;
57
  uint32_t hash   : 1;
58
  uint32_t pad    : 2;
59
  uint32_t cond   : 4;
60
} DPI2;
61
 
62
typedef struct DP3TAG
63
{
64
  uint32_t rm     : 4;
65
  uint32_t pad3   : 1;
66
  uint32_t type   : 2;
67
  uint32_t pad2   : 1;
68
  uint32_t rs     : 4;
69
  uint32_t rd     : 4;
70
  uint32_t rn     : 4;
71
  bool_t   set    : 1;
72
  uint32_t opcode : 4;
73
  uint32_t hash   : 1;
74
  uint32_t pad    : 2;
75
  uint32_t cond   : 4;
76
} DPI3;
77
#define  DPI_MASK    0x0C000000
78
#define  DPI_SIG     0x00000000
79
 
80
class scARMDPI : public scARMInstruction
81
{
82
        friend class scDecoder;
83
public:
84
        scARMDPI();
85
        virtual ~scARMDPI();
86
 
87
 
88
 
89
 
90
private:
91
        REGS get_Rs(uint32_t);
92
        bool_t get_Set(uint32_t nI);
93
        uint32_t get_Rot(uint32_t);
94
        void Decode(uint32_t);
95
        OPCODE   get_opcode(uint32_t nI);
96
        SHIFT    get_shift(uint32_t nI);
97
    REGS     get_Rn(uint32_t nI);
98
        REGS     get_Rm(uint32_t nI);
99
        uint32_t get_Imm(uint32_t nI);
100
        REGS     get_Rd(uint32_t nI);
101
        uint32_t get_shift_dist(uint32_t nI);
102
 
103
};

powered by: WebSVN 2.1.0

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