1
0

Support CSR atomics on all CSRs, not just STATUS

This commit is contained in:
Andrew Waterman
2014-01-21 16:17:39 -08:00
parent 6ba2c1abe5
commit a7489920ce
2 changed files with 18 additions and 22 deletions

View File

@ -281,7 +281,9 @@ class Datapath(implicit conf: RocketConfiguration) extends Module
// processor control regfile write
pcr.io.rw.addr := wb_reg_inst(31,20)
pcr.io.rw.cmd := io.ctrl.csr
pcr.io.rw.wdata := wb_reg_wdata
pcr.io.rw.wdata := Mux(io.ctrl.csr === CSR.S, pcr.io.rw.rdata | wb_reg_wdata,
Mux(io.ctrl.csr === CSR.C, pcr.io.rw.rdata & ~wb_reg_wdata,
wb_reg_wdata))
io.rocc.cmd.bits.inst := new RoCCInstruction().fromBits(wb_reg_inst)
io.rocc.cmd.bits.rs1 := wb_reg_wdata