summaryrefslogtreecommitdiff
path: root/backend/regfile.h
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-09-23 16:31:49 -0700
committerJulian Blake Kongslie2022-09-23 16:31:49 -0700
commit9eff3d214de18f413f5c7022c422bd097d678883 (patch)
tree3e281f0db9a70108e221b350cd56eb1000a69204 /backend/regfile.h
parentBasic IPC stats support (diff)
downloadprocmodel-9eff3d214de18f413f5c7022c422bd097d678883.tar.xz
Add some asserts.
Diffstat (limited to '')
-rw-r--r--backend/regfile.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/backend/regfile.h b/backend/regfile.h
index 4ea2f31..62177de 100644
--- a/backend/regfile.h
+++ b/backend/regfile.h
@@ -105,11 +105,13 @@ namespace backend {
105 if (!hazard) { 105 if (!hazard) {
106 auto i = instp.read(); 106 auto i = instp.read();
107 if (!(i.field[FLAGS_DST] & FLAG_IMM1)) { 107 if (!(i.field[FLAGS_DST] & FLAG_IMM1)) {
108 assert(!hazards[i.field[SRC1] % regs.size()]);
108 auto x = regs[i.field[SRC1] % regs.size()]; 109 auto x = regs[i.field[SRC1] % regs.size()];
109 pte(i.transaction, "", fmt::format("rf1[{}]={:x}", i.field[SRC1] % regs.size(), x)); 110 pte(i.transaction, "", fmt::format("rf1[{}]={:x}", i.field[SRC1] % regs.size(), x));
110 i.field[SRC1] = x; 111 i.field[SRC1] = x;
111 } 112 }
112 if (!(i.field[FLAGS_DST] & FLAG_IMM2)) { 113 if (!(i.field[FLAGS_DST] & FLAG_IMM2)) {
114 assert(!hazards[i.field[SRC2] % regs.size()]);
113 auto x = regs[i.field[SRC2] % regs.size()]; 115 auto x = regs[i.field[SRC2] % regs.size()];
114 pte(i.transaction, "", fmt::format("rf2[{}]={:x}", i.field[SRC2] % regs.size(), x)); 116 pte(i.transaction, "", fmt::format("rf2[{}]={:x}", i.field[SRC2] % regs.size(), x));
115 i.field[SRC2] = x; 117 i.field[SRC2] = x;
@@ -123,6 +125,7 @@ namespace backend {
123 case OP_STORE: 125 case OP_STORE:
124 break; 126 break;
125 default: 127 default:
128 assert(!hazards[i.field[FLAGS_DST] % regs.size()]);
126 hazards[i.field[FLAGS_DST] % regs.size()] = true; 129 hazards[i.field[FLAGS_DST] % regs.size()] = true;
127 break; 130 break;
128 } 131 }