forked from byungwoo733/riscv-ovpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
riscvInfo.c
84 lines (70 loc) · 2.67 KB
/
riscvInfo.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2005-2020 Imperas Software Ltd., www.imperas.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// VMI header files
#include "vmi/vmiAttrs.h"
#include "vmi/vmiModelInfo.h"
#include "vmi/vmiMessage.h"
// model header files
#include "riscvStructure.h"
VMI_PROC_INFO_FN(riscvProcInfo) {
riscvP riscv = (riscvP) processor;
static const vmiProcessorInfo info32 = {
.vlnv.vendor = "riscv.ovpworld.org",
.vlnv.library = "processor",
.vlnv.name = "riscv",
.vlnv.version = "1.0",
.semihost.vendor = "riscv.ovpworld.org",
.semihost.library = "semihosting",
.semihost.name = "pk",
.semihost.version = "1.0",
.helper.vendor = "imperas.com",
.helper.library = "intercept",
.helper.name = "riscv32CpuHelper",
.helper.version = "1.0",
.elfCode = 243,
.endianFixed = True,
.endian = MEM_ENDIAN_LITTLE,
.gdbPath = "$IMPERAS_HOME/lib/$IMPERAS_ARCH/gdb/riscv-none-embed-gdb" VMI_EXE_SUFFIX,
.gdbInitCommands = "set architecture riscv:rv32",
.family = "riscv",
.QLQualified = True
};
static const vmiProcessorInfo info64 = {
.vlnv.vendor = "riscv.ovpworld.org",
.vlnv.library = "processor",
.vlnv.name = "riscv",
.vlnv.version = "1.0",
.semihost.vendor = "riscv.ovpworld.org",
.semihost.library = "semihosting",
.semihost.name = "pk",
.semihost.version = "1.0",
.helper.vendor = "imperas.com",
.helper.library = "intercept",
.helper.name = "riscv64CpuHelper",
.helper.version = "1.0",
.elfCode = 243,
.endianFixed = True,
.endian = MEM_ENDIAN_LITTLE,
.gdbPath = "$IMPERAS_HOME/lib/$IMPERAS_ARCH/gdb/riscv-none-embed-gdb" VMI_EXE_SUFFIX,
.gdbInitCommands = "set architecture riscv:rv64",
.family = "riscv",
.QLQualified = True
};
return (riscv->configInfo.arch & ISA_XLEN_64) ? &info64 : &info32;
}