-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMODULE.bazel
More file actions
743 lines (659 loc) · 35.6 KB
/
Copy pathMODULE.bazel
File metadata and controls
743 lines (659 loc) · 35.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
"""HighTide module — layered on top of bazel-orfs (pinned via submodule).
bazel-orfs lives at ./bazel-orfs as a git submodule. Most Bazel
settings (dep versions, patches, ORFS/OpenROAD/Qt commits) come from
bazel-orfs's own MODULE.bazel; we re-declare the overrides at the
root because git_override / archive_override / single_version_override
and register_toolchains are only honored in the root module, and we
reference patch files from the submodule (via //patches symlinks) to
avoid duplication.
Keep these root-only overrides in sync with bazel-orfs/MODULE.bazel
whenever the submodule is bumped (current pin: 6c1bbca).
HighTide-specific additions on top:
- yosys-slang plugin built from source and merged into yosys_share
- LLVM 20.1.8 toolchain for OpenROAD's C++20 source build
- Python 3.13 toolchain for bazel-orfs's pip deps
"""
module(
name = "hightide",
version = "0.0.1",
)
# --- bazel-orfs pinned via submodule ---
bazel_dep(name = "bazel-orfs")
local_path_override(
module_name = "bazel-orfs",
path = "bazel-orfs",
)
bazel_dep(name = "bazel-orfs-verilog")
local_path_override(
module_name = "bazel-orfs-verilog",
path = "bazel-orfs/verilog",
)
# --- Non-BCR deps required by bazel-orfs (overrides are root-only) ---
# Commits + patch sets mirror bazel-orfs/MODULE.bazel at the pinned
# submodule commit. Keep in sync when bumping the submodule.
#
# patches/ holds symlinks into bazel-orfs/patches/ (bazel's
# *_override only accepts patch labels from the root repo).
bazel_dep(name = "abc", version = "0.64-yosyshq.bcr.1")
bazel_dep(name = "yosys", version = "0.64")
bazel_dep(name = "orfs")
# Pinned via archive_override (HTTPS tarball) rather than git_override so
# bzlmod resolution works in environments where git access to ORFS is
# blocked. Mirrors bazel-orfs/MODULE.bazel.
archive_override(
module_name = "orfs",
integrity = "sha256-kzOoZooVzsWKOVKIOQszWV8EJCGV8tBzUl0DBIBVaWc=",
patch_strip = 1,
patches = [
"//patches:0036-fix-bazel-orfs-bazel_dep-non-dev-for-load-visibility.patch",
],
strip_prefix = "OpenROAD-flow-scripts-fb65d5b487d2afd443fc1892330f622c776a57ac",
urls = ["https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/archive/fb65d5b487d2afd443fc1892330f622c776a57ac.tar.gz"],
)
bazel_dep(name = "openroad")
archive_override(
module_name = "openroad",
integrity = "sha256-011veekekQGPjuDtDyxBsYmW7JkC6T2PqNhlCK7hCDk=",
# GitHub /archive/<sha>.tar.gz tarballs don't carry submodules,
# so vendor src/sta (OpenSTA) and third-party/abc from their own
# GitHub auto-archives at the SHAs OpenROAD's .gitmodules pins to.
patch_cmds = [
"curl -sSfL --retry 5 --retry-all-errors --retry-delay 5 -o .openroad-submodule-src-sta-8572175ac45c42ce8d3d772f73bbb059786b9c66.tar.gz https://github.com/The-OpenROAD-Project/OpenSTA/archive/8572175ac45c42ce8d3d772f73bbb059786b9c66.tar.gz && echo '805fbf8fef8ff35bc03e1d7fc3eb15760f886a4735e9c96adec303904b5d7d3e .openroad-submodule-src-sta-8572175ac45c42ce8d3d772f73bbb059786b9c66.tar.gz' | sha256sum -c - && tar xzf .openroad-submodule-src-sta-8572175ac45c42ce8d3d772f73bbb059786b9c66.tar.gz --strip-components=1 -C src/sta && rm .openroad-submodule-src-sta-8572175ac45c42ce8d3d772f73bbb059786b9c66.tar.gz",
"curl -sSfL --retry 5 --retry-all-errors --retry-delay 5 -o .openroad-submodule-third-party-abc-d527cfab4ad731b767ea0a2be2021d920d3afece.tar.gz https://github.com/The-OpenROAD-Project/abc/archive/d527cfab4ad731b767ea0a2be2021d920d3afece.tar.gz && echo '0cbf538e60d0303d0e00360d8973aaad7dae198954bed6e34cc31c9a13b3f802 .openroad-submodule-third-party-abc-d527cfab4ad731b767ea0a2be2021d920d3afece.tar.gz' | sha256sum -c - && tar xzf .openroad-submodule-third-party-abc-d527cfab4ad731b767ea0a2be2021d920d3afece.tar.gz --strip-components=1 -C third-party/abc && rm .openroad-submodule-third-party-abc-d527cfab4ad731b767ea0a2be2021d920d3afece.tar.gz",
"curl -sSfL --retry 5 --retry-all-errors --retry-delay 5 -o .openroad-submodule-third-party-slang-elab-82effc8d9541be69e1ed3ec44759a4449f5d9247.tar.gz https://github.com/povik/yosys-slang/archive/82effc8d9541be69e1ed3ec44759a4449f5d9247.tar.gz && echo 'ea31b4a205ebb1fe5ec3789bcd66f21f4975e73c0901622af667f843b833ff10 .openroad-submodule-third-party-slang-elab-82effc8d9541be69e1ed3ec44759a4449f5d9247.tar.gz' | sha256sum -c - && tar xzf .openroad-submodule-third-party-slang-elab-82effc8d9541be69e1ed3ec44759a4449f5d9247.tar.gz --strip-components=1 -C third-party/slang-elab && rm .openroad-submodule-third-party-slang-elab-82effc8d9541be69e1ed3ec44759a4449f5d9247.tar.gz",
"sed -i 's|\"@slang\"|\"@sv-lang//:libsvlang\"|' third-party/slang-elab/src/BUILD",
],
strip_prefix = "OpenROAD-b65c274cadefe2151aa7eee32e1be9026e8ff14a",
urls = ["https://github.com/The-OpenROAD-Project/OpenROAD/archive/b65c274cadefe2151aa7eee32e1be9026e8ff14a.tar.gz"],
)
# OpenROAD pins sv-lang 10.0.bcr.2, which is not yet published in BCR.
# Force the latest published version (fork registry, via .bazelrc).
single_version_override(
module_name = "sv-lang",
version = "10.0.1-20260316-f04e8156",
)
# The fork sv-lang pulls boost.unordered@1.87.0 (old compat_level 108700)
# while OpenROAD pins all boost.* at 1.89.0.bcr.2 (compat_level 0) — MVS
# can't reconcile differing compat levels, so force the OpenROAD version.
# (Root-only override; OpenROAD/sv-lang can't apply it as non-root deps.)
single_version_override(
module_name = "boost.unordered",
version = "1.89.0.bcr.2",
)
# scip 9.2.3 vendors a tinycthread that collides with glibc 2.41+'s
# <threads.h>. 9.2.3.bcr.1 carries the upstream rename fix (fork registry).
single_version_override(
module_name = "scip",
version = "9.2.3.bcr.1",
)
# sed-4.9 gnulib lib/memchr.c fails to compile on glibc 2.41+; force the
# `# undef memchr` to run unconditionally.
single_version_override(
module_name = "sed",
patch_cmds = [
"sed -i 's|^#ifdef _LIBC$|#if 1|' lib/memchr.c",
],
version = "4.9.bcr.5",
)
# sv-lang pulls in rules_pycross, whose toolchain extension fails on Python
# 3.8. pycross.configure_environments is root-honored only.
bazel_dep(name = "rules_pycross", version = "0.8.1")
pycross = use_extension("@rules_pycross//pycross/extensions:pycross.bzl", "pycross")
pycross.configure_environments(python_versions = ["3.13"])
bazel_dep(name = "qt-bazel")
git_override(
module_name = "qt-bazel",
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
)
# --- Yosys (BCR) — 0.64 needs no patches (visibility/hdrs/tcl9 upstreamed);
# declared as a bazel_dep near the top with abc. ---
bazel_dep(name = "glpk", version = "5.0.bcr.4")
# Pulled transitively: or-tools@9.15 → soplex@7.1.4.bcr.1 pins
# boost.multiprecision / boost.serialization at 1.87.0, but openroad → boost.*
# wants 1.89.0.bcr.2. soplex@7.1.4.bcr.3 rebuilt against the newer boost.
single_version_override(
module_name = "soplex",
version = "7.1.4.bcr.3",
)
# --- LLVM toolchain (OpenROAD needs C++20 / libc++) ---
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
llvm = use_extension(
"@toolchains_llvm//toolchain/extensions:llvm.bzl",
"llvm",
)
llvm.toolchain(
llvm_version = "20.1.8",
)
use_repo(llvm, "llvm_toolchain")
register_toolchains(
"@llvm_toolchain//:all",
)
# --- Python 3.13 toolchain ---
bazel_dep(name = "rules_python", version = "1.9.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.13",
)
# --- yosys-slang plugin (built from source) ---
yosys_slang = use_extension("//:yosys_slang.bzl", "yosys_slang")
use_repo(yosys_slang, "yosys-slang")
# --- ORFS extension: merged yosys_share with slang plugin ---
orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
orfs.default(
yosys_share = "//:yosys_share_with_slang",
)
# --- HighTide design RTL sources (hermetic http_archive, gallery-style) ---
# Upstream RTL is fetched by Bazel from pinned GitHub archives — no git
# submodules, no vendored copies. Each design exposes an :rtl filegroup
# via its external.BUILD.bazel; source fixes (when needed) are declarative
# `patches = [...]`. The design's designs/src/<d>/BUILD.bazel carries a
# thin `:rtl` alias so consumer labels (//designs/src/<d>:rtl) are stable.
#
# Caveat: GitHub /archive/<sha>.tar.gz gzip is not guaranteed byte-stable;
# if a fetch ever fails on integrity, re-pin the sha256 (same failure mode
# and fix as the OpenROAD submodule tarballs pinned above).
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# lfsr — alexforencich/verilog-lfsr (plain Verilog, no generator/patch)
http_archive(
name = "lfsr_src",
build_file = "//designs/src/lfsr:external.BUILD.bazel",
sha256 = "fbb63239c7b4597bf78d0700bf4d19c2ec81944207b6b79f6b414f5cd0b62266",
strip_prefix = "verilog-lfsr-c1f86d036745935f3812ec6ddc7821c70ef4c9de",
urls = ["https://github.com/alexforencich/verilog-lfsr/archive/c1f86d036745935f3812ec6ddc7821c70ef4c9de.tar.gz"],
)
# --- LiteX generator toolchain (shared by litedram/liteeth/litepci) ---
# migen -> litex -> litedram/liteeth/litepci packages fetched as source
# archives and exposed as py_library (gallery pymtl3 pattern); their PyPI
# leaf deps come from the pip_litex hub below. The generator runs under
# Bazel (py_binary), so no venv / setup.sh / build-time pip install.
http_archive(
name = "migen_src",
build_file = "//designs/src/litedram:migen.BUILD.bazel",
sha256 = "2376271b44c05f1b7666b7bfbcd409cdb39995f34aec72f8b6c32ddf828dac79",
strip_prefix = "migen-4c2ae8dfeea37f235b52acb8166f12acaaae4f7c",
urls = ["https://github.com/m-labs/migen/archive/4c2ae8dfeea37f235b52acb8166f12acaaae4f7c.tar.gz"],
)
http_archive(
name = "litex_src",
build_file = "//designs/src/litedram:litex.BUILD.bazel",
sha256 = "2ec281a5ab713eb48abdf247e41946cd5d32fa102ac1eed1fe4c129c538ed257",
strip_prefix = "litex-a25eeecd27309b2a04a9cf74a1d4849e38ff2090",
urls = ["https://github.com/enjoy-digital/litex/archive/a25eeecd27309b2a04a9cf74a1d4849e38ff2090.tar.gz"],
)
http_archive(
name = "litedram_src",
build_file = "//designs/src/litedram:litedram.BUILD.bazel",
sha256 = "6be2d3cccd32bf98ff136773011e501ffa8bf432e5221148e5509b1145756c28",
strip_prefix = "litedram-c7bcb5dc0b8212b1a25de267c0fc0e5ad47029f0",
urls = ["https://github.com/enjoy-digital/litedram/archive/c7bcb5dc0b8212b1a25de267c0fc0e5ad47029f0.tar.gz"],
)
# liteeth pinned at the SHA setup.sh pip-installed (ef5f9ee0), which is the
# package `import liteeth` actually resolved to during generation — not the
# dev/repo submodule gitlink (883f3a4b, which only supplied the gen.py entry).
http_archive(
name = "liteeth_src",
build_file = "//designs/src/liteeth:liteeth.BUILD.bazel",
sha256 = "426140eb5ff67010486e2004ee440ea38d94b43e18af4ef031cf93335e7e53f8",
strip_prefix = "liteeth-ef5f9ee0cbf1fb4afe0a23a68367c17e95ffb162",
urls = ["https://github.com/enjoy-digital/liteeth/archive/ef5f9ee0cbf1fb4afe0a23a68367c17e95ffb162.tar.gz"],
)
# liteiclink — required by liteeth's USP_GTH_1000BASEX PHY (GTHChannelPLL).
http_archive(
name = "liteiclink_src",
build_file = "//designs/src/liteeth:liteiclink.BUILD.bazel",
sha256 = "f1fbc023bd5b7d01eebb1ffe2badb35fd2ba922bc97d1e59ba4d240200df3a9e",
strip_prefix = "liteiclink-ef9c29506c9c8e5d733a54403c6a9ec1df5babd5",
urls = ["https://github.com/enjoy-digital/liteiclink/archive/ef9c29506c9c8e5d733a54403c6a9ec1df5babd5.tar.gz"],
)
# --- FlooNoC network-on-chip + its PULP bender dependencies ---
# The narrow-wide mesh is assembled from pinned upstream archives instead of
# running bender: FlooNoC itself plus the seven dependency repos it pulls, each
# at its Bender.lock revision. FlooGen (bundled in @floonoc_src) generates the
# mesh topology under Bazel; its PyPI deps come from the pip_floogen hub below.
# The seven PULP deps share one injected build_file (pulp_dep.BUILD.bazel).
http_archive(
name = "floonoc_src",
build_file = "//designs/src/floonoc:floonoc_src.BUILD.bazel",
sha256 = "57d8960374c55ace2a0ff9afc2a7e919b307251cf3e38e99f53d6bd059a2266e",
strip_prefix = "FlooNoC-064df1651f3d870cf4774c8c7d7439984bfb11d1",
urls = ["https://github.com/pulp-platform/FlooNoC/archive/064df1651f3d870cf4774c8c7d7439984bfb11d1.tar.gz"],
)
http_archive(
name = "pulp_apb_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "921cc1546cbb9311d0fc1dc05efb26511871d1272dd468f4904d4d220817bb3a",
strip_prefix = "apb-77ddf073f194d44b9119949d2421be59789e69ae",
urls = ["https://github.com/pulp-platform/apb/archive/77ddf073f194d44b9119949d2421be59789e69ae.tar.gz"],
)
http_archive(
name = "pulp_axi_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "0cd034d0162a441eb98df7731840b49152009310481909edae26a74a6e549ab7",
strip_prefix = "axi-a256a3b86394fedf19e361047fccfdd7f6ef83e4",
urls = ["https://github.com/pulp-platform/axi/archive/a256a3b86394fedf19e361047fccfdd7f6ef83e4.tar.gz"],
)
http_archive(
name = "pulp_axi_stream_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "05f084e6dc0eee14f1c93af0361b9add40b59ae51bd73aadd832bf8758432c2e",
strip_prefix = "axi_stream-54891ff40455ca94a37641b9da4604647878cc07",
urls = ["https://github.com/pulp-platform/axi_stream/archive/54891ff40455ca94a37641b9da4604647878cc07.tar.gz"],
)
http_archive(
name = "pulp_common_cells_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "bfae706c79684ba4d005ce337a3a7d3a25cf64570c5ad73bae9d44feaf90b324",
strip_prefix = "common_cells-9ca8a7655f741e7dd5736669a20a301325194c28",
urls = ["https://github.com/pulp-platform/common_cells/archive/9ca8a7655f741e7dd5736669a20a301325194c28.tar.gz"],
)
http_archive(
name = "pulp_obi_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "3b5b78958ad3817e092a3050c2f23b72e813bc1410f08f19b0580c7f1ebc400a",
strip_prefix = "obi-0155fc34e900c7c884e081c0a1114a247937ff69",
urls = ["https://github.com/pulp-platform/obi/archive/0155fc34e900c7c884e081c0a1114a247937ff69.tar.gz"],
)
http_archive(
name = "pulp_register_interface_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "64fbbe94f5a985ef0a1a167d1f4996c9fcd230fb230b643a1ae12165335412b1",
strip_prefix = "register_interface-d6e1d4cdaab7870f4faf3f88a1c788eaf5ac129d",
urls = ["https://github.com/pulp-platform/register_interface/archive/d6e1d4cdaab7870f4faf3f88a1c788eaf5ac129d.tar.gz"],
)
http_archive(
name = "pulp_tech_cells_generic_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "771eca488cdd6bd1c96fe777cde862ed2389c29da31f99bfa079060b59c7c3a9",
strip_prefix = "tech_cells_generic-7968dd6e6180df2c644636bc6d2908a49f2190cf",
urls = ["https://github.com/pulp-platform/tech_cells_generic/archive/7968dd6e6180df2c644636bc6d2908a49f2190cf.tar.gz"],
)
# --- Snitch cluster + its additional PULP bender dependencies ---
# Reuses five of FlooNoC's archives at the same Bender.lock revisions (apb,
# axi_stream, obi, tech_cells_generic, register_interface). These ten are
# snitch-specific: the main repo, the colluca/axi fork + a different
# common_cells SHA than FlooNoC's (hence distinct @snitch_* names), and the
# six deps FlooNoC lists-but-excludes (fpnew/idma/... which snitch actually
# uses). clustergen (bundled in @snitch_cluster_src) generates the cluster
# wrapper/pkg; its PyPI deps come from the pip_clustergen hub below. All PULP
# deps share the floonoc pulp_dep.BUILD.bazel build file.
http_archive(
name = "snitch_cluster_src",
build_file = "//designs/src/snitch_cluster:snitch_cluster_src.BUILD.bazel",
sha256 = "30c3cbde1ca8adf2462bfb8af89281f0a154e3951607aba231303dda6a3e2380",
strip_prefix = "snitch_cluster-2fa38482c2c822bfbedfdfd87abb3ed45521646e",
urls = ["https://github.com/pulp-platform/snitch_cluster/archive/2fa38482c2c822bfbedfdfd87abb3ed45521646e.tar.gz"],
)
http_archive(
name = "snitch_axi_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "9cdea3404b48667e47814ac938424bab837598f4131c069e7bb5b80d5182d4ad",
strip_prefix = "axi-06410c36819924e32db2afa428d244dbdbcd5d4e",
urls = ["https://github.com/colluca/axi/archive/06410c36819924e32db2afa428d244dbdbcd5d4e.tar.gz"],
)
http_archive(
name = "snitch_common_cells_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "40a68b4f361d448ce0904d62475b38590d78f82a2e0b0bb92d5a03e6641bc443",
strip_prefix = "common_cells-ca9d577f2fbc45ec557ab4e0905bbfc154441540",
urls = ["https://github.com/pulp-platform/common_cells/archive/ca9d577f2fbc45ec557ab4e0905bbfc154441540.tar.gz"],
)
http_archive(
name = "pulp_axi_riscv_atomics_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "d1ebd479ad72af59d016829d216ff208e69d0332f414a5e3576c176b646bef53",
strip_prefix = "axi_riscv_atomics-0ac3a78fe342c5a5b9b10bff49d58897f773059e",
urls = ["https://github.com/pulp-platform/axi_riscv_atomics/archive/0ac3a78fe342c5a5b9b10bff49d58897f773059e.tar.gz"],
)
http_archive(
name = "pulp_cluster_icache_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "e0e088b2e4215e01d4d97d54cdf82c988284b0aaf92542a4e2656d2208eb5b1a",
strip_prefix = "cluster_icache-1642961b9561513f283674efc2c90f24855e8d39",
urls = ["https://github.com/pulp-platform/cluster_icache/archive/1642961b9561513f283674efc2c90f24855e8d39.tar.gz"],
)
http_archive(
name = "pulp_fpnew_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "d048ba21228e4ffa12d0bc1c1f6a61baab755422b765661c103c3cddf1c77671",
strip_prefix = "cvfpu-e5aa6a01b5bbe1675c3aa8872e1203413ded83d1",
urls = ["https://github.com/pulp-platform/cvfpu/archive/e5aa6a01b5bbe1675c3aa8872e1203413ded83d1.tar.gz"],
)
http_archive(
name = "pulp_fpu_div_sqrt_mvp_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "2647be453d3dbb7315d7018235ab64b9178ed387c3ff0d2f48d106bac6ab2ece",
strip_prefix = "fpu_div_sqrt_mvp-86e1f558b3c95e91577c41b2fc452c86b04e85ac",
urls = ["https://github.com/pulp-platform/fpu_div_sqrt_mvp/archive/86e1f558b3c95e91577c41b2fc452c86b04e85ac.tar.gz"],
)
http_archive(
name = "pulp_idma_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "1d43045ca3854aa979730f72095a577a646f19a441622aa3eee052770e791f74",
strip_prefix = "iDMA-28a36e5e07705549e59fc33db96ab681bc1ca88e",
urls = ["https://github.com/pulp-platform/iDMA/archive/28a36e5e07705549e59fc33db96ab681bc1ca88e.tar.gz"],
)
http_archive(
name = "pulp_riscv_dbg_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "d455e7900b1b6b9df52ddf8e4c4248a3477f6f01ff882fd74dc346cbfe426921",
strip_prefix = "riscv-dbg-358f90110220adf7a083f8b65d157e836d706236",
urls = ["https://github.com/pulp-platform/riscv-dbg/archive/358f90110220adf7a083f8b65d157e836d706236.tar.gz"],
)
http_archive(
name = "pulp_scm_src",
build_file = "//designs/src/floonoc:pulp_dep.BUILD.bazel",
sha256 = "00d58aae6547e0cdc0a0e54820824ab742e43f8bf77aa2f83fc1c4be7de6c031",
strip_prefix = "scm-1976c7efb4979271eee2abe262fde0f9a20e2557",
urls = ["https://github.com/pulp-platform/scm/archive/1976c7efb4979271eee2abe262fde0f9a20e2557.tar.gz"],
)
# --- NNgen CNN accelerator generator ---
# examples/cnn/cnn.py builds a small quantized CNN and emits the accelerator
# RTL via veriloggen; run under Bazel (py_binary), so no venv / setup.sh. The
# PyPI leaf deps (veriloggen/onnx/numpy/...) come from the pip_nngen hub below.
http_archive(
name = "nngen_src",
build_file = "//designs/src/cnn:nngen.BUILD.bazel",
sha256 = "9ba7532bad950cd42748cd845f219ea23fdb6ed666068f966e1a6907308aa9c4",
strip_prefix = "nngen-d5ac0cc931ffcfdb6ced63123248cdcbc6cfe7bd",
urls = ["https://github.com/NNgen/nngen/archive/d5ac0cc931ffcfdb6ced63123248cdcbc6cfe7bd.tar.gz"],
)
# --- Black-Parrot RISC-V processor + its vendored submodules ---
# BlackParrot's bp_top/flist.vcs drives direct SystemVerilog synthesis via
# yosys-slang; the flist references BP's own hw plus two vendored submodules
# (basejump_stl, HardFloat). Replaces the committed release/repo vendored tree
# (~500K lines) with pinned archives; the exact flist subset is in srcs.bzl.
# bedrock is NOT fetched — its only files.txt hits are BP-own bp_*bedrock*.sv.
# The three share one injected build_file (bp_dep.BUILD.bazel).
http_archive(
name = "bp_processor_src",
build_file = "//designs/src/bp_processor:bp_dep.BUILD.bazel",
sha256 = "e170d33c6265e545fedb46d6a99989bdcd105ffe83a6e1d0034ccc8a4d39f033",
strip_prefix = "black-parrot-05ef10db21254c0b54fac4439a08de8329b05699",
urls = ["https://github.com/black-parrot/black-parrot/archive/05ef10db21254c0b54fac4439a08de8329b05699.tar.gz"],
)
http_archive(
name = "bp_basejump_stl_src",
build_file = "//designs/src/bp_processor:bp_dep.BUILD.bazel",
sha256 = "add92d9a330cc1b370dc05cb2133b341c91cd1df52cc59cf4c122972680bb42b",
strip_prefix = "basejump_stl-b7788905f9a1f42d097b2917812cd6b6615c646b",
urls = ["https://github.com/bespoke-silicon-group/basejump_stl/archive/b7788905f9a1f42d097b2917812cd6b6615c646b.tar.gz"],
)
http_archive(
name = "bp_hardfloat_src",
build_file = "//designs/src/bp_processor:bp_dep.BUILD.bazel",
sha256 = "a83efaa8c390cc314f055a8e185d5d83e03c0fb12d420f02e2ac94680e97e0b1",
strip_prefix = "HardFloat-5b7d5fe2df7e297b5ba095b3eb8a9517dc2e9d88",
urls = ["https://github.com/bsg-external/HardFloat/archive/5b7d5fe2df7e297b5ba095b3eb8a9517dc2e9d88.tar.gz"],
)
# --- NVDLA hw source (nv_small) for the hermetic vmod spec-build ---
# NVDLA's RTL is the *output* of `tmake -build vmod` over this parameterized
# source. Unlike the other designs (whose upstream ships ready RTL), NVDLA
# needs the legacy spec build run — but it reproduces byte-for-byte with modern
# tools: system perl + the vendored pure-perl modules (designs/src/NVDLA/dev/
# perl_lib: YAML + XML::Simple), rules_python's python3, and rules_java's JDK
# (SystemC/JDK11/perl-5.10 from the retired setup.sh are NOT required). See the
# gen_vmod genrule in designs/src/NVDLA/BUILD.bazel.
http_archive(
name = "nvdla_hw_src",
build_file = "//designs/src/NVDLA:nvdla_hw.BUILD.bazel",
sha256 = "3b5ac66cb796e8c1ad297051ba1af167769f895fd3bf083f7611585e5db65e66",
strip_prefix = "hw-771f20cc9e69759d7277978eb41e8d47f1547374",
urls = ["https://github.com/nvdla/hw/archive/771f20cc9e69759d7277978eb41e8d47f1547374.tar.gz"],
)
# --- sv2v (SystemVerilog -> Verilog-2005) prebuilt release binary ---
# Shared by the sv2v-lowered designs (minimax, NyuziProcessor). Pinning the
# prebuilt v0.0.13 release replaces building sv2v from an unpinned Haskell
# Stack checkout of master.
http_archive(
name = "sv2v",
build_file = "//designs/src/minimax:sv2v.BUILD.bazel",
sha256 = "552799a1d76cd177b9b4cc63a3e77823a3d2a6eb4ec006569288abeff28e1ff8",
strip_prefix = "sv2v-Linux",
urls = ["https://github.com/zachjs/sv2v/releases/download/v0.0.13/sv2v-Linux.zip"],
)
# minimax — gsmecher/minimax (SystemVerilog, lowered to Verilog by sv2v)
http_archive(
name = "minimax_src",
build_file = "//designs/src/minimax:external.BUILD.bazel",
sha256 = "75683b1ef8bc5caa6932d2b24ca94bd07150cae53d04efbe60d3d4ac43756571",
strip_prefix = "minimax-cb62251a05522f98b9c999a77a3163d1d8696a37",
urls = ["https://github.com/gsmecher/minimax/archive/cb62251a05522f98b9c999a77a3163d1d8696a37.tar.gz"],
)
# NyuziProcessor — jbush001/NyuziProcessor (SystemVerilog, lowered by sv2v).
# The fakeram-swap patch (declarative) replaces the generic sram_1r1w/sram_2r1w/
# cache_lru modules with FakeRAM macros before conversion; those three source
# files are then excluded from the sv2v input (see external.BUILD.bazel) and
# provided by the checked-in cache_lru.v / macros.v instead.
http_archive(
name = "nyuzi_src",
build_file = "//designs/src/NyuziProcessor:external.BUILD.bazel",
# Use GNU patch (fuzz-tolerant); Bazel's native patcher is stricter and
# rejects the minor context drift in a couple of hunks.
patch_args = ["-p0"],
patch_tool = "patch",
patches = ["//designs/src/NyuziProcessor:patches/fakeram-swap.patch"],
sha256 = "39b8881b67c1b59afd3cbcbea06e11eda10e09f120b7d285750609ae0adc5428",
strip_prefix = "NyuziProcessor-ed5c1a50b77af80e54800e21bd8b62822c3f496a",
urls = ["https://github.com/jbush001/NyuziProcessor/archive/ed5c1a50b77af80e54800e21bd8b62822c3f496a.tar.gz"],
)
# PyPI leaf deps for the LiteX generator toolchain (its own hub so other
# tool-families can pin different versions side-by-side).
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pip_litex",
python_version = "3.13",
requirements_lock = "//designs/src/litedram:requirements_lock.txt",
)
use_repo(pip, "pip_litex")
# FlooGen NoC-generator leaf deps (floogen itself ships in @floonoc_src).
# Separate hub so its version set (pydantic/matplotlib/mako/...) is isolated.
pip.parse(
hub_name = "pip_floogen",
python_version = "3.13",
requirements_lock = "//designs/src/floonoc:requirements_lock.txt",
)
use_repo(pip, "pip_floogen")
# Snitch clustergen leaf deps (clustergen ships in @snitch_cluster_src).
# Separate hub isolating json5/jsonref/jsonschema/mako. (peakrdl deliberately
# omitted — the peripheral reg files ship pre-generated in the archive.)
pip.parse(
hub_name = "pip_clustergen",
python_version = "3.13",
requirements_lock = "//designs/src/snitch_cluster:requirements_lock.txt",
)
use_repo(pip, "pip_clustergen")
# NNgen CNN generator leaf deps (nngen itself is @nngen_src). Separate hub so
# its version set (veriloggen/onnx/numpy/...) is isolated from pip_litex.
pip.parse(
hub_name = "pip_nngen",
python_version = "3.13",
requirements_lock = "//designs/src/cnn:requirements_lock.txt",
)
use_repo(pip, "pip_nngen")
# --- Scala/Chisel toolchain (for the Chisel-generated designs sha3/gemmini) ---
# Runs the Chisel emitters under Bazel (scala_binary) instead of sbt-from-curl.
# Pinned to Chisel 3.6.1 / Scala 2.13.12 to reproduce the exact committed RTL
# (these designs are chisel3-only — no rocket-chip/chipyard). Chisel 3.6.1
# emits Verilog directly via its Scala FIRRTL compiler, so no rules_chisel /
# CIRCT / firtool is needed (unlike the gallery's Chisel-7 designs).
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_java", version = "8.14.0")
bazel_dep(name = "rules_scala", version = "7.1.5")
scala_config = use_extension("@rules_scala//scala/extensions:config.bzl", "scala_config")
# Default 2.13.12 for sha3/gemmini (Chisel 3.6.1); 2.13.17 as a cross-build
# version for coralnpu (Chisel 7 — see the Chisel-7 toolchain block below).
# Per-target selection via the scala_version attribute of scala_*/chisel_* rules.
scala_config.settings(
scala_version = "2.13.12",
scala_versions = ["2.13.17"],
)
use_repo(scala_config, "rules_scala_config")
scala_deps = use_extension("@rules_scala//scala/extensions:deps.bzl", "scala_deps")
# rules_scala 7.1.5's default 2.13 toolchain artifacts are pinned to 2.13.17,
# but chisel3-plugin 3.6.1 is only published for Scala 2.13.0-2.13.14 and is
# built against 2.13.12's scalac internals — so the scalac worker itself must
# run the 2.13.12 compiler. Override the three scala toolchain artifacts to
# 2.13.12 (this also bypasses the config-vs-default version-mismatch check).
scala_deps.overridden_artifact(
name = "io_bazel_rules_scala_scala_compiler",
artifact = "org.scala-lang:scala-compiler:2.13.12",
sha256 = "583adb1ffa7b29fdbfdd6f4c97a396af06a8a91625d059823bba1b7172242d6a",
)
scala_deps.overridden_artifact(
name = "io_bazel_rules_scala_scala_library",
artifact = "org.scala-lang:scala-library:2.13.12",
sha256 = "c6a879e4973a60f6162668542a33eaccc2bb565d1c934fb061c5844259131dd1",
)
scala_deps.overridden_artifact(
name = "io_bazel_rules_scala_scala_reflect",
artifact = "org.scala-lang:scala-reflect:2.13.12",
sha256 = "c648ceb93a9fcbd22603e0be3d6a156723ae661f516c772a550a088bb3cbca7a",
)
scala_deps.scala()
use_repo(scala_deps, "rules_scala_toolchains")
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "maven_chisel",
artifacts = [
"edu.berkeley.cs:chisel3_2.13:3.6.1",
"edu.berkeley.cs:chisel3-plugin_2.13.12:3.6.1",
# chisel3 3.6.x needs firrtl on the classpath (separate artifact in this
# era; not pulled transitively by the chisel3 POM).
"edu.berkeley.cs:firrtl_2.13:1.6.0",
],
repositories = [
"https://repo1.maven.org/maven2",
"https://s01.oss.sonatype.org/content/repositories/releases",
],
)
use_repo(maven, "maven_chisel")
# sha3 — ucb-bar/sha3 (Chisel 3.6.1); a few upstream .scala files compiled
# with the checked-in top/emitter (see designs/src/sha3).
http_archive(
name = "sha3_src",
build_file = "//designs/src/sha3:external.BUILD.bazel",
sha256 = "c0b1511c15783ce661ec07e989bc5185cad806d680d16d50adc8ca925ef33f76",
strip_prefix = "sha3-8fe970e9f96beef84ee7065d3050cd73c5b106e9",
urls = ["https://github.com/ucb-bar/sha3/archive/8fe970e9f96beef84ee7065d3050cd73c5b106e9.tar.gz"],
)
# gemmini — ucb-bar/gemmini (Chisel 3.6.1); same toolchain as sha3.
http_archive(
name = "gemmini_src",
build_file = "//designs/src/gemmini:external.BUILD.bazel",
sha256 = "943f721ce57293aec17423849c19f3a512293329767f4d0a92cd5310961443aa",
strip_prefix = "gemmini-8c3f9923a44a2fe2c7930587be297d6d4f8c09ca",
urls = ["https://github.com/ucb-bar/gemmini/archive/8c3f9923a44a2fe2c7930587be297d6d4f8c09ca.tar.gz"],
)
# --- Chisel 7 toolchain (for coralnpu — CIRCT/firtool, Scala 2.13.17) ---
# Ported from the bazel-orfs gallery's coralnpu. chisel_binary/chisel_library
# (rules_chisel) elaborate the Chisel 7 sources to FIRRTL; fir_library +
# verilog_directory (bazel-orfs-verilog) run firtool to SystemVerilog. Runs
# on Scala 2.13.17 (the cross-version above), coexisting with the 2.13.12
# Chisel-3.6.1 designs.
bazel_dep(name = "rules_chisel", version = "0.3.1")
chisel = use_extension("@rules_chisel//chisel:extensions.bzl", "chisel")
chisel.toolchain()
use_repo(chisel, "chisel_maven")
# coralnpu (google-coral) + its Chisel-7 dep tree, at the gallery's pinned SHAs.
http_archive(
name = "coralnpu",
build_file = "//designs/src/coralnpu/chisel:external.BUILD.bazel",
patch_args = ["-p1"],
patch_cmds = [
"find . -name BUILD -empty -delete",
"find . -name BUILD.bazel -empty -delete",
"""sed -i 's|addResource("ClockGate.sv")|addResource("hdl/verilog/ClockGate.sv")|' hdl/chisel/src/coralnpu/ClockGate.scala""",
"""sed -i 's|addResource("RstSync.sv")|addResource("hdl/verilog/RstSync.sv")|' hdl/chisel/src/coralnpu/RstSync.scala""",
],
patches = [
"//designs/src/coralnpu/chisel:patches/chisel7-compat.patch",
# HighTide memory refactor: replace the generic hdl/verilog/Sram_*.v
# with FakeRAM-backed blackboxes (module Sram_512x128 -> fakeram_512x128,
# from macros.v). Was a manual cp in the old setup.sh; now declarative.
"//designs/src/coralnpu/chisel:patches/fakeram-memories.patch",
],
sha256 = "39ba6fff9342f2be2b3c8cfad4dd82a1d2481b53b67963d3248461562b81d042",
strip_prefix = "coralnpu-04c48f55d0f9933f6fea69c429e1790e0ae18647",
urls = ["https://github.com/google-coral/coralnpu/archive/04c48f55d0f9933f6fea69c429e1790e0ae18647.tar.gz"],
)
http_archive(
name = "rocket_chip",
build_file = "//designs/src/coralnpu/chisel:rocket_chip.BUILD.bazel",
sha256 = "76076a7e7538dd347074d7dc056cfa6219a6dfdeed58bb47c848b435f27c30f8",
strip_prefix = "rocket-chip-f517abbf41abb65cea37421d3559f9739efd00a9",
urls = ["https://github.com/chipsalliance/rocket-chip/archive/f517abbf41abb65cea37421d3559f9739efd00a9.tar.gz"],
)
http_archive(
name = "diplomacy",
build_file = "//designs/src/coralnpu/chisel:diplomacy.BUILD.bazel",
sha256 = "33a66aa60e565b9665dcfc93020f5acf64710a7dc4f2b164752544ec5a946256",
strip_prefix = "diplomacy-6590276fa4dac315ae7c7c01371b954c5687a473",
urls = ["https://github.com/chipsalliance/diplomacy/archive/6590276fa4dac315ae7c7c01371b954c5687a473.tar.gz"],
)
http_archive(
name = "common_cells",
build_file = "//designs/src/coralnpu/chisel:common_cells.BUILD.bazel",
sha256 = "ea112e598908b9cfd03254aeb676ff8b51196b186ab00bdb5e2ad90a73a3055e",
strip_prefix = "common_cells-6aeee85d0a34fedc06c14f04fd6363c9f7b4eeea",
urls = ["https://github.com/pulp-platform/common_cells/archive/6aeee85d0a34fedc06c14f04fd6363c9f7b4eeea.tar.gz"],
)
http_archive(
name = "cvfpu",
build_file = "//designs/src/coralnpu/chisel:cvfpu.BUILD.bazel",
patch_args = ["-p1"],
patches = [
"//designs/src/coralnpu/chisel:patches/cvfpu-0001-max_num_lanes.patch",
"//designs/src/coralnpu/chisel:patches/cvfpu-0003-fill-unreachable.patch",
],
sha256 = "1446d4528bcff472ea50f656f529c7dd126b117587c0b334d391cbd1e0997553",
strip_prefix = "cvfpu-58ca3c376beb914b2b80b811d4b270c063d4e6f7",
urls = ["https://github.com/openhwgroup/cvfpu/archive/58ca3c376beb914b2b80b811d4b270c063d4e6f7.tar.gz"],
)
http_archive(
name = "fpu_div_sqrt_mvp",
build_file = "//designs/src/coralnpu/chisel:fpu_div_sqrt_mvp.BUILD.bazel",
sha256 = "2647be453d3dbb7315d7018235ab64b9178ed387c3ff0d2f48d106bac6ab2ece",
strip_prefix = "fpu_div_sqrt_mvp-86e1f558b3c95e91577c41b2fc452c86b04e85ac",
urls = ["https://github.com/pulp-platform/fpu_div_sqrt_mvp/archive/86e1f558b3c95e91577c41b2fc452c86b04e85ac.tar.gz"],
)
# --- Copy / SystemVerilog designs (vortex, ternip, eyeriss) ---
# Upstream RTL fetched and selected/assembled by Bazel; local FakeRAM/stub
# overlays and fixups stay checked in or are applied as declarative patches.
http_archive(
name = "vortex_src",
build_file = "//designs/src/vortex:external.BUILD.bazel",
sha256 = "41809835d548ee48b14d8160f75646e5ca507601579f7402251d37acc8e91757",
strip_prefix = "vortex-d425a56ef6299971cce5de629d6fe626b98cafa9",
urls = ["https://github.com/vortexgpgpu/vortex/archive/d425a56ef6299971cce5de629d6fe626b98cafa9.tar.gz"],
)
http_archive(
name = "ternip_src",
build_file = "//designs/src/ternip:external.BUILD.bazel",
sha256 = "28ebed24a760fea40c8506bc2f6bb78a57175bbb673ab44bb1b7ce8a062f9be4",
strip_prefix = "ternip-187957b57e2a0d4f74374a354e189d158a38ba13",
urls = ["https://github.com/sifferman/ternip/archive/187957b57e2a0d4f74374a354e189d158a38ba13.tar.gz"],
)
http_archive(
name = "basejump_stl_src",
build_file = "//designs/src/ternip:basejump.BUILD.bazel",
sha256 = "92dc773cfa4a7c5e41bfa4fae5af5810c5b78f35b10f0dc8b9489e57b2091492",
strip_prefix = "basejump_stl-b48037e28544425839dbd617d45b1a82631bc1a9",
urls = ["https://github.com/bespoke-silicon-group/basejump_stl/archive/b48037e28544425839dbd617d45b1a82631bc1a9.tar.gz"],
)
http_archive(
name = "eyeriss_src",
build_file = "//designs/src/eyeriss:external.BUILD.bazel",
sha256 = "0a32ef13dbc82d7cc33ca070b6b085bfce3e6e65d6c11c288ab39552ea136174",
strip_prefix = "CNN-Accelerator-Based-on-Eyeriss-v2-dc1df8bffa3c7a8b091f23fe66155a032496315e",
urls = ["https://github.com/BoooC/CNN-Accelerator-Based-on-Eyeriss-v2/archive/dc1df8bffa3c7a8b091f23fe66155a032496315e.tar.gz"],
)
# litepci — LiteX (reuses the migen/litex/pip_litex toolchain above).
http_archive(
name = "litepci_src",
build_file = "//designs/src/litepci:external.BUILD.bazel",
sha256 = "bd072e1a470cd1cd1fe07aa5b854108a7f12fc05e14fa347867d9db37b93f065",
strip_prefix = "litepcie-95f4731173db01158638b14a7eb4a679df1c2575",
urls = ["https://github.com/enjoy-digital/litepcie/archive/95f4731173db01158638b14a7eb4a679df1c2575.tar.gz"],
)