tc_sram: Guard simulation-only random init from synthesis#46
Open
imchenwu wants to merge 1 commit into
Open
Conversation
The `random_init_word` function uses `$urandom`, which synthesis tools cannot elaborate inside a function body (e.g. Synopsys DC fails with VER-110). Move the `init_val` declaration out so it stays visible as the SRAM reset value, and guard the function and the init process with `pragma translate_off`/`translate_on`. Simulators ignore the pragma, so simulation behavior is unchanged.
Collaborator
|
What exactly is the scenario where one would synthesize the generic tc_sram? |
Author
|
Sorry for the confusion, it's not actually synthesized. Our DC flow only passes |
Collaborator
|
We would have to test if this works properly (it should) but maybe we could guard a |
Author
|
Yes that would be great! |
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.
#44 moved the random initialization into the
random_init_wordfunction, so$urandomis now elaborated by synthesis tools. In AXI, when Bender automatically updatestech_cells_generictov0.2.14, Synopsys DC fails with VER-110.This PR moves the
init_valdeclaration out so it stays visible as the SRAM reset value, and guards the function and the init process withpragma translate_off/translate_on. Simulators ignore the pragma, so simulation behavior should be unchanged.This PR is verified in the AXI CI, with DC elaborating
tc_sramcleanly again, and the Questasim simulation passed.