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

Read byte followed by write byte does not match #4

Closed
aignacio opened this issue Jul 30, 2019 · 5 comments
Closed

Read byte followed by write byte does not match #4

aignacio opened this issue Jul 30, 2019 · 5 comments

Comments

@aignacio
Copy link

In the following scenario (one request followed by another):

  1. Write request on any address of hsize = BYTE
  2. Read request on the same address before of hsize = BYTE

The contention variable goes high and the ahb3_memory hold putting HREADYOUT = 0 one cc later like in the picture below, leading the read to be invalid (data read does not match with the written value).
test_1
Forcing contention to zero fix this specific case...
test_2

@rherveille
Copy link
Collaborator

rherveille commented Jul 31, 2019 via email

@aignacio
Copy link
Author

Hi @rherveille ,
I'm using the GENERIC option on the wrapper and the behavioral rl_ram_1r1w_generic from your repository. I made the changes that you pointed and now the memory is reading wrong in some scenarios, is that another behavioral model that could deal with this situation perfectly? I'm bit curios why this problem just happen in the HSIZE equal to byte/half-word case....in the word case it holds hreadyout in the right manner.

@rherveille
Copy link
Collaborator

rherveille commented Jul 31, 2019 via email

@aignacio
Copy link
Author

Hi @rherveille
tks for the explanation now I gotcha your point and I can do the tb for the memory model covering these issues for sure, I'll for the rl_ram_1r1w_generic what stands as the one in FPGA cases, also if it's possible I made some small additions to support hexadecimal initial file like the code below, is that possible to include this through some merge req.?

  integer iter;
  reg [DBITS-1:0]  temp  [2**ABITS-1:0];

  initial begin
    if (INIT_MEMORY == 1'b1) begin
      $readmemh(INIT_FILE, temp);
      $display ("Loading memory with the file %s",INIT_FILE);
      $display ("SRAM Words size ----> %d Words",2**ABITS);
      for (int iter=0; iter<2**ABITS; iter++) begin
        if (^temp[iter] === 1'bx) begin
          mem_array[iter] = 32'd0;
        end else begin
          $display ("[ADDRESS = %d][DATA = %h]",iter,temp[iter]);
          mem_array[iter] = temp[iter];
        end
      end
    end
    else begin
      for (int iter=0; iter<2**ABITS; iter++) begin
        mem_array[iter] = 32'd0;
      end
    end
  end

ps.: INIT_FILE/INIT_MEMORY are verilog parameters for the module...

@aignacio
Copy link
Author

mem_tb.zip

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

2 participants