Skip to content

test/orfs/mock-array: verilator config test, disabled by default#9081

Closed
oharboe wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:test-orfs-verilator-config-check
Closed

test/orfs/mock-array: verilator config test, disabled by default#9081
oharboe wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:test-orfs-verilator-config-check

Conversation

@oharboe
Copy link
Collaborator

@oharboe oharboe commented Dec 18, 2025

This to make sure there's less dependencies on local installs and that there are no rattling screws in the bazel config, and for collaboration with @MrAMS. No changes to CI or tests as such.

This will be used to validate the verilator configuration and setup. The test is for local bazel maintainer testing, not for CI:

bazelisk test test/orfs/mock-array:TinyAdder_test

Result:

[deleted]
//test/orfs/mock-array:TinyAdder_test                                    PASSED in 4.2s

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe oharboe marked this pull request as draft December 18, 2025 16:37
@oharboe oharboe force-pushed the test-orfs-verilator-config-check branch from 55f024d to 583fed3 Compare December 18, 2025 19:44
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe oharboe force-pushed the test-orfs-verilator-config-check branch from 583fed3 to 41d97af Compare December 18, 2025 20:49
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 18, 2025

@MrAMS some sort of java problem... rooted in scala_rules somehow...? Thoughts?

https://jenkins.openroad.tools/job/OpenROAD-Public/job/PR-9081-head/3/pipeline-overview/log?nodeId=335

[2025-12-18T20:56:50.435Z] (20:56:49) DEBUG: /home/user/.cache/bazel/_bazel_user/15700f20a87f4b380d597d03ec25fccb/external/rules_jvm_external+/private/extensions/maven.bzl:351:18: The maven repository 'maven' has contributions from multiple bzlmod modules, and will be resolved together: ["bazel-orfs", "openroad", "or-tools", "protobuf"]
[2025-12-18T20:56:50.435Z] (20:56:49) ERROR: /home/user/.cache/bazel/_bazel_user/15700f20a87f4b380d597d03ec25fccb/external/rules_java++toolchains+local_jdk/BUILD.bazel:2:10: in fail_rule rule @@rules_java++toolchains+local_jdk//:jdk: 
[2025-12-18T20:56:50.435Z] Traceback (most recent call last):
[2025-12-18T20:56:50.435Z] 	File "/home/user/.cache/bazel/_bazel_user/15700f20a87f4b380d597d03ec25fccb/external/rules_java+/toolchains/fail_rule.bzl", line 19, column 13, in _fail_rule_impl
[2025-12-18T20:56:50.435Z] 		fail("%s %s" % (ctx.attr.header, ctx.attr.message))
[2025-12-18T20:56:50.435Z] Error in fail: Auto-Configuration Error: Cannot find Java binary bin/java in /home/user/.cache/bazel/_bazel_user/15700f20a87f4b380d597d03ec25fccb/external/rules_java++toolchains+local_jdk/nosystemjdk; either correct your JAVA_HOME, PATH or specify Java from remote repository (e.g. --java_runtime_version=remotejdk_11)
[2025-12-18T20:56:50.435Z] (20:56:49) ERROR: /home/user/.cache/bazel/_bazel_user/15700f20a87f4b380d597d03ec25fccb/external/rules_java++toolchains+local_jdk/BUILD.bazel:2:10: Analysis of target '@@rules_java++toolchains+local_jdk//:jdk' (config: 9b4b671) failed

@MrAMS
Copy link

MrAMS commented Dec 19, 2025

fixed?

@MrAMS
Copy link

MrAMS commented Dec 19, 2025

Maybe we should install JDK on the test machine? I have heared a report from my collaborator that our bazel project will fail when there is no JDK on the OS.

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

fixed?

No, see CI failure.

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

Maybe we should install JDK on the test machine? I have heared a report from my collaborator that our bazel project will fail when there is no JDK on the OS.

We dont control these CI machines, so minimally tags manual tests for local use must not pull in the jdk.

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

Aha...

https://bazel.build/docs/bazel-and-java#hermetic-testing

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

Let's see if this has any adverse effects first... #9095

@oharboe oharboe force-pushed the test-orfs-verilator-config-check branch from 41d97af to 03725de Compare December 19, 2025 06:51
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe oharboe marked this pull request as ready for review December 19, 2025 06:56
@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

/gemini review

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

@gemini-code-assist review

@oharboe oharboe requested a review from Copilot December 19, 2025 06:58
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new test for Verilator configuration and updates Bazel dependencies and configurations, particularly for rules_scala. The changes are well-structured and improve the build's hermeticity.

My review includes a couple of suggestions for improving code cleanliness and encapsulation:

  • In test/orfs/mock-array/src/test/scala/TinyAdderTest.scala, there are some redundant and unused imports that can be cleaned up.
  • In test/orfs/BUILD, the visibility of the new scala_toolchain is public, which could be narrowed for better encapsulation.

Overall, the changes look good and serve their purpose of validating the Verilator setup.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Verilator configuration test using a simple TinyAdder module to validate the Verilator setup in the repository. The test is tagged as "manual" so it doesn't run in CI by default but can be executed locally by maintainers for validation purposes.

Key Changes:

  • Migrated from git-based rules_scala dependency to BCR version 7.1.5
  • Added hermetic JDK configuration for more reliable test execution
  • Created TinyAdder test module with manual tag for Verilator validation

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/orfs/mock-array/src/test/scala/TinyAdderTest.scala New test file implementing TinyAdder module and test suite
test/orfs/mock-array/BUILD Added chisel_test target with manual tag for TinyAdder validation
test/orfs/BUILD Added custom Scala toolchain configuration with SemanticDB support
MODULE.bazel Migrated to BCR rules_scala 7.1.5 and updated Scala version to 2.13.17
.bazelrc Added hermetic JDK configuration for test reliability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates Bazel dependencies, notably for rules_scala, and introduces a new test to validate the Verilator configuration. The changes to use versioned dependencies from the Bazel Central Registry and to ensure hermetic JDK usage are great improvements. I've found a minor issue in the new Scala test file regarding unused and duplicated imports, and I've provided a suggestion to clean it up.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

@maliberty Just FYI. Surely this is an unrelated failure on master:

The following tests FAILED:
 	171 - odb.write_3dbv.tcl (Failed)                       IntegrationTest tcl odb log_compare

@oharboe oharboe changed the title [DO NOT REVIEW] test/orfs/mock-array: verilator config test, disabled by default test/orfs/mock-array: verilator config test, disabled by default Dec 19, 2025
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe force-pushed the test-orfs-verilator-config-check branch from f3fcaeb to 35373d2 Compare December 19, 2025 08:22
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe oharboe requested a review from maliberty December 19, 2025 09:45
@oharboe
Copy link
Collaborator Author

oharboe commented Dec 19, 2025

revisit when regression master is fixed

@oharboe oharboe closed this Dec 19, 2025
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.

3 participants