From a98a2a1047bdba88ba42aef4e3f04ccb2eeb74b3 Mon Sep 17 00:00:00 2001 From: Jace Hensley Date: Sun, 15 Nov 2015 14:31:18 -0700 Subject: [PATCH 1/2] Set up violation check debug flag --- src/cpu/o3/SConscript | 1 + src/cpu/o3/store_set.cc | 31 +++++++------------------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/cpu/o3/SConscript b/src/cpu/o3/SConscript index b8f14cc..6c36789 100755 --- a/src/cpu/o3/SConscript +++ b/src/cpu/o3/SConscript @@ -73,6 +73,7 @@ if 'O3CPU' in env['CPU_MODELS']: DebugFlag('Scoreboard') DebugFlag('StoreSet') DebugFlag('Writeback') + DebugFlag('ViolationCheck') CompoundFlag('O3CPUAll', [ 'Fetch', 'Decode', 'Rename', 'IEW', 'Commit', 'IQ', 'ROB', 'FreeList', 'LSQ', 'LSQUnit', 'StoreSet', 'MemDepUnit', diff --git a/src/cpu/o3/store_set.cc b/src/cpu/o3/store_set.cc index acd4a8d..3c9376a 100644 --- a/src/cpu/o3/store_set.cc +++ b/src/cpu/o3/store_set.cc @@ -33,6 +33,7 @@ #include "base/trace.hh" #include "cpu/o3/store_set.hh" #include "debug/StoreSet.hh" +#include "debug/ViolationCheck.hh" StoreSet::StoreSet(uint64_t clear_period, int _SSIT_size, int _LFST_size) : clearPeriod(clear_period), SSITSize(_SSIT_size), LFSTSize(_LFST_size) @@ -119,6 +120,8 @@ StoreSet::violation(Addr store_PC, Addr load_PC) assert(load_index < SSITSize && store_index < SSITSize); + DPRINTF(ViolationCheck, "Load Index: %d, Store Index: %d", load_index, store_index); + bool valid_load_SSID = validSSIT[load_index]; bool valid_store_SSID = validSSIT[store_index]; @@ -239,34 +242,14 @@ StoreSet::checkInst(Addr PC) { int index = calcIndex(PC); - int inst_SSID; + int inst_SSID = SSIT[index]; assert(index < SSITSize); - if (!validSSIT[index]) { - DPRINTF(StoreSet, "Inst %#x with index %i had no SSID\n", - PC, index); - - // Return 0 if there's no valid entry. - return 0; - } else { - inst_SSID = SSIT[index]; - - assert(inst_SSID < LFSTSize); - - if (!validLFST[inst_SSID]) { + assert(inst_SSID < LFSTSize); - DPRINTF(StoreSet, "Inst %#x with index %i and SSID %i had no " - "dependency\n", PC, index, inst_SSID); - - return 0; - } else { - DPRINTF(StoreSet, "Inst %#x with index %i and SSID %i had LFST " - "inum of %i\n", PC, index, inst_SSID, LFST[inst_SSID]); - - return LFST[inst_SSID]; - } - } + // Need to return 0 if the trace file shows violation for this PC + return LFST[inst_SSID]; } void From cfc47e1c4d287d36bb6d4216959df1ca3785ba23 Mon Sep 17 00:00:00 2001 From: Jace Hensley Date: Mon, 16 Nov 2015 20:23:26 -0700 Subject: [PATCH 2/2] Start returning based on load index --- src/cpu/o3/store_set.cc | 43 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/cpu/o3/store_set.cc b/src/cpu/o3/store_set.cc index 3c9376a..167a1ad 100644 --- a/src/cpu/o3/store_set.cc +++ b/src/cpu/o3/store_set.cc @@ -120,8 +120,6 @@ StoreSet::violation(Addr store_PC, Addr load_PC) assert(load_index < SSITSize && store_index < SSITSize); - DPRINTF(ViolationCheck, "Load Index: %d, Store Index: %d", load_index, store_index); - bool valid_load_SSID = validSSIT[load_index]; bool valid_store_SSID = validSSIT[store_index]; @@ -180,6 +178,8 @@ StoreSet::violation(Addr store_PC, Addr load_PC) } else { SSIT[load_index] = store_SSID; + DPRINTF(ViolationCheck, "Load Index: %d, Store Index: %d", load_index, store_index); + DPRINTF(StoreSet, "StoreSet: Store had smaller store set: %i; " "for load %#x, store %#x\n", store_SSID, load_PC, store_PC); @@ -248,8 +248,43 @@ StoreSet::checkInst(Addr PC) assert(inst_SSID < LFSTSize); - // Need to return 0 if the trace file shows violation for this PC - return LFST[inst_SSID]; + if (index == 504 || + index == 88 || + index == 211 || + index == 207 || + index == 241 || + index == 237 || + index == 272 || + index == 322 || + index == 215 || + index == 245 || + index == 280 || + index == 333 || + index == 216 || + index == 232 || + index == 246 || + index == 281 || + index == 268 || + index == 195 || + index == 508 || + index == 531 || + index == 524 || + index == 739 || + index == 254 || + index == 263 || + index == 333 || + index == 195 || + index == 255 || + index == 815 || + index == 721 || + index == 290 || + index == 338 || + index == 509 + ) { + return LFST[inst_SSID]; + } + + return 0; } void