Looking for feedback on new just-in-time compilation mode #634
Replies: 3 comments 1 reply
-
This really did save a ton of time when doing the OSVVM quick tests that are part of the |
Beta Was this translation helpful? Give feedback.
-
Hi Nick. Br, |
Beta Was this translation helpful? Give feedback.
-
I tested a bit with the new JIT functionality. Overall the runtime is 22m:35s pre and 22m:49s post, plus an additional 5s of analysis time for the whole regression. All in all, not a significant change on my setup, but it still beats GHDL which does 41m:10s with 25s additional analysis time on the same setup. |
Beta Was this translation helpful? Give feedback.
-
For the last several years NVC has performed all code generation at elaboration time, generating a single native shared library containing all the processes and subprograms used by the design. This gives excellent simulation performance, but at the expense of relatively long elaboration times. This is particularly a problem for modern frameworks like OSVVM or VUnit where elaboration might take several seconds but the test only runs for a fraction of a second.
The latest development version of NVC contains a new elaboration flag
--jit
which skips ahead-of-time code generation and instead defers code generation until the simulation is running. Initially all processes and subprograms are executed in a bytecode interpreter (the same one that's currently used for evaluating static expressions during elaboration). Once a piece of code has been executed often enough for compilation to be worthwhile, it is compiled to native code in memory on a background thread. By default "often enough" is 100 invocations but you can change that with theNVC_JIT_THRESHOLD
environment variable.For short-running simulations this gives a huge speed-up when measuring the total test time including elaboration. For simulations that run for longer than 30 seconds or so there is probably not much benefit, although the total test time shouldn't be significantly different.
There is currently one limitation that will be removed in the future: this feature only works in combination with the
--no-save
elaboration option, so you must elaborate and run in the same command. E.g. instead ofDo
I am really keen to get feedback on how well this works for you (or not) since I am planning to make this the default in some future release.
Beta Was this translation helpful? Give feedback.
All reactions