ptw: Wait for rvalid on flush (#1184)

When the PTW is flushed, we need any pending transactions to
complete before returning to the IDLE state. Currently, the PTW returns
to IDLE after one cycle. Remain in WAIT_RVALID until we have actually
received rvalid.

Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
Co-authored-by: Marcelo Orenes <movera@princeton.edu>
Co-authored-by: Hyunsung Yun <88669963+yuhysu@users.noreply.github.com>
This commit is contained in:
Nils Wistoff 2023-04-16 21:28:37 +02:00 committed by GitHub
parent 402ee6fdfc
commit 109f9e9ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -359,7 +359,8 @@ module cva6_ptw_sv32 import ariane_pkg::*; #(
// 1. in the PTE Lookup check whether we still need to wait for an rvalid
// 2. waiting for a grant, if so: wait for it
// if not, go back to idle
if ((state_q == PTE_LOOKUP && !data_rvalid_q) || ((state_q == WAIT_GRANT) && req_port_i.data_gnt))
if (((state_q inside {PTE_LOOKUP, WAIT_RVALID}) && !data_rvalid_q) ||
((state_q == WAIT_GRANT) && req_port_i.data_gnt))
state_d = WAIT_RVALID;
else
state_d = LATENCY;

View file

@ -369,7 +369,8 @@ module ptw import ariane_pkg::*; #(
// 1. in the PTE Lookup check whether we still need to wait for an rvalid
// 2. waiting for a grant, if so: wait for it
// if not, go back to idle
if ((state_q == PTE_LOOKUP && !data_rvalid_q) || ((state_q == WAIT_GRANT) && req_port_i.data_gnt))
if (((state_q inside {PTE_LOOKUP, WAIT_RVALID}) && !data_rvalid_q) ||
((state_q == WAIT_GRANT) && req_port_i.data_gnt))
state_d = WAIT_RVALID;
else
state_d = IDLE;