Repository navigation
Conversation
A file is compiled as soon as the files it depends on are compiled, up to -p files at a time. Files of a library are compiled one at a time, since GHDL and Riviera-PRO update the index of a library without locking it and lose units when compiled into concurrently. NVC locks its libraries and compiles files of a library at the same time. The output of a file is written once it is compiled so that outputs do not mix. GHDL compiles one file at a time with gcc coverage, which writes .gcno files to the working directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GHDL rewrites the index of a library by deleting it and renaming a new one into place, so a compile reading the library in between fails with "cannot find resource library". Unless a simulator locks its libraries, a file is not compiled while its library is read, or while a library it reads, that of any of its dependencies, is compiled into. A library clause fails in GHDL on a library nothing has been compiled into, which a file compiled in parallel may come before. GHDL creates every library with ghdl -i when setting up the library mapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without it, files are compiled one at a time whatever -p is, so that a -p given for running tests does not change how files are compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ru551n
marked this pull request as ready for review
October 15, 2026 12:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
--parallel-compile, which compiles files in parallel, up to-pfiles at a time. A file is compiled as soon as the files it depends on are compiled. Without the flag, files are compiled one at a time as before, whatever-pis, sopython run.py --clean -p 0still compiles serially.What was added
Scheduler:
SimulatorInterface.compile_source_filescompiles each file once its dependencies are compiled, using a thread pool. As before, the dependents of a failed file are skipped, and--keep-compilingkeeps going. Without it, no new files start after a failure.Library rule: GHDL and Riviera-PRO update a library's index without locking it.
Unless a simulator sets
supports_concurrent_compiles_into_library, a file is therefore not compiled while its own library is compiled into or read, or while a library it reads is compiled into. The libraries a file reads are those of its dependencies. NVC sets the flag, because it holds a reader/writer lock on its libraries (see NVC performance with Vunit #1036).GHDL: creates every library with
ghdl -iwhen setting up the library mapping. A file with a library clause can otherwise be compiled before anything has been compiled into that library, which GHDL rejects. With gcc coverage, GHDL compiles one file at a time, because the.gcnofiles land in the working directory.Output: with
-p> 1, each file's output is written once its compile finishes, so outputs don't mix.Measured
A clean compile (
--compile --clean --parallel-compile) of hdl-modules, 330 files, wall time including VUnit's start-up, median of 3 runs:-p* With
--keep-compiling, because hdl-modules does not compile completely with Riviera-PRO on master either ('latencyattribute insine_calculator.vhd). Every run compiled the same 327 files.GHDL and Riviera-PRO level off early because almost every file reads
vunit_lib, so the library rule serialises most of the compile. The follow-up #1236, built on this PR, addresses that with--batch-compile, which compiles the files of a library that are ready at the same time in one call, the automatic form of the soft file groups discussed in #1088. With both flags, the clean compile of hdl-modules takes 1.42 s with NVC, 1.64 s with GHDL and 2.66 s with Riviera-PRO.Tested
--parallel-compile, files are compiled with one thread for-p 4and-p 0; with it, with-pthreads.-p4, 16 and 32. All 29 runs that reached the compile compiled all 330 files. The 30th failed earlier, on a duplicate configuration name in hdl-modules' own randomised test setup.A news fragment is included.
🤖 Generated with Claude Code