Skip to content

Improvements to Verilator, Cocotb, macros - #452

Open
mczyz-antmicro wants to merge 20 commits into
hdl:mainfrom
antmicro:upstream-verilator-fixes
Open

mczyz-antmicro wants to merge 20 commits into
hdl:mainfrom
antmicro:upstream-verilator-fixes

Conversation

@mczyz-antmicro

@mczyz-antmicro mczyz-antmicro commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Changed:

  • cocotb:
    • Bumped to 2.1.0
    • Split cocotb Icarus and Verilator implementations
    • Made C++ toolchain more hermetic
    • Enabled waveform dumping
  • verilator:
    • Fixed bug in Verilator CPP copy which prevented caching
    • Added Z3 dependency needed for constrained randomization
    • Fixed bug which caused additional compilations
  • macros:
    • Added utility macros sim_genrules and uvm_genrules which facilitate creating test suites
  • rules_hdl: bump version to 0.0.2

EDIT: removed yosys bump from the scope

wkkuna and others added 15 commits October 15, 2026 15:46
Signed-off-by: Wiktoria Kuna <wkuna@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Internal-tag: [#105127]
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mczyz-antmicro
mczyz-antmicro marked this pull request as ready for review October 19, 2026 16:17
@PiotrZierhoffer

Copy link
Copy Markdown

/gcbrun

@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

@mikesinouye would be grateful if you could take a look

Comment thread dependency_support/tools_extension.bzl Outdated
Comment thread verilator/use_libc++.patch Outdated
JanOlencki and others added 5 commits October 23, 2026 10:47
…ions

Otherwise, CppCompileActionTemplate compiles unchanged files likely because sources and headers came from two tree artifacts.
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mczyz-antmicro
mczyz-antmicro force-pushed the upstream-verilator-fixes branch from 60f5a7e to ebf419f Compare October 23, 2026 10:04
@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@mikesinouye mikesinouye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After these are addressed I'll merge the rest looks good

Comment thread MODULE.bazel
bazel_dep(name = "openroad", repo_name = "org_theopenroadproject")
bazel_dep(name = "openroad", version = "0.0.0", repo_name = "org_theopenroadproject")
bazel_dep(name = "rules_foreign_cc", version = "0.16.0")
bazel_dep(name = "z3", version = "5.3.1")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this version actually exist? I can only see 4.15.2 https://registry.bazel.build/modules/z3/4.15.2/overview

Also is there any way to avoid the git_override()? Won't all downstream users of rules_hdl have to start setting that manually

cocotb_files,
"/site-packages/cocotb/libs/{}".format(library),
)
for library in ["libcocotbvpi_verilator.so", "libgpi.so"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less concerning, but how feasible is it to avoid the use of pre-builts here?

int result = std::system(cmd.c_str());
if (result != 0) {
return result;
return WEXITSTATUS(result);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows is already supported in this file, so I'd prefer to avoid breaking it, could you add a small macro check here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants