Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
5d6cc6c
Add a separate test case for each test file
rw1nkler Jun 13, 2025
b7e3741
Add "pytype binary, library" hint
sgizler May 23, 2025
ce75b89
Add cocotb tests
magancarz Dec 29, 2025
5b3f1d0
xls/modules/zstd: expose fifo verilog module
lpawelcz Dec 31, 2024
82b442f
modules/zstd/cocotb: Add ZSTD frame generator library
lpawelcz Oct 9, 2024
3eec9be
dependency_support: Add zstandard python library
lpawelcz Oct 3, 2024
595df0f
modules/zstd: Add verilog simulation of the ZstdDecoder
lpawelcz Oct 8, 2024
6a7294f
Use frame generator in tests
magancarz Dec 29, 2025
8db2cc7
modules/zstd/zstd_dec: Write decoded data to the memory
lpawelcz May 13, 2025
a0fafec
modules/zstd/zstd_dec: Remove stream-based output interface
lpawelcz May 12, 2025
a585d16
modules/zstd/zstd_dec_cocotb_test: Improve Verilog simulation
lpawelcz Nov 18, 2024
3796c90
modules/zstd/memory/mem_writer: Reduce the amount of random test cases
lpawelcz Jan 2, 2025
3de5586
modules/zstd/memory: Move verilog sources to rtl subdirectory
lpawelcz Apr 7, 2025
fe86865
xls/modules/zstd/external: Add docstring and license for third party …
lpawelcz Apr 7, 2025
806c4b4
modules/zstd: Adjust cocotb test to removal of RESET CSR
lpawelcz May 13, 2025
25d9d9a
Style changes
wsipak Apr 7, 2025
1cfd144
Extend cocotb tests of ZSTD decoder
rw1nkler Jul 23, 2025
1179e34
Collect P&R benchmarks
rw1nkler Jul 23, 2025
6810b5d
Add fixed version of RamDemux together with a test
rw1nkler Jun 17, 2025
5e0701a
Document decoder testing
sgizler Jul 21, 2025
4687a49
dependency_support: Add verilog_axi package
rw1nkler Apr 23, 2025
112d089
Use bazel package with verilog_axi
rw1nkler Jul 23, 2025
a05cfba
Downgrade dependencies
rw1nkler Jul 23, 2025
d17570b
Run tests selectively in GitHub CI
rw1nkler Jul 24, 2025
2ce8a34
Remove zstandard python library
rw1nkler Jul 25, 2025
06faeb1
modules: zstd: update readme
rw1nkler Sep 10, 2025
4296f1d
Add cocotb check for verifying huffman codes
rw1nkler Jul 18, 2025
904a651
modules: zstd: cocotb: drop unused testcase
rw1nkler Sep 10, 2025
7073d51
modules: zstd: disable huffman code builder PnR
rw1nkler Sep 10, 2025
047ce03
modules: zstd: fix formatting
rw1nkler Sep 10, 2025
73f4ea8
Update python lock file
rw1nkler Sep 19, 2025
30b753e
modules: zstd: cocotb: update signal names
rw1nkler Sep 2, 2025
02c76dd
modules: zstd: cocotb: refactor tests environment
sgizler Jul 30, 2025
e2e831a
modules: zstd: cocotb: add zstd cli
sgizler Jul 30, 2025
92ceaba
modules: zstd: rtl: fix default ADDR_WIDTH computation
sgizler Jul 30, 2025
2ece3ae
modules: zstd: add verilator dependency
sgizler Jul 30, 2025
dbd0252
modules: zstd: dslx: huffman code builder: encode -> highbit
magancarz Dec 29, 2025
e9928b5
modules: zstd: dslx: fix second-to-last weight handling in huffman we…
magancarz Dec 29, 2025
9b82981
modules: zstd: fse table creator: report start request
wsipak Aug 22, 2025
711e548
modules: zstd: fse table creator: fix order of token to shorten depen…
wsipak Aug 22, 2025
2f0e1ac
modules: zstd: cocotb: report work time for various components
wsipak Aug 22, 2025
3cc2c62
modules: zstd: cocotb: update signal names
rw1nkler Sep 2, 2025
4948aa6
modules: zstd: update test files with max window size of 61440
magancarz Sep 5, 2025
bfe1481
modules: zstd: add patch for specifying max window log for decodecorp…
magancarz Sep 5, 2025
cd9d365
modules: zstd: cocotb: add an early check for required window size
magancarz Sep 3, 2025
a4f0bd4
modules: zstd: cocotb: enable SystemVerilog asserts in zstd_dec_cocot…
sgizler Jul 14, 2025
af76a71
modules: zstd: dec mux: bump MAX_ID
sgizler Sep 12, 2025
27c0a36
modules: zstd: cocotb: use zstd_dec_cocotb_common in zstd_dec_cocotb_…
sgizler Sep 5, 2025
ceee081
modules: zstd: cocotb: fail decoder test early on first mismatch
sgizler Sep 2, 2025
392a737
modules: zstd: cocotb: fail early on decoder errors
sgizler Sep 3, 2025
79c5b20
modules: zstd: use a history buffer size directly for the frame heade…
sgizler Sep 4, 2025
7214931
modules: zstd: dslx tests: check Csr status for errors
magancarz Sep 16, 2025
18f5b6c
modules: zstd: dslx tests: add e2e test for unsupported window size
magancarz Sep 16, 2025
a26f4ca
modules: zstd: cocotb: add separate testing routine for expecting err…
magancarz Sep 16, 2025
49b6003
modules: zstd: cocotb: add script for analyzing failing decoder testc…
magancarz Sep 16, 2025
3769ce8
modules: zstd: cocotb: extract FseTableRecord
wsipak Sep 23, 2025
1637218
modules: zstd: cocotb: add detailed cocotb test
rw1nkler Sep 24, 2025
15f0aea
modules: zstd: cocotb: add verbose assert
wsipak Sep 30, 2025
11924f7
modules: zstd: cocotb: fix name of data signal after codegen args wer…
wsipak Oct 1, 2025
f28568c
modules: zstd: bump verilator dependency
sgizler Aug 25, 2025
d56a9c7
modules: zstd: cocotb: run verilator on a single thread
sgizler Aug 25, 2025
e985861
modules: zstd: cocotb: don't make unused signals public
sgizler Aug 25, 2025
603a7a1
modules: zstd: huffman literals dec: fix broken raw huffman weights o…
sgizler Sep 16, 2025
558b85a
modules: zstd: huffman weights dec: fix broken tree_description_size …
sgizler Sep 17, 2025
1d38b0c
modules: zstd: huffman weights dec: fix bad insertion position of las…
sgizler Sep 18, 2025
cd8d923
modules: zstd: huffman weights dec: test weight decoding bugfixes
sgizler Sep 24, 2025
297ecfb
modules: zstd: fse table decoder: fix handling last read bit if it is…
magancarz Oct 6, 2025
4b7594e
modules: zstd: rtl: ram_1r1w: fix handling of simultaneous read and w…
wsipak Oct 10, 2025
c95e9fe
modules: zstd: huffman ctrl: omit building new codes when decoding tr…
magancarz Oct 9, 2025
0770058
modules: zstd: cocotb: print correct packet values less often
magancarz Oct 16, 2025
9bbcc7b
modules: zstd: huffman weights dec: remove duplicate call
magancarz Oct 13, 2025
a464972
modules: zstd: huffman weights dec: add more test cases for raw weights
magancarz Oct 13, 2025
ccd52c5
modules: zstd: huffman weights dec: send last raw weight in the next …
magancarz Oct 13, 2025
b42afce
modules: zstd: performance: add generating a throughput benchmark
magancarz Oct 17, 2025
e69c28b
modules: zstd: sequence executor: fix clearing current history buffer…
magancarz Oct 31, 2025
9d67da9
modules: zstd: remove outdated/commented code
rw1nkler Dec 17, 2025
355fc0a
modules: zstd: update README
rw1nkler Dec 18, 2025
6fbfeb4
modules: zstd: fix errors after rebase
magancarz Dec 23, 2025
a2eded8
modules: zstd: cocotb: update deps to python 3.12
magancarz Dec 23, 2025
1d3a2d7
dependencies: update python lock file
magancarz Dec 31, 2025
12fe66f
examples: ram: make 2RW ram proc public
magancarz Dec 18, 2025
71c2dcd
modules: zstd: sequence executor: rewrite seq exec architecture
magancarz Nov 13, 2025
b345c56
modules: zstd: fix parametrizing AXI bus width
magancarz Dec 9, 2025
5a55abf
modules: zstd: set worst case throughput to 5
magancarz Dec 9, 2025
412ca7f
passes: check if a node is tracked before getting info
magancarz Dec 29, 2025
4556f66
modules/zstd: Add HashTable implementation
m-torhan Nov 25, 2024
544b7c8
modules/zstd: Add HistoryBuffer implementation
m-torhan Nov 25, 2024
47106c7
modules/zstd: Add Match Finder
m-torhan Dec 31, 2024
cc678f8
modules/zstd: Add a simple LiteralsEncoder
rw1nkler Feb 5, 2025
c1dba06
modules/zstd: Add sequence header encoder
rw1nkler Sep 17, 2025
c481fe3
modules/zstd: Add BlockHeaderWriter
wsipak Mar 10, 2025
17d962a
modules/zstd: extract LiteralsEncoderRaw to a separate file
wsipak Mar 17, 2025
16e56bf
modules/zstd/memory: Add AxiRamWriter
rw1nkler Sep 17, 2025
7e9b2e0
modules/zstd: Send "last" response in mem_reader_mux, mem_reader_simp…
rw1nkler Sep 17, 2025
97b0877
modules/zstd: Add codegen & benchmark to memory connection blocks
rw1nkler Sep 17, 2025
b200553
modules/zstd: Add FrameHeaderEncoder
sgizler Mar 11, 2025
67ac2a0
modules/zstd: Add basic zstd encoder
rw1nkler Mar 26, 2025
3cf049c
modules/zstd: Add DSLX tests for zstd encoder
wsipak Mar 26, 2025
6adf348
modules/zstd: Improve error handling in RawMemcopy
rw1nkler Mar 26, 2025
a3d52cc
modules/zstd: Make structs from block header file public
rw1nkler Mar 26, 2025
8631446
modules/zstd/memory: Move proc-local const outside AxiRamWriter proc
rw1nkler Mar 26, 2025
434111b
modules/zstd: Fix codegen in MatchFinder by making conditions mutuall…
rw1nkler Mar 27, 2025
a9987ec
modules/zstd: Add codegen & benchmarks to zstd encoder
rw1nkler Mar 27, 2025
46c98f5
modules/zstd: Adjust the design after a rebase
rw1nkler Apr 25, 2025
bf235b8
modules/zstd: Comment-out failing match finder test
rw1nkler Apr 25, 2025
065104c
modules/zstd: Create cocotb AxiRam from array
rw1nkler Apr 29, 2025
704f172
modules/zstd: Add cocotb simulation for zstd encoder
rw1nkler Apr 29, 2025
82888cf
modules/zstd: Bump fifo depth in memory blocks
rw1nkler Apr 29, 2025
53833aa
modules/zstd: Add RLE_Block encoder
rw1nkler Apr 3, 2025
28bb8a5
modules/zstd: Add block size calculation
wsipak Apr 4, 2025
bc9e508
modules/zstd: Improve match finder
rw1nkler Mar 27, 2025
6aaf9d7
modules/zstd: Add verilog match finder benchmark
rw1nkler Apr 16, 2025
4808e67
modules/zstd: Move common axi bus connecting to utils
rw1nkler May 5, 2025
ee7df2f
modules/zstd/memory: Add MemWriterDownscaler
rw1nkler Mar 21, 2025
e75cea7
modules/zstd: Improve FrameHeaderEncoder implementation
rw1nkler Mar 25, 2025
bb51d4b
modules/zstd: Remove excess logs from axi_ram reader and writer
rw1nkler Apr 29, 2025
a391821
modules/zstd: Integrate rle block encoder with the whole encoder
rw1nkler Jul 23, 2025
94bc6eb
modules/zstd: Add tests for RLE block
rw1nkler Jul 23, 2025
69b50ab
modules/zstd: Decrease memcpy die utilization percentage
rw1nkler Jul 28, 2025
db7ab84
modules/zstd: Improve match finder
rw1nkler Aug 4, 2025
972bc3c
modules/zstd: Skip sampling for small data in RleBlockEncoder
wsipak Aug 6, 2025
df56f14
modules/zstd: Fix size checks in LiteralSectionHeaderWriter
wsipak Aug 8, 2025
163e0e6
modules/zstd: Add RleBlockEncoder as dependency of LiteralsEncoder
sgizler Aug 5, 2025
3541088
modules/zstd: Enable RLE in LiteralsEncoder
wsipak Aug 8, 2025
5263c13
modules/zstd/memory: Add implementation of memory blocks without FSMs
rw1nkler Apr 30, 2025
ca6cafb
modules/zstd/memory: Add targets for comparing FSM and no-FSM impleme…
rw1nkler Sep 10, 2025
ab15fc7
modules/zstd/memory: Remove mem_reader_adv_no_fsm_fixed cocotb test
rw1nkler Sep 11, 2025
e19ba00
modules/zstd/memory: Remove unused signals from mem_writter_wrapper.v
rw1nkler Sep 12, 2025
196da3e
modules/zstd: Add MemReaderDataUpscaler
rw1nkler Aug 11, 2025
e913979
modules/zstd: Update match finder
rw1nkler Aug 11, 2025
476dc6b
modules/zstd: Add Sequence Encoder
rw1nkler Jul 23, 2025
173a618
modules/zstd: sequence encoder data upscaling, bytes written info
rw1nkler Aug 11, 2025
05d8240
modules/zstd: propagade header length in SequenceHeaderWriter
rw1nkler Aug 11, 2025
11d8236
modules/zstd: Add missing fifo sizes and pubs to LiteralsEncoder
rw1nkler Aug 11, 2025
6c45b41
modules/zstd: Add CompressBlockEncoder
rw1nkler Aug 11, 2025
9cc37ee
modules/zstd: Integrate CompressBlockEncoder with the whole encoder
rw1nkler Aug 11, 2025
071ae34
modules/zstd: Add compressed blocks minimal test
rw1nkler Aug 11, 2025
8b9ecb3
modules/zstd: Add minor fixes for verilog simulation
rw1nkler Aug 11, 2025
42dac4d
modules/zstd: Add compressed block test
rw1nkler Aug 11, 2025
2a72d2b
modules/zstd: Update encoder wrapper
rw1nkler Aug 11, 2025
3dd9639
modules/zstd: Add default fse tables
rw1nkler Aug 12, 2025
94a429e
modules/zstd: Make sequence header conform to latest rfc
rw1nkler Aug 12, 2025
6ffb19c
modules/zstd: handle corner-cases and race conditions in match finder
rw1nkler Aug 12, 2025
effb0ec
modules/zstd: Add frame comparison and bigger input data to the encod…
rw1nkler Aug 12, 2025
f7a824b
modules/zstd: Add PnR to sequence encoder buffer
rw1nkler Aug 14, 2025
29d17c5
modules/zstd: Add sequence encoder buffer tests
rw1nkler Aug 14, 2025
3fe3a8c
modules/zstd: Improve match finder and sequence encoder
rw1nkler Aug 14, 2025
b6f9d0c
modules/zstd: Add more cocotb testcases for compressed blocks
rw1nkler Aug 14, 2025
52958f5
modules/zstd: Improve compressed block handling
rw1nkler Aug 14, 2025
32f9805
modules/zstd: handle block size > frame content size in frame header …
rw1nkler Aug 19, 2025
520e43e
modules/zstd: Improve formatting in upscaler and comp_block_enc
rw1nkler Aug 26, 2025
c5ccff0
modules/zstd: Bump WCT for MatchFinder codegen
rw1nkler Aug 26, 2025
7c6f5d0
modules/zstd: Fix unit tests for sequence header and encoder
rw1nkler Aug 26, 2025
7dfa2c1
modules/zstd: Adjust interface of CompressBlockDecoder
rw1nkler Sep 15, 2025
a7ac0c6
modules/zstd: Move block_size implementation to the main zstd directory
rw1nkler Sep 16, 2025
0930a37
modules/zstd: Return compressed file size from the encoder
rw1nkler Sep 17, 2025
e7014ce
modules/zstd: Add helpers for huffman encoding
Jul 23, 2025
90874ec
modules/zstd: Adjustments after a rebase
rw1nkler Jan 5, 2026
e03f05a
modules/zstd: Update README
rw1nkler Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/modules-zstd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
- name: Test ZSTD Module - DSLX Tests (opt)
if: ${{ !cancelled() }}
run: |
bazel test -c opt --test_output=errors -- $(bazel query 'filter("_dslx_test$", kind(rule, //xls/modules/zstd/...))')
bazel test -c opt --test_output=errors -- $(bazel query 'filter("_dslx_test$", kind(rule, //xls/modules/zstd/...)) except filter("zstd_dec_dslx_test$", kind(rule, //xls/modules/zstd/...))');
# Run all tests except those ending with `_skip`
bazel test -c opt --test_strategy=exclusive --test_output=errors --test_filter='^([^_]|_([^s]|$)|_s([^k]|$)|_sk([^i]|$)|_ski([^p]|$))*$' //xls/modules/zstd:zstd_dec_dslx_test;

