OpenASIP
2.2
Loading...
Searching...
No Matches
src
tools
RISCVTools.hh
Go to the documentation of this file.
1
/*
2
Copyright (C) 2024 Tampere University.
3
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) any later version.
8
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Lesser General Public License for more details.
13
14
You should have received a copy of the GNU Lesser General Public
15
License along with this library; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
/**
19
* @file RISCVTools.hh
20
*
21
* Declaration of RISCVTools class.
22
*
23
* @author Kari Hepola 2024 (kari.hepola@tuni.fi)
24
* @note rating: red
25
*/
26
27
28
#ifndef RISCV_TOOLS_HH
29
#define RISCV_TOOLS_HH
30
31
#include <string>
32
33
class
InstructionFormat
;
34
35
struct
R4Instruction
{
36
int
baseopcode
;
37
int
funct3
;
38
int
funct7
;
39
int
funct2
;
40
};
41
42
class
RISCVTools
{
43
public
:
44
static
std::string
getFunc3Str
(
const
int
encoding);
45
static
std::string
getFunc7Str
(
const
int
encoding);
46
static
std::string
getFunc2Str
(
const
int
encoding);
47
static
std::string
getOpcodeStr
(
const
int
encoding);
48
static
int
getFunc3Int
(
const
int
encoding);
49
static
int
getFunc7Int
(
const
int
encoding);
50
static
int
getFunc2Int
(
const
int
encoding);
51
static
int
getOpcodeInt
(
const
int
encoding);
52
static
inline
void
findCustomOps
(
53
std::map<std::string, int>& customOps_,
BinaryEncoding
* bem_);
54
static
R4Instruction
decodeR4Instruction
(
const
uint32_t opcode);
55
};
56
57
#include "
RISCVTools.icc
"
58
59
#endif
60
RISCVTools.icc
BinaryEncoding
Definition
BinaryEncoding.hh:61
InstructionFormat
Definition
InstructionFormat.hh:46
RISCVTools
Definition
RISCVTools.hh:42
RISCVTools::getFunc2Int
static int getFunc2Int(const int encoding)
RISCVTools::getFunc2Str
static std::string getFunc2Str(const int encoding)
RISCVTools::decodeR4Instruction
static R4Instruction decodeR4Instruction(const uint32_t opcode)
RISCVTools::getFunc7Int
static int getFunc7Int(const int encoding)
RISCVTools::getOpcodeStr
static std::string getOpcodeStr(const int encoding)
RISCVTools::getOpcodeInt
static int getOpcodeInt(const int encoding)
RISCVTools::findCustomOps
static void findCustomOps(std::map< std::string, int > &customOps_, BinaryEncoding *bem_)
RISCVTools::getFunc3Str
static std::string getFunc3Str(const int encoding)
RISCVTools::getFunc7Str
static std::string getFunc7Str(const int encoding)
RISCVTools::getFunc3Int
static int getFunc3Int(const int encoding)
R4Instruction
Definition
RISCVTools.hh:35
R4Instruction::funct3
int funct3
Definition
RISCVTools.hh:37
R4Instruction::baseopcode
int baseopcode
Definition
RISCVTools.hh:36
R4Instruction::funct2
int funct2
Definition
RISCVTools.hh:39
R4Instruction::funct7
int funct7
Definition
RISCVTools.hh:38
Generated by
1.9.8