IObundle / iob-cache

Verilog Configurable Cache
MIT License
167 stars 32 forks source link

why the "replace_req" should depend on (buffer_empty & write_ack_i)? #307

Open adonics opened 5 months ago

adonics commented 5 months ago

Hi SIr // back-end read channel assign replace_req_o = (~hit & read_access & ~replace_i) & (buffer_empty & write_ack_i); //write-through policy

It is said write-through doesn't adopt write allocate, why the "replace_req" should depend on (buffer_empty & write_ack_i)? best regards adonics

jjts commented 5 months ago

If the buffer is not empty, you can't guarantee that you are reading the last updated data. It prevents the cache line from being replaced with an old line.

adonics commented 4 months ago

thx, I try to understand that