- name: Build ZSTD verilog targets (opt)
if: ${{ !cancelled() }}
Expand Down
4 changes: 4 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,7 @@ git_override(
)

register_toolchains("//xls/common/toolchains:all")

# Verilator support
bazel_dep(name = "aspect_bazel_lib", version = "2.19.4")
bazel_dep(name = "rules_perl", version = "0.4.2")
192 changes: 108 additions & 84 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Needed to make this a package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2025 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@xls_pip_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

exports_files(
glob(["rtl/*.v"]),
)

py_binary(
name = "axi_crossbar_wrap",
srcs = ["rtl/axi_crossbar_wrap.py"],
deps = [requirement("Jinja2")],
)

py_binary(
name = "axi_interconnect_wrap",
srcs = ["rtl/axi_interconnect_wrap.py"],
deps = [requirement("Jinja2")],
)

py_binary(
name = "axil_crossbar_wrap",
srcs = ["rtl/axi_crossbar_wrap.py"],
deps = [requirement("Jinja2")],
)

py_binary(
name = "axil_interconnect_wrap",
srcs = ["rtl/axil_interconnect_wrap.py"],
deps = [requirement("Jinja2")],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From c052badd17fdb6751f3b5820ab6f7eab0cab196e Mon Sep 17 00:00:00 2001
From: Mateusz Gancarz <mgancarz@antmicro.com>
Date: Fri, 5 Sep 2025 11:11:34 +0200
Subject: [PATCH] decodecorpus: allow specifying max window log

---
tests/decodecorpus.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c
index f25e5dc7..085f7be2 100644
--- a/tests/decodecorpus.c
+++ b/tests/decodecorpus.c
@@ -163,6 +163,7 @@ static double RAND_exp(U32* seed, double mean)
const char* BLOCK_TYPES[] = {"raw", "rle", "compressed"};

#define MAX_DECOMPRESSED_SIZE_LOG 20
+#define MIN_WINDOW_LOG 10
#define MAX_DECOMPRESSED_SIZE (1ULL << MAX_DECOMPRESSED_SIZE_LOG)

#define MAX_WINDOW_LOG 22 /* Recommended support is 8MB, so limit to 4MB + mantissa */
@@ -257,6 +258,7 @@ typedef enum {
* Global variables (set from command line)
*********************************************************/
U32 g_maxDecompressedSizeLog = MAX_DECOMPRESSED_SIZE_LOG; /* <= 20 */
+U32 g_maxWindowLog = MAX_WINDOW_LOG; /* 10 <= window log <= 22 */
U32 g_maxBlockSize = ZSTD_BLOCKSIZE_MAX; /* <= 128 KB */

/*-*******************************************************
@@ -289,7 +291,7 @@ static void writeFrameHeader(U32* seed, frame_t* frame, dictInfo info)
/* generate window size */
{
/* Follow window algorithm from specification */
- int const exponent = RAND(seed) % (MAX_WINDOW_LOG - 10);
+ int const exponent = g_maxWindowLog > 10 ? RAND(seed) % (g_maxWindowLog - 10) : 0;
int const mantissa = RAND(seed) % 8;
windowByte = (BYTE) ((exponent << 3) | mantissa);
fh.windowSize = (1U << (exponent + 10));
@@ -1231,7 +1233,7 @@ static U32 generateCompressedBlock(U32 seed, frame_t* frame, dictInfo info)
while (!blockWritten) {
size_t cSize;
/* generate window size */
- { int const exponent = RAND(&seed) % (MAX_WINDOW_LOG - 10);
+ { int const exponent = g_maxWindowLog > 10 ? RAND(&seed) % (g_maxWindowLog - 10) : 0;
int const mantissa = RAND(&seed) % 8;
frame->header.windowSize = (1U << (exponent + 10));
frame->header.windowSize += (frame->header.windowSize / 8) * mantissa;
@@ -1807,6 +1809,7 @@ static void advancedUsage(const char* programName)
DISPLAY( " --max-block-size-log=# : max block size log, must be in range [2, 17]\n");
DISPLAY( " --max-content-size-log=# : max content size log, must be <= 20\n");
DISPLAY( " (this is ignored with gen-blocks)\n");
+ DISPLAY( " --max-window-log=# : max window log, must be in range [10, 22]\n");
DISPLAY( " --block-type=# : force certain block type (raw=0, rle=1, compressed=2)\n");
DISPLAY( " --frame-header-only : dump only frame header\n");
DISPLAY( " --no-magic : do not add magic number\n");
@@ -1931,6 +1934,9 @@ int main(int argc, char** argv)
U32 value = readU32FromChar(&argument);
g_maxDecompressedSizeLog =
MIN(MAX_DECOMPRESSED_SIZE_LOG, value);
+ } else if (longCommandWArg(&argument, "max-window-log=")) {
+ U32 value = readU32FromChar(&argument);
+ g_maxWindowLog = MIN(MAX_WINDOW_LOG, MAX(MIN_WINDOW_LOG, value));
} else if (longCommandWArg(&argument, "block-type=")) {
U32 value = readU32FromChar(&argument);
opts.blockType = malloc(sizeof(blockType_e));
--
2.39.5

12 changes: 12 additions & 0 deletions dependency_support/load_external.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@ def load_external_repositories():
http_archive(
name = "zstd",
sha256 = "9ace5a1b3c477048c6e034fe88d2abb5d1402ced199cae8e9eef32fdc32204df",
patches = [
Label("@//dependency_support/com_github_facebook_zstd:allow-specifying-max-window-log.patch"),
],
patch_args = ["-p1"],
strip_prefix = "zstd-fdfb2aff39dc498372d8c9e5f2330b692fea9794",
urls = ["https://github.com/facebook/zstd/archive/fdfb2aff39dc498372d8c9e5f2330b692fea9794.zip"],
build_file = Label("//dependency_support/com_github_facebook_zstd:bundled.BUILD.bazel"),
)

http_archive(
name = "com_github_alexforencich_verilog_axi",
sha256 = "f3b58406b51950584cc7b0c67b0710cef10cb14e1f5576e97a2f0b1c0b12fcbe",
strip_prefix = "verilog-axi-516bd5dadc3365b7f9e225d2af8fe0b8d804fe53",
urls = ["https://github.com/alexforencich/verilog-axi/archive/516bd5dadc3365b7f9e225d2af8fe0b8d804fe53.zip"],
build_file = "//dependency_support/com_github_alexforencich_verilog_axi:bundled.BUILD.bazel",
)
10 changes: 10 additions & 0 deletions dependency_support/pip_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ pyyaml==6.0.1
# We build most of z3 ourselves but building python is really complicated. Just
# use pypi version
z3-solver==4.14.0.0
pytest==8.2.2
cocotb==1.9.0
cocotbext-axi==0.1.24
cocotb_bus==0.2.1

# Note: numpy and scipy version availability seems to differ between Ubuntu
# versions that we want to support (e.g. 18.04 vs 20.04), so we accept a
# range that makes successful installation on those platforms possible.
numpy>=1.21
scipy>=1.5.4,<=1.16.3
70 changes: 69 additions & 1 deletion dependency_support/pip_requirements_lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,56 @@ click==8.1.3 \
# via
# -r dependency_support/pip_requirements.in
# flask
cocotb==1.9.0 \
--hash=sha256:02a58ef6c941114964096e7c039bdd4e67e63816cfd2f6a9af6a34cd92b00e8e \
--hash=sha256:0819794ef5e8fd14fee0b265933226cf600e85edc2f1a749b4d5f8fa2d31ce4e \
--hash=sha256:0ba35617a677ff65a1273411a3dfdfc5f587128ad8cb9e941ab0eb17ec8fb3e2 \
--hash=sha256:17556e3a23562f64d577d0eb117fe02e384aedee997b29497b5c395f5010ff82 \
--hash=sha256:19b4e27b53a16e0b9c4cc5227c7f9d4dccac06e431a4f937e9f5513350196333 \
--hash=sha256:1a0381ced5590a726032ba2265c6b70ac12cfb49edb152be86a081bb7d104751 \
--hash=sha256:1aff68cf77059448a9a3278079037e34b50c8c2aee466d984295fa7fe699d390 \
--hash=sha256:277281420fd6fc3002bb85d6bec497bd20ff3a3905d4b5f1301faf975f750ede \
--hash=sha256:2daf743320331615f4e8ffb877ab0b04e6f913b911bb11bf9dbc1d876d9c4220 \
--hash=sha256:2e9bcdbfba3e99c9297bd0d74ba781772d89d2c86e893980784ada252bd1a0f8 \
--hash=sha256:3058c977f9d4e1f6333d505947f34b9142910719f1d8631c40a151dd86bad727 \
--hash=sha256:5832d894419a9e8fe5c242e3ac86588e16e2cb379822dcb154bfec8544ae858e \
--hash=sha256:598b841ed0809e5c64d8c383b8035f6ace5a6f9013f680cdc6981221911c005d \
--hash=sha256:5a5c91027d7652aaf10e101743edd6b1e832039a19af75fca301275ef30f01d4 \
--hash=sha256:61418f619af72c8cca8de622785b4f4bfc17ace09981de6eb44feae560cf3bbb \
--hash=sha256:784c914c8df3fd79cfb148d2bcd17c4b2703c89af1278ed98773afb57ceea3e6 \
--hash=sha256:87a19d3012f505ba7fda37483b851ef0ca40290ad8a9b28a820b84f8574287bb \
--hash=sha256:89503f0749362d36b6fab8636710f1848943c21f9d488672921bac21e9edd29f \
--hash=sha256:89e5189fd393918c27af2daefdcb13df4d52fa761f065d5964d2c4ff5c0642fb \
--hash=sha256:8cb4b0edf8f0b47c3b604b461cb574fc75fd97efa893cbaf828f4f2f71cf459e \
--hash=sha256:94e884e16186899ad5b4d131c3f7ff0a2277e67ea0660754e8810a4bbf2d610e \
--hash=sha256:997dbca2a2cd933fd0a44d9fadeebc1e8a40701db15ea06f207811933dceb350 \
--hash=sha256:a7cea13cb2fe4f5ca735490846342885117778a73008a67ed9cac667aaaf3f0d \
--hash=sha256:a84edfbfa57dc6e16845a55feb0b4e1c8b6bbfa5ef1ab6768beba8d81e0546aa \
--hash=sha256:a95b5e5708a3629d319d2b655d11345cc7e97fea9bdc9bc1df7435926ac30966 \
--hash=sha256:aa6818c39ca1ce699e4bb1d84899c4f98c2d25c7671bd6c7beee3b1ee9d68834 \
--hash=sha256:ab99bf7e055780b57419d4133fd4dca9c72a03b766a3e2200552f10498eb8845 \
--hash=sha256:b966f5560a494fd99f95a1562f9326ca20c35bb118d4e6b50db41da8e4a6f718 \
--hash=sha256:bc44a7708a5a63d3059a622c2fb90831dc33534c3343e971f5a6c78905097baa \
--hash=sha256:c11e21d291ba2f889e33c21d76e9aec6ffdfb5666053dc34452666579daa675b \
--hash=sha256:c848de13583478d71cc91e528e17c051ca6a3b92e89d703ac5015f17cab1287b \
--hash=sha256:d944aa5509a0f0786d6f30554a2f8b1f229847f9ac9988879d7a05497739f668 \
--hash=sha256:f50862153e1364f6edeaef9d70505093549fa097e9b2555ea46d1e4f94ac3287 \
--hash=sha256:f74c598e230e1035103f6e3a97dd7a0e1bcacf7f3ea7481cd3bcde477b74e379 \
--hash=sha256:fcb81c6c37e11b0729768dd8e192a9cfb809778699ab1fe89f4d92ba0beb3092 \
--hash=sha256:ff2ddc8b304eb7076ceead2534a1b9828df771798fa9c2601ea983c86d23ec08
# via
# -r dependency_support/pip_requirements.in
# cocotb-bus
# cocotbext-axi
cocotb-bus==0.2.1 \
--hash=sha256:a197aa4b0e0ad28469c8877b41b3fb2ec0206da9f491b9276d1578ce6dd8aa8d
# via
# -r dependency_support/pip_requirements.in
# cocotbext-axi
cocotbext-axi==0.1.24 \
--hash=sha256:3ed62dcaf9448833176826507c5bc5c346431c4846a731e409d87c862d960593 \
--hash=sha256:533ba6c7503c6302bdb9ef86e43a549ad5da876eafb1adce23d39751c54cced4
# via -r dependency_support/pip_requirements.in
contourpy==1.3.1 \
--hash=sha256:041b640d4ec01922083645a94bb3b2e777e6b626788f4095cf21abbe266413c1 \
--hash=sha256:05e806338bfeaa006acbdeba0ad681a10be63b26e1b17317bfac3c5d98f36cda \
Expand Down Expand Up @@ -74,6 +124,10 @@ cycler==0.12.1 \
--hash=sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30 \
--hash=sha256:88bb128f02ba341da8ef447245a9e138fae777f6a23943da4540077d3601eb1c
# via matplotlib
find-libpython==0.4.0 \
--hash=sha256:034a4253bd57da3408aefc59aeac1650150f6c1f42e10fdd31615cf1df0842e3 \
--hash=sha256:46f9cdcd397ddb563b2d7592ded3796a41c1df5222443bd9d981721c906c03e6
# via cocotb
flask==2.3.2 \
--hash=sha256:77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0 \
--hash=sha256:8c2f9abd47a9e8df7f0c3f091ce9497d011dc3b31effcf4c85a6e2b50f4114ef
Expand Down Expand Up @@ -130,6 +184,10 @@ fonttools==4.55.8 \
--hash=sha256:f089e8da0990cfe2d67e81d9cf581ff372b48dc5acf2782701844211cd1f0eb3 \
--hash=sha256:f971aa5f50c22dc4b63a891503624ae2c77330429b34ead32f23c2260c5618cd
# via matplotlib
iniconfig==2.3.0 \
--hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \
--hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12
# via pytest
itsdangerous==2.1.2 \
--hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \
--hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a
Expand Down Expand Up @@ -392,7 +450,9 @@ numpy==2.3.4 \
packaging==24.2 \
--hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \
--hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
# via matplotlib
# via
# matplotlib
# pytest
pillow==11.1.0 \
--hash=sha256:015c6e863faa4779251436db398ae75051469f7c903b043a48f078e437656f83 \
--hash=sha256:0a2f91f8a8b367e7a57c6e91cd25af510168091fb89ec5146003e424e1558a96 \
Expand Down Expand Up @@ -466,6 +526,10 @@ pillow==11.1.0 \
--hash=sha256:f86d3a7a9af5d826744fabf4afd15b9dfef44fe69a98541f666f66fbb8d3fef9 \
--hash=sha256:fbd43429d0d7ed6533b25fc993861b8fd512c42d04514a0dd6337fb3ccf22761
# via matplotlib
pluggy==1.6.0 \
--hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \
--hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746
# via pytest
portpicker==1.3.1 \
--hash=sha256:d2cdc776873635ed421315c4d22e63280042456bbfa07397817e687b142b9667
# via -r dependency_support/pip_requirements.in
Expand All @@ -486,6 +550,10 @@ pyparsing==3.2.1 \
--hash=sha256:506ff4f4386c4cec0590ec19e6302d3aedb992fdc02c761e90416f158dacf8e1 \
--hash=sha256:61980854fd66de3a90028d679a954d5f2623e83144b5afe5ee86f43d762e5f0a
# via matplotlib
pytest==8.2.2 \
--hash=sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343 \
--hash=sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977
# via -r dependency_support/pip_requirements.in
python-dateutil==2.9.0.post0 \
--hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \
--hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427
Expand Down
85 changes: 85 additions & 0 deletions dependency_support/rules_hdl/add_standalone_verilator.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
--- dependency_support/verilator/verilator.BUILD.bazel
+++ dependency_support/verilator/verilator.BUILD.bazel
@@ -13,6 +13,7 @@
# Original implementation by Kevin Kiningham (@kkiningh) in kkiningh/rules_verilator.
# Ported to bazel_rules_hdl by Stephen Tridgell (@stridge-cruxml)

+load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_hdl//dependency_support/com_github_westes_flex:flex.bzl", "genlex")
@@ -370,3 +371,74 @@
visibility = ["//visibility:public"],
deps = [":verilator_libV3"],
)
+
+genrule(
+ name = "verilated_makefile",
+ srcs = ["include/verilated.mk.in"],
+ outs = ["include/verilated.mk"],
+ cmd = """
+ cp "$(SRCS)" "$(OUTS)"
+ sed "s%@AR@%$(AR)%" "$(OUTS)" -i
+ sed "s%@CXX@%$(CC)%" "$(OUTS)" -i
+ sed "s%@LINK@%$(CC)%" "$(OUTS)" -i
+ sed "s%@PERL@%$(PERL)%" "$(OUTS)" -i
+ sed "s%@PYTHON3@%$(PYTHON3)%" "$(OUTS)" -i
+ sed "s%@OBJCACHE@%%" "$(OUTS)" -i
+
+ if [ "$(C_COMPILER)" = "clang" ]; then
+ # Compiler option to put in front of filename to read precompiled header
+ sed "s%@CFG_CXXFLAGS_PCH_I@%-include-pch%" "$(OUTS)" -i
+ # Compiler's filename suffix for precompiled headers, .gch if clang, empty if GCC
+ sed "s%@CFG_GCH_IF_CLANG@%.gch%" "$(OUTS)" -i
+ else
+ sed "s%@CFG_CXXFLAGS_PCH_I@%-include%" "$(OUTS)" -i
+ sed "s%@CFG_GCH_IF_CLANG@%%" "$(OUTS)" -i
+ fi
+
+ # Select language required to compile
+ sed "s%@CFG_CXXFLAGS_STD@%-x c++%" "$(OUTS)" -i
+ sed "s%@CFG_LDFLAGS_VERILATED@%-lstdc++%" "$(OUTS)" -i
+
+ # Compiler flags to use to turn off unused and generated code warnings, such as -Wno-div-by-zero "$(OUTS)" -i
+ sed "s%@CFG_CXXFLAGS_NO_UNUSED@%-faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-subobject-linkage -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable%" "$(OUTS)" -i
+ # Linker libraries for multithreading
+ sed "s%@CFG_LDLIBS_THREADS@%-pthread -lpthread -latomic%" "$(OUTS)" -i
+ """,
+ toolchains = [
+ "@bazel_tools//tools/cpp:current_cc_toolchain",
+ "@rules_python//python:current_py_toolchain",
+ "@rules_perl//:current_toolchain",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "includes",
+ srcs = glob(["include/**"]),
+)
+
+# The perl wrapper assumes that runtime resources are stored under $(realpath verilator)/../
+# using perl binary would be problematic due to symlinks
+# potential alternative solution: write simplified perl wrapper that does not depend on realpath
+copy_to_bin(
+ name = "verilator_runtime_extras",
+ srcs = [
+ "bin/verilator",
+ "bin/verilator_includer",
+ ":includes",
+ ],
+)
+
+filegroup(
+ name = "standalone_verilator",
+ srcs = [
+ ":verilated_config",
+ ":verilated_makefile",
+ ":verilator_executable",
+ ":verilator_runtime_extras",
+ "@bazel_tools//tools/cpp:current_cc_toolchain",
+ "@rules_perl//:current_toolchain",
+ "@rules_python//python:current_py_toolchain",
+ ],
+ visibility = ["//visibility:public"],
+)
Loading