Detailed description
- This is a minor bugfix.
- The existing problem is some BMD-internal
hart->flagsbecoming unset by SysBus detection routine. - The PR fixes it by using the corresponding "or-equal" bit-masking operator.
Because in riscv_hart_init() riscv_hart_discover_isa() runs first, and possibly sets the new RV_HART_FLAG_MEMORY_PROGBUF, but then riscv_hart_memory_access_type() runs second, and overrides the hart->flags value, the first set flag is lost.
uint32_t isa = riscv_hart_discover_isa(hart);
hart->address_width = riscv_isa_address_width(isa);
hart->extensions = isa & RV_ISA_EXTENSIONS_MASK;
/* Figure out if the target needs us to use sysbus or not for memory access */
riscv_hart_memory_access_type(target);
I think I'll want to preserve progbuf- and abstractauto- related flags, especially as that method can potentially read memory 1.75x faster than SBA (at the cost of halting the hart).
Encountered and tested on modified Hazard3 where I've enabled HAVE_SBA=1, but wanted to test single-progbuf, by unsetting a hart flag in hazard3_probe(), with the result that none of two methods got used, and AAM (fallback path) is not even implemented in that softcore as of v1.0.1.
Your checklist for this pull request
- I've read the Code of Conduct
- I've read the guidelines for contributing to this repository
- It builds for hardware native (see Building the firmware)
- It builds as BMDA (see Building the BMDA)
- I've tested it to the best of my ability
- My commit messages provide a useful short description of what the commits do