|
11 | 11 | public class RVVMMachine {
|
12 | 12 | private long machine = 0;
|
13 | 13 |
|
14 |
| - public static final int RVVM_OPT_NONE = 0; |
15 |
| - public static final int RVVM_OPT_JIT = 1; // Enable JIT |
16 |
| - public static final int RVVM_OPT_JIT_CACHE = 2; // Amount of per-core JIT cache (In bytes) |
17 |
| - public static final int RVVM_OPT_JIT_HARVARD = 3; // No dirty code tracking, explicit ifence, slower |
18 |
| - public static final int RVVM_OPT_VERBOSITY = 4; // Verbosity level of internal logic |
19 |
| - public static final int RVVM_OPT_HW_IMITATE = 5; // Imitate traits or identity of physical hardware |
20 |
| - public static final int RVVM_OPT_MAX_CPU_CENT = 6; // Max CPU load % per guest/host CPUs |
21 |
| - public static final int RVVM_OPT_RESET_PC = 7; // Physical jump address at reset, defaults to mem_base |
22 |
| - public static final int RVVM_OPT_DTB_ADDR = 8; // Pass DTB address if non-zero, omits FDT generation |
23 |
| - public static final int RVVM_MAX_OPTS = 9; |
24 |
| - |
25 |
| - public static final int RVVM_OPT_MEM_BASE = 0x80000001; // Physical RAM base address |
26 |
| - public static final int RVVM_OPT_MEM_SIZE = 0x80000002; // Physical RAM size |
27 |
| - public static final int RVVM_OPT_HART_COUNT = 0x80000003; // Amount of harts |
28 |
| - |
29 |
| - public RVVMMachine(long mem_mb, int smp, boolean rv64) { |
| 14 | + public static final int RVVM_OPT_NONE = 0x0; |
| 15 | + public static final int RVVM_OPT_RESET_PC = 0x1; //!< Physical jump address at reset, defaults to 0x80000000 |
| 16 | + public static final int RVVM_OPT_DTB_ADDR = 0x2; //!< Pass DTB address if non-zero, omits FDT generation |
| 17 | + public static final int RVVM_OPT_TIME_FREQ = 0x3; //!< Machine timer frequency, 10Mhz by default |
| 18 | + public static final int RVVM_OPT_HW_IMITATE = 0x4; //!< Imitate traits or identity of physical hardware |
| 19 | + public static final int RVVM_OPT_MAX_CPU_CENT = 0x5; //!< Max CPU load % per guest/host CPUs |
| 20 | + public static final int RVVM_OPT_JIT = 0x6; //!< Enable JIT |
| 21 | + public static final int RVVM_OPT_JIT_CACHE = 0x7; //!< Amount of per-core JIT cache (In bytes) |
| 22 | + public static final int RVVM_OPT_JIT_HARVARD = 0x8; //!< No dirty code tracking, explicit ifence, slower |
| 23 | + |
| 24 | + public static final int RVVM_OPT_MEM_BASE = 0x80000001; //!< Physical RAM base address, defaults to 0x80000000 |
| 25 | + public static final int RVVM_OPT_MEM_SIZE = 0x80000002; //!< Physical RAM size |
| 26 | + public static final int RVVM_OPT_HART_COUNT = 0x80000003; //!< Amount of harts |
| 27 | + |
| 28 | + public RVVMMachine(long mem_mb, int smp, String isa) { |
30 | 29 | if (RVVMNative.isLoaded()) {
|
31 |
| - this.machine = RVVMNative.create_machine(RVVMNative.DEFAULT_MEMBASE, mem_mb << 20, smp, rv64); |
| 30 | + this.machine = RVVMNative.create_machine(mem_mb << 20, smp, isa); |
32 | 31 | }
|
33 | 32 |
|
34 | 33 | if (isValid()) {
|
|
0 commit comments