/*****************************************************************\
*                                                                *
*  Copyright (C) Regents of University of California, 2003       *
*  This source code is a part of EXPRESSION project and is       *
*  copyrighted by the Regents of the University of California,   *
*  Irvine.                                                       *
*  The authors hereby grant permission to use this description   *
*  and its documentation for educational and non-commercial      *
*  purpose under the BSD license                                 *
*  (http://www.cecs.uci.edu/~express/BSD_License.txt). 	         *
*  The source code comes with no warranty and no author or       *
*  distributor accepts any responsibility for the consequences   *
*  of its use. Permission is granted to distribute this file in  *
*  compiled or executable form under the same conditions that    *
*  apply for source code. Permission is granted	to anyone to     *
*  make or distribute copies of this source code, either as      *
*  received or modified, in any medium, provided that all        *
*  copyright notices, permission and non warranty notices are    *
*  preserved, and that the distributor grants the recipient      *
*  permission for further redistribution as permitted by this    *
*  document. No written agreement, license, or royalty fee is    *
*  required for authorized use of this software.                 *
*                                                                *
*******************************************************************/
/*************************************************************
 *file  : AddrQueueInsn.h                                    *
 *authors : Sumit Gupta		                                 *
 *Written : 11th June 1999	                                 *
 *last modified : 8/10/99                                    *
 *                                                           *
 *contents : contains the AddrQueueInsn class definitions  and*
 *           associated classes.                             *
 *compiled with : g++                                        *
 *for more info :                                            *
 *caution : always grep for TODO to check for incompleteness *
 *************************************************************/
#ifndef _AddrQueueInsn_H_
#define _AddrQueueInsn_H_

//#include "LoadStorePipeline.h"
#include "DerivedLatchData.h"
//#include "DerivedAddrData.h"

/*************************************************************
 *class : AddrQueueInsn                                            *
 *description :   *
 *Methods :        *
 *Data Members :                                             *
 *ToDo List : *
 *************************************************************/
class AddrQueueInsn {
private:
  ThreeOpLatchData _instruction;

  StateType _state;	// _FRESH_, .....................
  HitType _hitWay;	// _MISS_, _HIT_WAY0_, _HIT_WAY1_
  Val _tagValue0;
  Val _tagValue1;
  Val _dataValue0;
  Val _dataValue1;
  AddrType _addrType;
  int _latency;
  TwoOpLatchData _physicalAddr;

public:

	AddrQueueInsn() {};
	AddrQueueInsn(ThreeOpLatchData );
	~AddrQueueInsn() {};
  
  void print(ostream & out);


  void setState(StateType newState);
  void setHitWay(HitType hitWay);
  void setPhysicalAddr(TwoOpLatchData newPhyAddr);

  void setTagValue0(Val tagValue);
  void setTagValue1(Val tagValue);
  void setDataValue0(Val dataValue);
  void setDataValue1(Val dataValue);
  void setAddrType(AddrType addrType);
  void setLatency(int latency);

  int getOpCode();			// from the instruction itself
  ThreeOpLatchData* getInstruction();
  StateType getState();
  HitType getHitWay();
  TwoOpLatchData getPhysicalAddr();
  long getAddress();
  AddrType getAddrType();
  Val getTagValue0();
  Val getTagValue1();
  Val getDataValue0();
  Val getDataValue1();
  int getLatency();
};

#endif // of #ifndef _AddrQueueInsn_H_
