From 34742515f53fa807faa1809ef3cc7d319b9a244e Mon Sep 17 00:00:00 2001 From: Erik Hallnor Date: Tue, 28 Sep 2004 16:55:55 -0400 Subject: Add opt cpu and fix page copy warnings SConscript: Add opt_cpu cpu/simple_cpu/simple_cpu.cc: Fix page spanning copy warning. cpu/trace/reader/itx_reader.cc: Fix reader to return correct address. --HG-- extra : convert_revision : f03e244971af4197743c7c717d64f21db0ae42d3 --- cpu/trace/reader/itx_reader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpu/trace/reader') diff --git a/cpu/trace/reader/itx_reader.cc b/cpu/trace/reader/itx_reader.cc index 615eb414e..56f06c870 100644 --- a/cpu/trace/reader/itx_reader.cc +++ b/cpu/trace/reader/itx_reader.cc @@ -102,6 +102,7 @@ ITXReader::getNextReq(MemReqPtr &req) } else { codePhysAddr += tmp_req->size; } + assert(tmp_req->paddr >> 36 == 0); } else { codePhysValid = false; } @@ -130,13 +131,13 @@ ITXReader::getNextReq(MemReqPtr &req) // Get the page offset from the virtual address. tmp_req->paddr = tmp_req->vaddr & 0xfff; tmp_req->paddr |= (c & 0xf0) << 8; - tmp_req->paddr |= (Addr)(c & 0xf0) << 32; + tmp_req->paddr |= (Addr)(c & 0x0f) << 32; for (int i = 2; i < 4; ++i) { c = getc(trace); if (c == EOF) { fatal("Unexpected end of trace file."); } - tmp_req->paddr |= (c & 0xff) << (8 * i); + tmp_req->paddr |= (Addr)(c & 0xff) << (8 * i); } if (type == ITXCode) { if (((tmp_req->paddr & 0xfff) + tmp_req->size) @@ -149,6 +150,7 @@ ITXReader::getNextReq(MemReqPtr &req) codePhysValid = true; } } + assert(tmp_req->paddr >> 36 == 0); } else if (type == ITXCode) { codePhysValid = false; } @@ -175,6 +177,7 @@ ITXReader::getNextReq(MemReqPtr &req) } } while (!phys_val); req = tmp_req; + assert(!req || (req->paddr >> 36) == 0); return 0; } -- cgit v1.2.3