Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable DOUTADOUT when using SDP mode #1

Open
traxus4 opened this issue Sep 6, 2022 · 0 comments
Open

Unstable DOUTADOUT when using SDP mode #1

traxus4 opened this issue Sep 6, 2022 · 0 comments

Comments

@traxus4
Copy link

traxus4 commented Sep 6, 2022

Problem: Verilator gives me randomized DOUTADOUT when I'm using SDP mode in RAMB36E2.
Expected behavior: Verilator gives me DOUTADOUT that is consistent with Vivado's behavior.

RAMB36E2's DOUTADOUT and DOUTPADOUTP depends on a register called _r_mem_wr_en_a_wf but it's initialized in a always block of posedge _w_mem_wr_clk_a which is never called when _w_sdp_mode is active due to this line.
So _r_mem_wr_en_a_wf never gets assigned, which is unstable behavior if I'm not using --x-initial 0. It leads to unstable DOUTADOUT.

My current work around is:

// Write first mode
-     assign _w_mem_a_out_p0 = (_r_mem_wr_en_a_wf) ? _r_mem_a_wf_p0 : _r_mem_a_rd_p0;
+     assign _w_mem_a_out_p0 = _r_mem_a_rd_p0;

But it's a bad one I guess. We have to move register initializations into a initial block somewhere

P.S. great lib it helped me a lot

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

No branches or pull requests

1 participant