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>
Most of the time of compiling a file goes into starting the compiler and updating the library. With --batch-compile, the VHDL files of a library that are ready to be compiled at the same time, and whose compile commands only differ in the file name, are compiled in one call. A batch that fails is compiled again one file at a time, to find the file that fails. GHDL, NVC and Riviera-PRO support it; GHDL does not batch files compiled with coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A command line on Windows has at most 32767 characters, which the file names of a large library can exceed. A batch ends before its command gets longer than 32000 characters, on every platform so that it behaves the same everywhere, and the remaining files go into the next batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NVC reads the file names of a batch from a file given as @file, one name per line, and Riviera-PRO from vcom -f, quoted, so their batches are not limited by the length of a command line. GHDL keeps the limit, since its response files handle neither quotes nor escapes. A file whose name cannot be listed, with a line break for NVC or a double quote for Riviera-PRO, is compiled on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file name cannot contain a double quote on Windows, so that case is skipped there. The interface is created with its prefix and version lookup mocked, like in the other tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file name that a file list cannot hold, with a line break for NVC or a double quote for Riviera-PRO, makes its batch fail, which compiles the files of the batch one at a time. The checks for those names are removed. The line of a file list is a format string rather than a method, and the batch tests share the project setup of the compile tests. 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.
Follow-up to #1235, and built on it. Only the commits after "Compile in parallel only with --parallel-compile" are new; the rest are #1235 and will drop out once it is merged.
Adds
--batch-compile, which compiles the VHDL files of a library that are ready at the same time in one call to the compiler, instead of one call per file. Most of the time of compiling a file goes into starting the compiler and updating the library, so a clean compile gets several times faster. This is the automatic form of the soft file groups discussed in #1088: a clean compile batches, while an incremental compile of a few files compiles them one at a time. It can be used on its own or together with--parallel-compile.What was added
supports_batch_compile; GHDL, NVC and Riviera-PRO do. GHDL does not batch files compiled with coverage, whose.gcnofiles it moves one file at a time.nvc -a @file, one name per line, andvcom -f file, quoted names), written to the output path and removed after the call. GHDL gets the file names in the command, because its response files handle neither quotes nor escapes, so a name with a space cannot be listed. A GHDL batch therefore ends before its command gets longer than 32,000 characters, below the 32,767 characters of a command line on Windows, and the remaining files go into the next batch. A file name a file list cannot hold, with a line break for NVC or a double quote for Riviera-PRO, makes its batch fail, so the batch is compiled one file at a time.Measured
A clean compile (
--compile --clean) of hdl-modules, 330 files, wall time including VUnit's start-up, median of 3 runs:--parallel-compile -p 16(#1235)--batch-compile--batch-compile --parallel-compile -p 16* With
--keep-compiling, because hdl-modules does not compile completely with Riviera-PRO on master either ('latencyattribute insine_calculator.vhd). Every Riviera-PRO run compiled the same 327 files, failed the same 2 and skipped the same 2. The batch containingsine_calculator.vhdfailed and was compiled again one file at a time, which exercises the fallback.Every NVC and GHDL run compiled all 330 files. With both flags, GHDL goes from 7.37 s to 1.64 s, where
--parallel-compilealone gives 5.97 s.Tested
--parallel-compilewith and without concurrent compiles into a library. The last case covers a crash found while measuring, when a batch took a file the scheduler had not reached yet.quo"te.vhdfails and its three files then compile one at a time.C:\fl\my proj, compiles all 147 files with and without--batch-compile, and with--parallel-compile -p 4, and its 6 tests pass after a batched compile.--batch-compile.--batch-compile --parallel-compile -p 32compiled all 330 files every time.🤖 Generated with Claude Code