This one needs a Verilator fix that's still under review upstream (verilator#8100): without it the compiler crashes on unique{} over a row of a 2D array. Run is off until it merges.
REQUIRES A PATCHED VERILATOR: see README.md first. unique{} on a foreach-indexed row of a 2D array crashes the compiler on every released Verilator as of this writing, the same bug thermal_power_fuzzer avoids with pairwise inequality. This exercise uses it at full scale:
make run EX=dma_ring_allocator VERILATOR=/path/to/patched/verilator_bin
A DMA scheduler’s allocation grid: 4 channels of 4 ring-buffer slots, each holding an 8-bit block pointer. Each requirement is ordinary; making them all hold in one randomize() is the hard part.
grid[i] is already an array, so unique {grid[i]} covers a row. There’s no grid[:][j] column slice, so a column’s elements have to be listed explicitly inside something that iterates the column index. IEEE 1800-2023 18.5.4 explains why a whole row and one cell inside a foreach over it differ.solve ... before has to settle qos_mode ahead of dma_grid.Fix the class below.
RequirementsOn every randomize() call
One working answer: brokenbench's own fix for this exercise. Try a few runs first.
What changes, against the code you started with:
docker run --pull always --rm -p 127.0.0.1:8787:8787 ghcr.io/adibis/brokenbench-runnerLooking for a runner on this computer…
The first start downloads about 250 MB; after that it starts in seconds and only downloads again when there's an update. Your code goes to the runner on your computer, not to chipdv.io.