public void CheckBusConflict() { if (bus_q.Count == 0) { return; } BusTransaction last_trans = bus_q[bus_q.Count - 1]; MemAddr addr = last_trans.addr; for (int i = 0; i < rmax; i++) { for (int j = 0; j < bmax; j++) { if (cmdqs[i, j].Count == 0) { continue; } if (inflightqs[i, j][0].pid == inflightqs[addr.rid, addr.bid][0].pid) { continue; } if (cmdqs[i, j][0].type == Cmd.TypeEnum.READ) { if (cycles + (timing.tCL + timing.tBL) - last_trans.ts < timing.tBL) { if (chan.can_read((uint)i, (uint)j)) { Measurement.NVM_bus_conflict_set(cmdqs[i, j][0].pid); } } } else if (cmdqs[i, j][0].type == Cmd.TypeEnum.WRITE) { if (cycles + (timing.tCWL + timing.tBL) - last_trans.ts < timing.tBL) { if (chan.can_write((uint)i, (uint)j)) { Measurement.NVM_bus_conflict_set(cmdqs[i, j][0].pid); } } } } } }
private bool can_read(MemAddr addr) { return(chan.can_read(addr.rid, addr.bid)); }