JNI (Verilator) support.
Add JNITestAPI.java interface and cpp implementation. We need to use System.load() to load the compiled (but fixed) cpp code, but use dlopen/dlsym/dlclose in the fixed cpp code to load the shared library since Java doesn't provide an explicit unload (dlclose) mechanism. Tease apart the pieces im sim_api.h so we can use them from both separate process ans shared library verilator implementations. Remove unused imports. Modify the generated verilator <Module>.mk to add rules to build shared library version of the simulator. Use multiline string literal to compose the harness code. Much cleanup and testing required. TODO: - we hang un failed expects with some possibly JNI related semaphore. - break up finish/abort/unload so they're composable.
parent
325d5836
Please register or sign in to comment