openhwgroup / cva6

The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
https://docs.openhwgroup.org/projects/cva6-user-manual/
Other
2.23k stars 677 forks source link

feat: update cva6_hpdcache_icache_if_adapter (support continuous virtual address requests) #2314

Closed takeshiho0531 closed 1 month ago

takeshiho0531 commented 3 months ago
github-actions[bot] commented 3 months ago

:x: failed run, report available here.

github-actions[bot] commented 3 months ago

:x: failed run, report available here.

takeshiho0531 commented 3 months ago

@cfuguet

I think this could be handled in the adapter you are developing. The adapter should keep an internal state that a request (with VA) was transferred to the HPDcache. If the next cycle there is no corresponding OBI request, in that case, the adapter asserts the abort signal to the cache. While aborting, you can however forward a new request (with VA) to the cache. It is a 2 stage pipeline

I implemented this as below, but I don't feel like it will work well....:’-( If you have any hints or suggestions, please let me know.

  logic va_transferred_q, va_is_transferred_d;

  always_ff @(posedge clk_i or negedge rst_ni) begin : transferred_state_magnegement
    if (!rst_ni) begin
      va_transferred_q <= '0;
    end else begin
      va_transferred_q <= va_is_transferred_d;
    end
  end

  assign va_transferred_d = dreq_i.req;
  assign hpdcache_req_abort_o = dreq_i.kill_req || !(va_transferred_q && fetch_obi_req_i.req),

I have the variables va_transferred_d and va_transferred_q express whether the VA has been transferred. (I'll change the veriables' name to better ones..) It's not an explicit 2-stage pipeline, but basically, everything is connected with assign to handle new requests, while the abort signal is managed separately.

cfuguet commented 2 months ago

@cfuguet

I think this could be handled in the adapter you are developing. The adapter should keep an internal state that a request (with VA) was transferred to the HPDcache. If the next cycle there is no corresponding OBI request, in that case, the adapter asserts the abort signal to the cache. While aborting, you can however forward a new request (with VA) to the cache. It is a 2 stage pipeline

I implemented this as below, but I don't feel like it will work well....:’-( If you have any hints or suggestions, please let me know.

  logic va_transferred_q, va_is_transferred_d;

  always_ff @(posedge clk_i or negedge rst_ni) begin : transferred_state_magnegement
    if (!rst_ni) begin
      va_transferred_q <= '0;
    end else begin
      va_transferred_q <= va_is_transferred_d;
    end
  end

  assign va_transferred_d = dreq_i.req;
  assign hpdcache_req_abort_o = dreq_i.kill_req || !(va_transferred_q && fetch_obi_req_i.req),

I have the variables va_transferred_d and va_transferred_q express whether the VA has been transferred. (I'll change the veriables' name to better ones..) It's not an explicit 2-stage pipeline, but basically, everything is connected with assign to handle new requests, while the abort signal is managed separately.

Hi @takeshiho0531,

I see some issues in your code.

assign va_transferred_d = dreq_i.req & hpdcache_req_ready_i;
assign hpdcache_req_abort_o = va_transferred_q & (dreq_i.kill_req | ~fetch_obi_req_i.req),
github-actions[bot] commented 2 months ago

:x: failed run, report available here.