Skip to content

Commit c11cf45

Browse files
committed
wip: rework RISC-V api to AARCH64
1 parent a439349 commit c11cf45

File tree

5 files changed

+150
-2
lines changed

5 files changed

+150
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ KnottyKraken/
44
images/
55
qemu-*
66
.vscode/
7+
**/.vscode
78

89
# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows,archive,archives,c,c++,cmake,visualstudiocode,assembler,meson,vim
910
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows,archive,archives,c,c++,cmake,visualstudiocode,assembler,meson,vim

TODO_cpu_api.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
ARM LEGACY CPU API
2+
==================
3+
1 theCPU->advance
4+
1 theCPU->breakSimulation
5+
2 theCPU->getPC
6+
1 theCPU->getPendingInterrupt
7+
16 theCPU->id
8+
1 theCPU->readAARCH64
9+
1 theCPU->readDCZID_EL0
10+
1 theCPU->readException
11+
1 theCPU->readFPCR
12+
2 theCPU->readFPSR
13+
1 theCPU->readHCREL2
14+
1 theCPU->readPhysicalAddress
15+
1 theCPU->readPSTATE
16+
1 theCPU->readSCTLR
17+
1 theCPU->readSP_el
18+
2 theCPU->readVirtualAddress
19+
1 theCPU->readVRegister
20+
1 theCPU->readXRegister
21+
22+
23+
ARM LEGACY CPU API location
24+
===========================
25+
components/uArch/microArch.cpp:26
26+
components/MMU/PageWalk.cpp:2
27+
28+
OLD QEMU_... api call
29+
=====================
30+
31+
1 API::QEMU_BRANCH_TYPE_COUNT
32+
3 API::QEMU_break_simulation
33+
1 API::QEMU_callback_event_t
34+
1 API::QEMU_Class_Kind_Pseudo
35+
1 API::QEMU_Class_Kind_Session
36+
1 API::QEMU_Class_Kind_Vanilla
37+
1 API::QEMU_Clean_Cache
38+
1 API::QEMU_clear_exception
39+
1 API::QEMU_config_ready
40+
1 API::QEMU_cpu_execute
41+
1 API::QEMU_cpu_has_work
42+
1 API::QEMU_cpu_mem_trans
43+
1 API::QEMU_CPU_Mode_Supervisor
44+
2 API::QEMU_Data_Cache
45+
4 API::QEMU_DI_Data
46+
8 API::QEMU_DI_Instruction
47+
1 API::QEMU_disassemble
48+
1 API::QEMU_dma_mem_trans
49+
1 API::QEMU_dump_state
50+
2 API::QEMU_ethernet_frame
51+
1 API::QEMU_flush_all_caches
52+
1 API::QEMU_get_all_cpus
53+
5 API::QEMU_get_cpu_by_index
54+
6 API::QEMU_get_cpu_index
55+
1 API::QEMU_get_current_el
56+
1 API::QEMU_get_ethernet
57+
2 API::QEMU_get_instruction_count
58+
2 API::QEMU_get_num_cores
59+
12 API::QEMU_get_object_by_name
60+
1 API::QEMU_get_pending_interrupt
61+
1 API::QEMU_get_phys_mem
62+
8 API::QEMU_get_program_counter
63+
1 API::QEMU_getSimulationTime
64+
18 API::QEMU_insert_callback
65+
2 API::QEMU_Instruction_Cache
66+
1 API::QEMU_Invalidate_Cache
67+
10 API::QEMU_logical_to_physical
68+
7 API::QEMU_magic_instruction
69+
1 API::QEMU_mem_op_is_data
70+
2 API::QEMU_mem_op_is_write
71+
1 API::QEMU_PE_No_Exception
72+
1 API::QEMU_periodic_event
73+
1 API::QEMU_read_AARCH64
74+
1 API::QEMU_read_DCZID_EL0
75+
1 API::QEMU_read_exception
76+
1 API::QEMU_read_fpcr
77+
1 API::QEMU_read_fpsr
78+
1 API::QEMU_read_hcr_el2
79+
5 API::QEMU_read_phys_memory
80+
1 API::QEMU_read_pstate
81+
16 API::QEMU_read_register
82+
1 API::QEMU_read_sctlr
83+
1 API::QEMU_read_sp_el
84+
1 API::QEMU_read_tpidr
85+
1 API::QEMU_read_unhashed_sysreg
86+
1 API::QEMU_set_tick_frequency
87+
2 API::QEMU_trace_mem_hier
88+
1 API::QEMU_Trans_Cachecomponents/uArch/microArch.cpp:26
89+
components/MMU/PageWalk.cpp:2
90+
2 API::QEMU_Trans_Instr_Fetch
91+
2 API::QEMU_Trans_Load
92+
2 API::QEMU_Trans_Prefetch
93+
2 API::QEMU_Trans_Store
94+
2 API::QEMU_xterm_break_string
95+
96+
OLD QEMU_... api location
97+
=========================
98+
99+
components/MagicBreakQEMU/breakpoint_tracker.cpp
100+
components/uArch/ValueTracker.hpp
101+
components/DecoupledFeederQEMU/QemuTracer.cpp
102+
components/TraceTrackerQEMU/SharingTracker.hpp
103+
components/MMU/MMUImpl.cpp
104+
core/qemu/mai_api.hpp
105+
core/qemu/startup.cpp
106+
core/qemu/configuration_api.hpp
107+
components/MagicBreakQEMU/breakpoint_tracker.cpp:6
108+
components/uArch/ValueTracker.hpp:8
109+
components/DecoupledFeederQEMU/QemuTracer.cpp:10
110+
components/TraceTrackerQEMU/SharingTracker.hpp:1
111+
components/MMU/MMUImpl.cpp:4
112+
core/qemu/startup.cpp:1
113+
core/qemu/mai_api.hpp:5
114+
core/qemu/configuration_api.hpp:3

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cmake ${FLEXUS_ROOT} \
1212
-DSIMULATOR=${SIM} \
1313
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
1414
-DCMAKE_CXX_FLAGS="-DFLEXUS -Wno-error=maybe-uninitialized -Wno-error=dangling-pointer" \
15-
-DBUILD_DEBUG=yes
15+
# -DBUILD_DEBUG=yes
1616

1717
cmake \
1818
--build ${SIM} \

emu

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,36 @@ drive
3030
file ${ROOT}/images/base.qcow2
3131
format qcow2
3232
if virtio
33+
34+
35+
IF snap
36+
loadvm-external
37+
${snap}
38+
39+
singlestep
40+
41+
d
42+
nochain
43+
44+
icount
45+
shift 0
46+
sleep on
47+
align off
48+
49+
qflex
50+
51+
IF trace
52+
lib-path ${root}/KeenKraken/libKeenKraken.so
53+
cfg-path ${root}/trace.cfg
54+
ENDIF
55+
56+
IF timing
57+
timing
58+
lib-path ${root}/KnottyKraken/libKnottyKraken.so
59+
cfg-path ${root}/timing.cfg
60+
debug vverb
61+
ENDIF
62+
63+
cycles 1000000000
64+
cycles-mask 1
65+
ENDIF

flexus

0 commit comments

Comments
 (0)