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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [compiler/] [src/] [cp_compiler/] [Instruction.h] - Blame information for rev 216

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 216 diegovalve
#ifndef INSTRUCTION_H
2
#define INSTRUCTION_H
3
 
4
/**********************************************************************************
5
Theia, Ray Cast Programable graphic Processing Unit.
6
Copyright (C) 2012  Diego Valverde (diego.valverde.g@gmail.com)
7
 
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
 
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21
 
22
***********************************************************************************/
23
 
24
#include <bitset>
25
#include <string>
26
#include <fstream>
27
 
28
#define INSTRUCTION_SIZE 32
29
#define OPERATION_SIZE   8
30
#define DESTINATION_SIZE 4
31
#define SOURCE1_SIZE     8
32
#define SOURCE0_SIZE     8
33
#define SRC_ADDR_SIZE    8
34
#define DST_ADDR_SIZE    8
35
#define DST_ID_SIZE      4
36
#define COPY_SIZE        8
37
 
38
 
39
#define SRC0_RNG 7,0
40
#define SRC1_RNG 15,8
41
#define DST_RNG  23,16
42
#define OP_RNG   31,24
43
#define COPY_DST_RNG 7,0
44
#define COPY_SRC_RNG 15,8
45
#define COPY_DSTID_RNG 23,16
46
//#define COPY_SIZE_RNG 23,20
47
 
48
#define LITERAL_RNG 15,0
49
 
50
#define STATUS_REG 2
51
#define BLOCK_DST_REG 3
52
////////////////////////////////////////////////////////
53
 
54
typedef enum
55
{
56
        EOPERATION_NOP=0,
57
        EOPERATION_DELIVERCOMMAND,
58
        EOPERATION_ADD,
59
        EOPERATION_SUB,
60
        EOPERATION_AND,
61
        EOPERATION_OR,
62
        EOPERATION_BRANCH,
63
        EOPERATION_BEQ,
64
        EOPERATION_BNE,
65
        EOPERATION_BG,
66
        EOPERATION_BL,
67
        EOPERATION_BGE,
68
        EOPERATION_BLE,
69
        EOPERATION_ASSIGN,
70
        EOPERATION_COPYBLOCK,
71
        EOPERATION_EXIT,
72
        EOPERATION_NOT,
73
        EOPERATION_SHL,
74
        EOPERATION_SHR
75
 
76
} EOPERATION;
77
 
78
 
79
typedef enum
80
{
81
        VP_COMMAND_START_MAIN_THREAD = 0,
82
        VP_COMMAND_STOP_MAIN_THREAD = 1
83
} EVPCOMMAD;
84
 
85
class CControlInstruction
86
{
87
  public:
88
        CControlInstruction();
89
        ~CControlInstruction();
90
  public:
91
 
92
        void Clear( void );
93
 
94
  public:
95
    void SetOperation( EOPERATION aCode );
96
        void SetDestinationAddress( unsigned int aDestinationAddress );
97
        void SetSrc1Address( unsigned int aAddress );
98
        void SetSrc0Address( unsigned int aAddress );
99
        void SetCopyDestinationAddress( unsigned int aAddress );
100
        void SetCopySourceAddress( unsigned int aAddress );
101
        void SetCopyDestinationId( unsigned int aAddress );
102
        void SetCopySize( unsigned int aAddress ); //High part or SRC0
103
        void SetLiteral(  unsigned int aLiteral );
104
        std::string PrintAssembly( void );
105
  //private:
106
        unsigned int     mOperation;
107
        unsigned int     mDestination;
108
        unsigned int     mSource1;
109
        unsigned int     mSource0;
110
        unsigned int     mCopyDestinationAddress;
111
        unsigned int     mCopySourceAddress;
112
        unsigned int     mCopyDestinationId;
113
        unsigned int     mCopySize;
114
        unsigned int     mLiteral;
115
 
116
public:
117
        int                               mSourceLine;
118
        std::string                   mComment;
119
  private:
120
 
121
};
122
 
123
#endif

powered by: WebSVN 2.1.0

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