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

Fix memory initialization in mem-tb #676

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Fix memory initialization in mem-tb #676

merged 1 commit into from
Nov 27, 2024

Conversation

RRozak
Copy link
Member

@RRozak RRozak commented Nov 27, 2024

Mem-tb testbench currently doesn't work, because the memory isn't initialized with FF values as expected in the test. The initialization is done on posedge(reset:

always @(posedge reset) for (int i = 0; i < 2 ** ADDR_WIDTH; i++) mem[i] = 8'hFF;

which isn't triggered by the variable initialization. It works when the delay is added.

The testbench stooped working after verilator/verilator@0aa8356. With that commit, the output of %m has changed: https://github.com/antmicro/uvm-verilator/blob/795b5f263c5d440c26e6d3598b406d44dd23fbd9/src/base/uvm_misc.svh#L110
which is then used in computation of random seed, which should always be the same.
%m changed, so did the seed and the values that were obtained by randomization. We entered into the case in which we read the memory cell which wasn't written and the tests started failing. It seems that this case wasn't tested before.

Signed-off-by: Ryszard Rozak <[email protected]>
@RRozak RRozak merged commit b03758b into main Nov 27, 2024
4 checks passed
@RRozak RRozak deleted the rrozak/fix-init-mem-tb branch November 27, 2024 10:35
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.

2 participants