forked from byungwoo733/riscv-ovpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
riscvParameters.h
132 lines (116 loc) · 3.42 KB
/
riscvParameters.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
* 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.
*
*/
#pragma once
// VMI header files
#include "vmi/vmiAttrs.h"
#include "vmi/vmiParameters.h"
// model header files
#include "riscvTypeRefs.h"
//
// Define model parameters
//
typedef struct riscvParamValuesS {
// simulation controls
VMI_ENUM_PARAM(variant);
VMI_ENUM_PARAM(user_version);
VMI_ENUM_PARAM(priv_version);
VMI_ENUM_PARAM(vector_version);
VMI_ENUM_PARAM(fp16_version);
VMI_ENUM_PARAM(mstatus_fs_mode);
VMI_BOOL_PARAM(verbose);
VMI_BOOL_PARAM(debug_mode);
VMI_BOOL_PARAM(updatePTEA);
VMI_BOOL_PARAM(updatePTED);
VMI_BOOL_PARAM(unaligned);
VMI_BOOL_PARAM(unalignedAMO);
VMI_BOOL_PARAM(wfi_is_nop);
VMI_BOOL_PARAM(mtvec_is_ro);
VMI_UNS32_PARAM(tvec_align);
VMI_UNS64_PARAM(mtvec_mask);
VMI_UNS64_PARAM(stvec_mask);
VMI_UNS64_PARAM(utvec_mask);
VMI_BOOL_PARAM(tval_ii_code);
VMI_BOOL_PARAM(time_undefined);
VMI_BOOL_PARAM(cycle_undefined);
VMI_BOOL_PARAM(instret_undefined);
VMI_BOOL_PARAM(enable_CSR_bus);
VMI_BOOL_PARAM(d_requires_f);
VMI_BOOL_PARAM(xret_preserves_lr);
VMI_BOOL_PARAM(require_vstart0);
VMI_UNS32_PARAM(ASID_bits);
VMI_UNS32_PARAM(PMP_grain);
VMI_UNS32_PARAM(PMP_registers);
VMI_UNS32_PARAM(Sv_modes);
VMI_UNS32_PARAM(lr_sc_grain);
VMI_UNS64_PARAM(reset_address);
VMI_UNS64_PARAM(nmi_address);
VMI_UNS32_PARAM(local_int_num);
VMI_UNS32_PARAM(numHarts);
// fundamental configuration
VMI_ENDIAN_PARAM(endian);
// ISA configuration
VMI_UNS32_PARAM(misa_MXL);
VMI_UNS32_PARAM(misa_MXL_mask);
VMI_UNS32_PARAM(misa_Extensions);
VMI_STRING_PARAM(add_Extensions);
VMI_UNS32_PARAM(misa_Extensions_mask);
VMI_STRING_PARAM(add_Extensions_mask);
VMI_UNS64_PARAM(mvendorid);
VMI_UNS64_PARAM(marchid);
VMI_UNS64_PARAM(mimpid);
VMI_UNS64_PARAM(mhartid);
VMI_UNS64_PARAM(mtvec);
VMI_UNS32_PARAM(mstatus_FS);
VMI_UNS32_PARAM(ELEN);
VMI_UNS32_PARAM(SLEN);
VMI_UNS32_PARAM(VLEN);
VMI_UNS32_PARAM(SEW_min);
VMI_BOOL_PARAM(Zvlsseg);
VMI_BOOL_PARAM(Zvamo);
VMI_BOOL_PARAM(Zvediv);
VMI_BOOL_PARAM(Zvqmac);
} riscvParamValues;
//
// Free parameter definitions
//
void riscvFreeParameters(riscvP riscv);
//
// Get any configuration with the given name
//
riscvConfigCP riscvGetNamedConfig(riscvConfigCP cfgList, const char *variant);
//
// Return Privileged Architecture description
//
const char *riscvGetPrivVersionDesc(riscvP riscv);
//
// Return User Architecture description
//
const char *riscvGetUserVersionDesc(riscvP riscv);
//
// Return Vector Architecture description
//
const char *riscvGetVectorVersionDesc(riscvP riscv);
//
// Return 16-bit floating point description
//
const char *riscvGetFP16VersionDesc(riscvP riscv);
//
// Return mstatus.FS mode name
//
const char *riscvGetFSModeName(riscvP riscv);