mirror of
https://github.com/openhwgroup/cve2.git
synced 2025-04-24 14:09:08 -04:00
This is triggered by the fact that if the ICache parameter is false then we don't instantiate the ibex_icache module. For verilator simulations, the module is then discarded entirely, which means that its two DPI functions are not defined. That's unfortunate because we're also compiling the code in scrambled_ecc32_mem_area.cc, which expects the functions to be defined. The obvious solution (don't include scrambled_ecc32_mem_area.cc if you don't have an icache) isn't easy to do, because FuseSoc doesn't currently allow us to use parameters to configure its dependency tree (see fusesoc issue 438 for a discussion). The super-clever solution that I came up with before(!) was to declare these symbols as weak in the C++ code. That way, we can do a runtime check to make sure that no-one is silly enough to call them without an icache, but everything will still build properly either way. Unfortunately, that doesn't work well with xcelium simulations. Xcelium turns out to compile all the C++ code into one .so library and generate functions for exported DPI functions in another. These two solibs then get loaded at runtime with dlopen(). But this doesn't work with weak symbols: in fact, it seems you end up with the C++ version every time. Boo! So let's be stupider about it and define (bogus) versions of the DPI functions in this case. Fortunately, both of them are designed to return zero on failure so we can just return zero and needn't worry too much. The idea is that when this lands, we can revert the OpenTitan change that switched the C++ code to using weak symbols and Xcelium simulations will start working. |
||
---|---|---|
.. | ||
ibex_alu.sv | ||
ibex_branch_predict.sv | ||
ibex_compressed_decoder.sv | ||
ibex_controller.sv | ||
ibex_core.f | ||
ibex_core.sv | ||
ibex_counter.sv | ||
ibex_cs_registers.sv | ||
ibex_csr.sv | ||
ibex_decoder.sv | ||
ibex_dummy_instr.sv | ||
ibex_ex_block.sv | ||
ibex_fetch_fifo.sv | ||
ibex_icache.sv | ||
ibex_id_stage.sv | ||
ibex_if_stage.sv | ||
ibex_load_store_unit.sv | ||
ibex_lockstep.sv | ||
ibex_multdiv_fast.sv | ||
ibex_multdiv_slow.sv | ||
ibex_pkg.sv | ||
ibex_pmp.sv | ||
ibex_pmp_reset_default.svh | ||
ibex_prefetch_buffer.sv | ||
ibex_register_file_ff.sv | ||
ibex_register_file_fpga.sv | ||
ibex_register_file_latch.sv | ||
ibex_top.sv | ||
ibex_top_tracing.sv | ||
ibex_tracer.sv | ||
ibex_tracer_pkg.sv | ||
ibex_wb_stage.sv |