tage_base.hh (13626:d6a6358aa6db) | tage_base.hh (13685:bb3377c81303) |
---|---|
1/* 2 * Copyright (c) 2014 The University of Wisconsin 3 * 4 * Copyright (c) 2006 INRIA (Institut National de Recherche en 5 * Informatique et en Automatique / French National Research Institute 6 * for Computer Science and Applied Mathematics) 7 * 8 * All rights reserved. --- 303 unchanged lines hidden (view full) --- 312 /** 313 * Update TAGE for conditional branches. 314 * @param branch_pc The unshifted branch PC. 315 * @param taken Actual branch outcome. 316 * @param bi Pointer to information on the prediction 317 * recorded at prediction time. 318 * @nrand Random int number from 0 to 3 319 * @param corrTarget The correct branch target | 1/* 2 * Copyright (c) 2014 The University of Wisconsin 3 * 4 * Copyright (c) 2006 INRIA (Institut National de Recherche en 5 * Informatique et en Automatique / French National Research Institute 6 * for Computer Science and Applied Mathematics) 7 * 8 * All rights reserved. --- 303 unchanged lines hidden (view full) --- 312 /** 313 * Update TAGE for conditional branches. 314 * @param branch_pc The unshifted branch PC. 315 * @param taken Actual branch outcome. 316 * @param bi Pointer to information on the prediction 317 * recorded at prediction time. 318 * @nrand Random int number from 0 to 3 319 * @param corrTarget The correct branch target |
320 * @param pred Final prediction for this branch |
|
320 */ 321 virtual void condBranchUpdate( 322 ThreadID tid, Addr branch_pc, bool taken, BranchInfo* bi, | 321 */ 322 virtual void condBranchUpdate( 323 ThreadID tid, Addr branch_pc, bool taken, BranchInfo* bi, |
323 int nrand, Addr corrTarget); | 324 int nrand, Addr corrTarget, bool pred); |
324 325 /** 326 * TAGE prediction called from TAGE::predict 327 * @param tid The thread ID to select the global 328 * histories to use. 329 * @param branch_pc The unshifted branch PC. 330 * @param cond_branch True if the branch is conditional. 331 * @param bi Pointer to the BranchInfo --- 33 unchanged lines hidden (view full) --- 365 */ 366 virtual unsigned getUseAltIdx(BranchInfo* bi); 367 368 /** 369 * Extra calculation to tell whether TAGE allocaitons may happen or not 370 * on an update 371 * For this base TAGE implementation it does nothing 372 */ | 325 326 /** 327 * TAGE prediction called from TAGE::predict 328 * @param tid The thread ID to select the global 329 * histories to use. 330 * @param branch_pc The unshifted branch PC. 331 * @param cond_branch True if the branch is conditional. 332 * @param bi Pointer to the BranchInfo --- 33 unchanged lines hidden (view full) --- 366 */ 367 virtual unsigned getUseAltIdx(BranchInfo* bi); 368 369 /** 370 * Extra calculation to tell whether TAGE allocaitons may happen or not 371 * on an update 372 * For this base TAGE implementation it does nothing 373 */ |
373 virtual void adjustAlloc(bool & alloc, bool taken); | 374 virtual void adjustAlloc(bool & alloc, bool taken, bool pred_taken); |
374 375 /** 376 * Handles Allocation and U bits reset on an update 377 */ 378 virtual void handleAllocAndUReset( 379 bool alloc, bool taken, BranchInfo* bi, int nrand); 380 381 /** --- 13 unchanged lines hidden (view full) --- 395 virtual void resetUctr(uint8_t & u); 396 397 /** 398 * Extra steps for calculating altTaken 399 * For this base TAGE class it does nothing 400 */ 401 virtual void extraAltCalc(BranchInfo* bi); 402 | 375 376 /** 377 * Handles Allocation and U bits reset on an update 378 */ 379 virtual void handleAllocAndUReset( 380 bool alloc, bool taken, BranchInfo* bi, int nrand); 381 382 /** --- 13 unchanged lines hidden (view full) --- 396 virtual void resetUctr(uint8_t & u); 397 398 /** 399 * Extra steps for calculating altTaken 400 * For this base TAGE class it does nothing 401 */ 402 virtual void extraAltCalc(BranchInfo* bi); 403 |
403 /** 404 * Algorithm for returning a random number 405 * This base TAGE class just uses random_mt, but some derived classes 406 * may want to use a more realistic implementation or force some values 407 */ 408 static int getRandom(); 409 | |
410 void btbUpdate(ThreadID tid, Addr branch_addr, BranchInfo* &bi); 411 unsigned getGHR(ThreadID tid, BranchInfo *bi) const; 412 int8_t getCtr(int hitBank, int hitBankIndex) const; 413 unsigned getTageCtrBits() const; 414 int getPathHist(ThreadID tid) const; 415 bool isSpeculativeUpdateEnabled() const; 416 417 protected: --- 83 unchanged lines hidden --- | 404 void btbUpdate(ThreadID tid, Addr branch_addr, BranchInfo* &bi); 405 unsigned getGHR(ThreadID tid, BranchInfo *bi) const; 406 int8_t getCtr(int hitBank, int hitBankIndex) const; 407 unsigned getTageCtrBits() const; 408 int getPathHist(ThreadID tid) const; 409 bool isSpeculativeUpdateEnabled() const; 410 411 protected: --- 83 unchanged lines hidden --- |