Skip to content

[fpga] Fix ROM corruption on async reset assertion#649

Open
raylau1 wants to merge 1 commit into
lowRISC:mainfrom
raylau1:fix_reset_freeze
Open

[fpga] Fix ROM corruption on async reset assertion#649
raylau1 wants to merge 1 commit into
lowRISC:mainfrom
raylau1:fix_reset_freeze

Conversation

@raylau1

@raylau1 raylau1 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The asynchronous Mocha reset assertion on FPGA can cause timing violations for BRAM control/address input signals, and corrupt the content of the ROM.

This PR adds a synchroniser to ensure both assertion and deassertion of the Mocha top reset on FPGA are synchronous to the clock, which prevents this issue.

Closes #639.

The async Mocha reset assertion can cause timing violations for BRAM
control/address input signals, and corrupt the content of the ROM.

This bug does not affect the ASIC implementation.

This commit ensures both assertion and deassertion of the Mocha top
reset on FPGA are synchronous to the clock, which prevents the issue.
@raylau1 raylau1 self-assigned this Jul 6, 2026
@raylau1 raylau1 requested a review from marnovandermaas July 6, 2026 12:56

@marnovandermaas marnovandermaas 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.

Great find! I was wondering about one alteration.

Comment on lines 206 to 207
.rst_ni (ext_rst_ni & ftdi_rst_ni & fpga_rst_n_sync_cfg),
.d_i (1'b1),

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.

Would this have the same effect?

Suggested change
.rst_ni (1'b1),
.d_i (ext_rst_ni & ftdi_rst_ni & fpga_rst_n_sync_cfg),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. Since the external reset also resets the PLL, there is a delay between reset deassertion and clocks starting to toggle. We need the external reset on the rst_ni pin to make sure the active value 0 is latched into the DFFs before the clocks start toggling.

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.

FPGA top unresponsive after repeated external reset

2 participants