insert-includes.py: fix missing newlines between modules causing syntax errors#54
Open
LouieLabata wants to merge 1 commit intomainfrom
Open
insert-includes.py: fix missing newlines between modules causing syntax errors#54LouieLabata wants to merge 1 commit intomainfrom
LouieLabata wants to merge 1 commit intomainfrom
Conversation
jimfangx
requested changes
Dec 26, 2025
Member
jimfangx
left a comment
There was a problem hiding this comment.
I'm unable to reproduce this; Check this video: https://cdn.discordapp.com/attachments/1453221040896475228/1453335914452484227/CleanShot_2025-12-24_at_02.36.39.mp4?ex=69505fcb&is=694f0e4b&hm=a9593416c9696fe7a34639ef05dafcf874cef41474c5f4ff84fa9cb9fa54a7bb& - its also on the discord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Using scripts/insert-includes.py to combine Verilog files together can create a syntax bug in the resulting combined Verilog file. When a `include is followed immediately by a module definition the resulting file concatenates the included verilog without a newline thus creating a endmodulemodule syntax bug, e.g.:
combined.v
This is invalid Verilog syntax and fails compilation.
Cause:
The script writes the included file directly without adding newlines before and after. Below is an example of this.
Minimal example:
top.v:
alu.v:
Resulting combined.v:
Fix:
Modify insert-includes.py to add newlines before and after including files like so:
This ensures the merged combined.v is always syntactically valid.