Skip to content

feat(allowlist): add Verilog, SystemVerilog, and VHDL support - #1050

Open
Parikalp-Bhardwaj wants to merge 10 commits into
alibaba:mainfrom
Parikalp-Bhardwaj:feat/hardware-description-support
Open

feat(allowlist): add Verilog, SystemVerilog, and VHDL support#1050
Parikalp-Bhardwaj wants to merge 10 commits into
alibaba:mainfrom
Parikalp-Bhardwaj:feat/hardware-description-support

Conversation

@Parikalp-Bhardwaj

Copy link
Copy Markdown

Description

Implements the Hardware Description Language group requested in #470, adding support for Verilog, SystemVerilog, and VHDL.

Changes include:

  • Allow .v, .sv, .vhd, and .vhdl files, including case-insensitive variants.
  • Exclude conventional testbench files using:
    • **/tb_*.{v,sv,vhd,vhdl}
    • **/*_tb.{v,sv,vhd,vhdl}
  • Map .v and .sv files to verilog.md.
  • Map .vhd and .vhdl files to vhdl.md.
  • Add language-specific review guidance for Verilog/SystemVerilog and VHDL.
  • Add allowlist, exclusion, negative-boundary, and rule-resolution tests.

.v extension note

The .v extension is shared with the V programming language. Following the Hardware Description scope in #470, this change treats .v as Verilog. The current resolver uses file extensions and cannot distinguish the two languages by content.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Additional verification:

  • go test ./internal/config/allowlist/... ./internal/config/rules/... -count=1
  • make check
  • make test

All commands pass locally.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I have signed the CLA

Related Issues

Closes #1049
Part of #470

@CLAassistant

CLAassistant commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@Parikalp-Bhardwaj Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@Parikalp-Bhardwaj

Copy link
Copy Markdown
Author

Hi @lizhengfeng101, thank you for reviewing my submission. I have completed and signed the Contributor License Agreement.

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update the documentation. Your desc marked this as completed, but no site documentation updated.
Why do agents forget this every time 🤔

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The wiring is complete (including exclude patterns), the documentation has some problems however.

Comment thread internal/config/rules/rule_docs/vhdl.md Outdated
Comment thread internal/config/rules/rule_docs/vhdl.md Outdated
Comment thread internal/config/rules/rule_docs/vhdl.md Outdated
Comment thread internal/config/rules/rule_docs/vhdl.md Outdated
Comment thread internal/config/rules/rule_docs/verilog.md Outdated
Comment thread internal/config/rules/rule_docs/vhdl.md Outdated
Comment thread internal/config/rules/rule_docs/verilog.md Outdated
@Parikalp-Bhardwaj

Copy link
Copy Markdown
Author

Thank you for the detailed review. I’ve updated the Verilog/SystemVerilog and VHDL rule documentation to address all the points raised, including case completeness, edge detection, typing and resizing semantics, procedural assignments, and tool-dependent synthesis support.

@lizhengfeng101

Copy link
Copy Markdown
Contributor

merge conflicts @Parikalp-Bhardwaj

…to feat/hardware-description-support

# Conflicts:
#	internal/config/rules/system_rules.json
#	internal/config/rules/system_rules_test.go
#	pages/src/content/docs/en/review-rules.md
#	pages/src/content/docs/ja/review-rules.md
#	pages/src/content/docs/ru/review-rules.md
#	pages/src/content/docs/zh/review-rules.md
@Parikalp-Bhardwaj

Copy link
Copy Markdown
Author

Hi @lizhengfeng101 I have resolved the merge conflicts, please review it when you have a chance. Thank you

@lizhengfeng101

Copy link
Copy Markdown
Contributor

Checked the branch out and verified behavior rather than only reading the diff — case-insensitive chain, ordering, and the two test packages all pass. Three things:

1. Test name doesn't match its data. subtract has no tb substring (it's b+t). rtl/outbound.v does, and I verified it's still false:

-{"hdl tb substring mid-name not excluded", "rtl/subtract.v", false},
+{"hdl tb substring mid-name not excluded", "rtl/outbound.v", false},

2. .vh is missing (IsAllowedExt(".vh") == false). Verilog headers hold the `define macros and parameter/width constants — exactly what this rule doc targets. No collision, and I verified **/*.vh doesn't match .vhd/.vhdl:

-    "**/*.{v,sv}": "verilog.md",
+    "**/*.{v,vh,sv}": "verilog.md",

Plus ".vh" in supported_file_types.json, two allowlist cases, one resolve case, and the 4 doc tables. Exclude patterns need no change.

3. The .v collision is acknowledged but not mitigated. Coq/V files that were skipped as unsupported_ext now get reviewed with RTL guidance. One line in verilog.md, continuing the existing "Account for whether the file is synthesizable design code..." sentence, fixes it with no code:

The .v extension is also used by Coq and by the V language; if the file is not Verilog or SystemVerilog, report nothing HDL-specific and fall back to general review principles.

Comment thread internal/config/rules/system_rules.json Outdated
@Parikalp-Bhardwaj

Parikalp-Bhardwaj commented Aug 26, 2026

Copy link
Copy Markdown
Author

Thanks for the helpful review. I’ve addressed all three points:

  • Replaced the misleading subtract.v test fixture with outbound.v.
  • Added .vh support to the allowlist, rule mapping, tests, and documentation.
  • Added guidance for handling .v files that contain Coq or V language code.

I also verified the changes with the focused Go tests, make check, make test, and the documentation typecheck and build. All checks pass locally.

Hopefully it will stay conflict-free this time!

@lizhengfeng101

Copy link
Copy Markdown
Contributor

Thanks for the helpful review. I’ve addressed all three points:

  • Replaced the misleading subtract.v test fixture with outbound.v.
  • Added .vh support to the allowlist, rule mapping, tests, and documentation.
  • Added guidance for handling .v files that contain Coq or V language code.

I also verified the changes with the focused Go tests, make check, make test, and the documentation typecheck and build. All checks pass locally.

Hopefully it will stay conflict-free this time!

merge conflicts ......

@Parikalp-Bhardwaj

Copy link
Copy Markdown
Author

I can see that the conflicts were caused by the recently added solidity and vyper entries in main, since they modify the same allowlist and rule-mapping files as this PR 😅

@wu21-web

Copy link
Copy Markdown
Contributor

Tip

Moving your insertions away from the end of any map, JSON gets you less merge conflicts.

…iption-support

# Conflicts:
#	internal/config/allowlist/allowed_ext_test.go
#	internal/config/allowlist/default_exclude_patterns.json
#	internal/config/allowlist/supported_file_types.json
#	internal/config/rules/system_rules.json
@Parikalp-Bhardwaj

Copy link
Copy Markdown
Author

@wu21-web The conflicts are now resolved and the updated branch has been pushed.

Tip

Moving your insertions away from the end of any map, JSON gets you less merge conflicts.

Good point, thanks for the tip. I kept the HDL entries before the existing solidity/vyper entries when resolving the conflicts, so hopefully the same overlap won’t happen again.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: pages/src/content/docs/ko/review-rules.md has the same rule table but wasn't updated — please add the Verilog/VHDL rows there as well.

Comment thread internal/config/allowlist/allowed_ext_test.go Outdated
@Parikalp-Bhardwaj
Parikalp-Bhardwaj force-pushed the feat/hardware-description-support branch from 025211e to 7396080 Compare August 27, 2026 17:54
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.

feat(allowlist): add Verilog, SystemVerilog, and VHDL support

4 participants