Andrew Waterman
39acd8e2ea
Simplify isa_parser_t::extension_enabled
Now that we guarantee that max_isa and extension_table are synchronized,
we only need to check the latter.
3 years ago
Andrew Waterman
5badd68ae1
Keep max_isa and extension_table in sync in exactly one place
This fixes a bug where --isa=rv64imafdc would fail to set
extension_table['F'] because of the ad hoc manner in which we were
synchronizing max_isa and extension_table.
3 years ago
Andrew Waterman
57ae9e6844
Use more appropriate data structure for extension_table
We know its size at compile time.
3 years ago
Andrew Waterman
830324dcd2
Lift artificial limit of 191 extensions
Add new accessors that accept the isa_extension_t enum.
Retain the original ones that accept unsigned char to avoid churn.
3 years ago
Scott Johnson
23718cb9b1
Merge pull request #1214 from YenHaoChen/pr-legalize-timing
Add legalize_timing() for tdata1.timing
3 years ago
YenHaoChen
e3efb15eca
triggers: refactor: use static and remove const for legalize_action()
Since this method does not use 'this', we turn this method into static.
3 years ago
YenHaoChen
1fc34a04d6
triggers: refactor: use static and remove const for legalize_match()
Since this method no longer use 'this', we turn this method into static.
3 years ago
YenHaoChen
888ef08c02
triggers: refactor: remove legalization_action()'s dependency on dmode
avoid breaking functionality by reordering statements in tdata1.write()
3 years ago
YenHaoChen
d61f4a7164
triggers: legalize timing=1(after) for load data trigger
As recommended in the debug spec table "Suggested Trigger Timings", to
avoid the footgun of replaying a load (which may have side effects) when
the breakpoint trap handler returns.
reference: https://github.com/riscv-software-src/riscv-isa-sim/pull/1208#issuecomment-1373035906
-----------------------------------------------------------------------
The legalize_timing() depends on select, execution, load, and store,
which are updated in the same function tdata1_write(). As a result,
reordering statements in the tdata1_write() may break the functionality.
Passing those variables as parameters to legalize_timing() does not
solve the problem. Thus, we give the original write value and the masks
of the variables to the legalize_timing(). This makes the legalization
function independent of the updating variables and resolves the issue.
reference: https://github.com/riscv-software-src/riscv-isa-sim/pull/1214
3 years ago
Andrew Waterman
35e229ccfa
Merge pull request #1225 from riscv-software-src/no-threads
Run Spike and HTIF in a single thread, rather than two
3 years ago
Andrew Waterman
469d9c6907
Merge pull request #1224 from riscv-software-src/uart-poll-less-often
For NS16550 UART, poll stdin less often
3 years ago
YenHaoChen
b8c2b26af8
triggers: refactor: remove an outdated comment
3 years ago
YenHaoChen
bc53ecdf30
triggers: refactor: add mcontrol_common_t::legalize_timing() function
3 years ago
Andrew Waterman
6b44190063
Run Spike and HTIF in a single thread, rather than two
The two-thread approach was originally motivated by making Spike look
as similar as possible to other HTIF targets. But we can get the same
semantics without threading by running the simulator inside of the HTIF
host's idle loop instead of performing a context switch.
This was motivated by speeding up the simulator on Mac OS (it's worth
around 20% because using pthread condition variables to force strict
alternation is very slow). But I think it also simplifies the control
flow enough to justify it on that basis, too.
3 years ago
Andrew Waterman
d97ad271ee
Merge pull request #1212 from riscv-software-src/debug_smoke
Automatically test that external debug still works.
3 years ago
Andrew Waterman
32cf5bb54a
For NS16550 UART, poll stdin less often
On my Mac Mini, calling `poll()` on stdin takes around 10 us, and we
are invoking it every 20 us or so. Reduce the frequency of polling
by 16x when not actively receiving data, thereby reducing the fraction
of time spent in `poll()` to a trivial amount.
3 years ago
Tim Newsome
1dc27cfa78
Automatically test that external debug still works.
3 years ago
Tim Newsome
5e1bdfc496
Use nproc or hw.ncpu instead of -j4 to build spike.
3 years ago
Tim Newsome
582f4d442e
Refactor build-spike out of test-spike.
3 years ago
Andrew Waterman
9874c17671
Merge pull request #1223 from riscv-software-src/readme
Fix supported debug version, use extension names
3 years ago
Tim Newsome
ecda7372d7
Fix supported debug version, use extension names
Addresses #1221
3 years ago
Andrew Waterman
3b2e8d53b3
Merge branch 'aap-sc-aap-sc/mem_cfg_corner_cases'
3 years ago
Parshintsev Anatoly
ca1a5fd8f0
improve merge_mem_regions to handle memory region covering the whole 64-bit address space
3 years ago
Parshintsev Anatoly
28eb7aa8be
change mem_cfg_t to accept cases when (base + size) is at 64-bit address space border
3 years ago
Parshintsev Anatoly
f403cb9e54
simplify check_mem_overlap by utilizing get_inclusive_end of mem_cfg_t
3 years ago
Parshintsev Anatoly
fcf61f0008
simplify merge_mem_regions by utilizing get_inclusive_end() of mem_cfg_t
this is to properly handle potential 64-bit overflow in (base + size)
expression
3 years ago
Parshintsev Anatoly
1e6869c17e
get_inclusive_end implementation for mem_cfg_t
The method can simplify proper processing of sitiations when
(base + size) overflows 64-bit interger.
3 years ago
Parshintsev Anatoly
e402a8353d
implement get_size() getter for mem_cfg_t object
NFT. We also mark `base` and `size` fields as private.
3 years ago
Parshintsev Anatoly
a606da640b
implement get_base() getter for mem_cfg_t object
NFC. The intention is for `base` and `size` fields of mem_cfg_t
to be private members. This is the fist part of this commit.
3 years ago
Andrew Waterman
3274292415
Merge pull request #1211 from riscv-software-src/speed-up-slow-path
Only update histogram when histogramming
3 years ago
Andrew Waterman
571945ca6e
Remove vestigial UNUSED annotation
It dates back to when this code was ifdef'd.
3 years ago
Andrew Waterman
3d63b06fae
Only update histogram when histogramming
This is worth a 1.4x speedup on the slow path (when not histogramming).
3 years ago
Andrew Waterman
0eec0c9119
Merge pull request #1210 from riscv-software-src/dynamic-dirty-enable
Control mmu-dirtying via command line
3 years ago
Jerry Zhao
e7f1798b5d
Remove --enable-dirty compile option
3 years ago
Jerry Zhao
469405129d
Respect --mmu-dirty flag instead of --enable-dirty
3 years ago
Jerry Zhao
d50a0f0022
Add --mmu-dirty runtime flag
3 years ago
Jerry Zhao
c4e7c88728
Add cfg_t field to enable PTE dirtying
3 years ago
Jerry Zhao
044fedabee
Untabify ci-tests/testlib.c
3 years ago
Jerry Zhao
0a59b06f3b
Merge pull request #1209 from riscv-software-src/debugfix
Fix debug-mode regression introduced by 20e7f53
3 years ago
Scott Johnson
b3946f8500
Merge pull request #1207 from YenHaoChen/pr-trap-trigger-common
triggers: refactor: add trap_common_t
3 years ago
Jerry Zhao
7334b0180e
Fix debug-mode regression introduced by 20e7f53
- Debug mode should break the processor out of wfi
- wfi in debug mode should execute as a nop
3 years ago
Andrew Waterman
4ac904b7c0
Merge pull request #1206 from riscv-software-src/always_misaligned
Control whether misaligned accesses are supported via command line
3 years ago
YenHaoChen
89a44eb0a2
triggers: refactor: move mode_match() and textra_match() to private for protected
3 years ago
YenHaoChen
590a36e487
triggers: refactor: create trigger_t::common_match()
3 years ago
YenHaoChen
3b36645442
triggers: refactor: move textra_match() to protected from public
3 years ago
YenHaoChen
247f01691b
triggers: refactor: move textra_match() into detect_trap_match::detect_trap_match()
3 years ago
YenHaoChen
0a45912d60
triggers: refactor: move textra_match() into mcontrol_common_t::detect_memory_access_match()
3 years ago
YenHaoChen
6fd0169b32
triggers: refactor: move detect_trap_match() to trap_common_t from itrigger_t/etrigger_t
3 years ago
YenHaoChen
4cf0ef9c4e
triggers: refactor: create virtual function trap_common_t::simple_match()
3 years ago
YenHaoChen
c0cc59d5c4
triggers: refactor: move get_action() to trap_common_t from itrigger_t/etrigger_t
3 years ago