comm.hh revision 2665
11689SN/A/* 21689SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 31689SN/A * All rights reserved. 41689SN/A * 51689SN/A * Redistribution and use in source and binary forms, with or without 61689SN/A * modification, are permitted provided that the following conditions are 71689SN/A * met: redistributions of source code must retain the above copyright 81689SN/A * notice, this list of conditions and the following disclaimer; 91689SN/A * redistributions in binary form must reproduce the above copyright 101689SN/A * notice, this list of conditions and the following disclaimer in the 111689SN/A * documentation and/or other materials provided with the distribution; 121689SN/A * neither the name of the copyright holders nor the names of its 131689SN/A * contributors may be used to endorse or promote products derived from 141689SN/A * this software without specific prior written permission. 151689SN/A * 161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Kevin Lim 291689SN/A */ 301689SN/A 311755SN/A#ifndef __CPU_O3_CPU_COMM_HH__ 321755SN/A#define __CPU_O3_CPU_COMM_HH__ 331060SN/A 341061SN/A#include <vector> 351684SN/A 362165SN/A#include "arch/isa_traits.hh" 371060SN/A#include "cpu/inst_seq.hh" 381710SN/A#include "sim/host.hh" 391060SN/A 401060SN/A// Find better place to put this typedef. 411062SN/A// The impl might be the best place for this. 421060SN/Atypedef short int PhysRegIndex; 431060SN/A 441060SN/Atemplate<class Impl> 451060SN/Astruct SimpleFetchSimpleDecode { 461061SN/A typedef typename Impl::DynInstPtr DynInstPtr; 471061SN/A 481061SN/A int size; 491061SN/A 501461SN/A DynInstPtr insts[Impl::MaxWidth]; 511060SN/A}; 521060SN/A 531060SN/Atemplate<class Impl> 541060SN/Astruct SimpleDecodeSimpleRename { 551061SN/A typedef typename Impl::DynInstPtr DynInstPtr; 561061SN/A 571061SN/A int size; 581061SN/A 591461SN/A DynInstPtr insts[Impl::MaxWidth]; 601060SN/A}; 611060SN/A 621060SN/Atemplate<class Impl> 631060SN/Astruct SimpleRenameSimpleIEW { 641061SN/A typedef typename Impl::DynInstPtr DynInstPtr; 651061SN/A 661061SN/A int size; 671061SN/A 681461SN/A DynInstPtr insts[Impl::MaxWidth]; 691060SN/A}; 701060SN/A 711060SN/Atemplate<class Impl> 721060SN/Astruct SimpleIEWSimpleCommit { 731061SN/A typedef typename Impl::DynInstPtr DynInstPtr; 741061SN/A 751061SN/A int size; 761061SN/A 771461SN/A DynInstPtr insts[Impl::MaxWidth]; 781062SN/A 791062SN/A bool squash; 801062SN/A bool branchMispredict; 811062SN/A bool branchTaken; 821062SN/A uint64_t mispredPC; 831062SN/A uint64_t nextPC; 841062SN/A InstSeqNum squashedSeqNum; 851060SN/A}; 861060SN/A 871060SN/Atemplate<class Impl> 881060SN/Astruct IssueStruct { 891061SN/A typedef typename Impl::DynInstPtr DynInstPtr; 901061SN/A 911061SN/A int size; 921061SN/A 931461SN/A DynInstPtr insts[Impl::MaxWidth]; 941060SN/A}; 951060SN/A 961060SN/Astruct TimeBufStruct { 971060SN/A struct decodeComm { 981060SN/A bool squash; 991060SN/A bool stall; 1001060SN/A bool predIncorrect; 1011060SN/A uint64_t branchAddr; 1021060SN/A 1031062SN/A InstSeqNum doneSeqNum; 1041062SN/A 1051062SN/A // Might want to package this kind of branch stuff into a single 1061062SN/A // struct as it is used pretty frequently. 1071061SN/A bool branchMispredict; 1081061SN/A bool branchTaken; 1091061SN/A uint64_t mispredPC; 1101060SN/A uint64_t nextPC; 1111060SN/A }; 1121060SN/A 1131060SN/A decodeComm decodeInfo; 1141060SN/A 1151060SN/A // Rename can't actually tell anything to squash or send a new PC back 1161060SN/A // because it doesn't do anything along those lines. But maybe leave 1171060SN/A // these fields in here to keep the stages mostly orthagonal. 1181060SN/A struct renameComm { 1191060SN/A bool squash; 1201060SN/A bool stall; 1211060SN/A 1221060SN/A uint64_t nextPC; 1231060SN/A }; 1241060SN/A 1251060SN/A renameComm renameInfo; 1261060SN/A 1271060SN/A struct iewComm { 1281060SN/A bool stall; 1291060SN/A 1301060SN/A // Also eventually include skid buffer space. 1311060SN/A unsigned freeIQEntries; 1321060SN/A }; 1331060SN/A 1341060SN/A iewComm iewInfo; 1351060SN/A 1361060SN/A struct commitComm { 1371060SN/A bool squash; 1381060SN/A bool stall; 1391060SN/A unsigned freeROBEntries; 1401060SN/A 1411061SN/A bool branchMispredict; 1421061SN/A bool branchTaken; 1431061SN/A uint64_t mispredPC; 1441060SN/A uint64_t nextPC; 1451060SN/A 1461060SN/A bool robSquashing; 1471061SN/A 1481060SN/A // Represents the instruction that has either been retired or 1491060SN/A // squashed. Similar to having a single bus that broadcasts the 1501060SN/A // retired or squashed sequence number. 1511060SN/A InstSeqNum doneSeqNum; 1521061SN/A 1531684SN/A // Extra bit of information so that the LDSTQ only updates when it 1541061SN/A // needs to. 1551061SN/A bool commitIsLoad; 1561061SN/A 1571061SN/A // Communication specifically to the IQ to tell the IQ that it can 1581061SN/A // schedule a non-speculative instruction. 1591061SN/A InstSeqNum nonSpecSeqNum; 1601060SN/A }; 1611060SN/A 1621060SN/A commitComm commitInfo; 1631060SN/A}; 1641060SN/A 1651755SN/A#endif //__CPU_O3_CPU_COMM_HH__ 166