icache/dcache tag+data arrays now implemented using Mem4()
however there seems to be a bug - readLatency needs to be set to 0 for C model to work, and 1 for Verilog model.
This commit is contained in:
parent
e894b79870
commit
ff95cacb55
@ -252,8 +252,6 @@ class rocketDCacheDM(lines: Int) extends Component {
|
|||||||
val tag_array = Mem4(lines, r_cpu_req_ppn);
|
val tag_array = Mem4(lines, r_cpu_req_ppn);
|
||||||
tag_array.setReadLatency(0);
|
tag_array.setReadLatency(0);
|
||||||
val tag_rdata = tag_array.rw(tag_addr, r_cpu_req_ppn, tag_we);
|
val tag_rdata = tag_array.rw(tag_addr, r_cpu_req_ppn, tag_we);
|
||||||
// tag_array.write(tag_addr, r_cpu_req_ppn, tag_we);
|
|
||||||
// val tag_rdata = tag_array(tag_addr);
|
|
||||||
|
|
||||||
// valid bit array
|
// valid bit array
|
||||||
val vb_array = Reg(resetVal = Bits(0, lines));
|
val vb_array = Reg(resetVal = Bits(0, lines));
|
||||||
@ -370,8 +368,6 @@ class rocketDCacheDM(lines: Int) extends Component {
|
|||||||
val data_array = Mem4(lines*4, data_wdata);
|
val data_array = Mem4(lines*4, data_wdata);
|
||||||
data_array.setReadLatency(0);
|
data_array.setReadLatency(0);
|
||||||
val data_array_rdata = data_array.rw(data_addr, data_wdata, data_we, data_wmask);
|
val data_array_rdata = data_array.rw(data_addr, data_wdata, data_we, data_wmask);
|
||||||
// data_array.write(data_addr, data_wdata, data_we, data_wmask);
|
|
||||||
// val data_array_rdata = data_array(data_addr);
|
|
||||||
val resp_data = Mux(r_cpu_req_idx(offsetlsb).toBool, data_array_rdata(127, 64), data_array_rdata(63,0));
|
val resp_data = Mux(r_cpu_req_idx(offsetlsb).toBool, data_array_rdata(127, 64), data_array_rdata(63,0));
|
||||||
val r_resp_data = Reg(resp_data);
|
val r_resp_data = Reg(resp_data);
|
||||||
|
|
||||||
|
@ -87,9 +87,6 @@ class rocketICacheDM(lines: Int) extends Component {
|
|||||||
tag_array.setReadLatency(0);
|
tag_array.setReadLatency(0);
|
||||||
val tag_rdata = tag_array.rw(tag_addr, r_cpu_req_ppn, tag_we);
|
val tag_rdata = tag_array.rw(tag_addr, r_cpu_req_ppn, tag_we);
|
||||||
|
|
||||||
// tag_array.write(tag_addr, r_cpu_req_ppn, tag_we);
|
|
||||||
// val tag_rdata = tag_array.read(tag_addr);
|
|
||||||
|
|
||||||
// valid bit array
|
// valid bit array
|
||||||
val vb_array = Reg(resetVal = Bits(0, lines));
|
val vb_array = Reg(resetVal = Bits(0, lines));
|
||||||
when (io.cpu.invalidate) {
|
when (io.cpu.invalidate) {
|
||||||
@ -109,8 +106,6 @@ class rocketICacheDM(lines: Int) extends Component {
|
|||||||
val data_array = Mem4(lines*4, io.mem.resp_data);
|
val data_array = Mem4(lines*4, io.mem.resp_data);
|
||||||
data_array.setReadLatency(0);
|
data_array.setReadLatency(0);
|
||||||
val data_array_rdata = data_array.rw(data_addr, io.mem.resp_data, io.mem.resp_val);
|
val data_array_rdata = data_array.rw(data_addr, io.mem.resp_data, io.mem.resp_val);
|
||||||
// data_array.write(data_addr, io.mem.resp_data, io.mem.resp_val);
|
|
||||||
// val data_array_rdata = data_array.read(data_addr);
|
|
||||||
|
|
||||||
// output signals
|
// output signals
|
||||||
io.cpu.resp_val := !io.cpu.itlb_miss && (state === s_ready) && r_cpu_req_val && tag_valid && tag_match;
|
io.cpu.resp_val := !io.cpu.itlb_miss && (state === s_ready) && r_cpu_req_val && tag_valid && tag_match;
|
||||||
|
Loading…
Reference in New Issue
Block a user