/******************************************************************************
    Copyright (c) 1998-2000 CoWare, Inc.    ALL RIGHTS RESERVED

The following code is derived, directly or indirectly, from the SystemC
source code released by Synopsys, Inc Copyright (c) 1996-2001, Synopsys,
Inc., CoWare, Inc., Frontier Design, Inc. and others. All Rights reserved.
The contents of this file are subject to the restrictions and limitations
set forth in the SystemC Open Source License Version 2.0 (the "License");
You may not use this file except in compliance with such restrictions and
limitations. You may obtain instructions on how to receive a copy of the
License at http://www.systemc.org/.  Software distributed by Contributors
under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License."

******************************************************************************/

/*****************************************************************************
    sc_refined_protocol -- refined singleton protocol implementation
			   as an aggregate
   

    Authors
	: Harish Sarin, CoWare Inc. (harish@coware.com)
	: Cesar Quiroz, CoWare Inc. (cesar@coware.com)
	: Vijay Kumar,  CoWare Inc. (vijay@coware.com)

    MODIFICATION LOG 
    Modifier Name & Affiliation:
    Description of Modification:

********************************************************************/
#ifndef SC_REFINED_PROTOCOL_H
#define SC_REFINED_PROTOCOL_H

#include "sc_simcontext.h"
#include "sc_protocol.h"
#include "sc_protocol_def.h"

template <class datatype>
SC_PROTOCOL(sc_enableHandshake) {
  public :  
  SC_OUTMASTER_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> en;
  };
  SC_INMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> en;
  };
  SC_INOUTMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> din;
    sc_terminal_out<datatype,TT_DATA> dout;
    sc_terminal_out<bool,TT_CONTROL> en;
    sc_terminal_out<bool,TT_CONTROL> nRW;
  };
  SC_OUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> en;
  };
  SC_INSLAVE_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> en;
  };
  SC_INOUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> din;
    sc_terminal_in<datatype,TT_DATA> dout;
    sc_terminal_in<bool,TT_CONTROL> en;
    sc_terminal_in<bool,TT_CONTROL> nRW;
  };
};



template <class datatype>
SC_PROTOCOL(sc_fullHandshake) {
  public:
  SC_OUTMASTER_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<bool,TT_CONTROL> req;
  };
  SC_INMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<bool,TT_CONTROL> req;
  };
  SC_INOUTMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> din;
    sc_terminal_out<datatype,TT_DATA> dout;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<bool,TT_CONTROL> req;
    sc_terminal_out<bool,TT_CONTROL> nRW;
 };
  SC_OUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_in<bool,TT_CONTROL> req;
  };
  SC_INSLAVE_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_in<bool,TT_CONTROL> req;
  };
  SC_INOUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> din;
    sc_terminal_in<datatype,TT_DATA> dout;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_in<bool,TT_CONTROL> req;
    sc_terminal_in<bool,TT_CONTROL> nRW;
 };

};


template <class datatype>
SC_PROTOCOL(sc_noHandshake) {
  public:
  SC_OUTMASTER_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
  };
  SC_INMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
  };
  SC_INOUTMASTER_RPC {
    sc_terminal_inout<datatype,TT_DATA> d;
 };
  SC_OUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
  };
  SC_INSLAVE_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
  };
  SC_INOUTSLAVE_RPC {
    sc_terminal_inout<datatype,TT_DATA> d;
 };

};


template<class datatype,int size,int adrwidth>
SC_PROTOCOL(sc_memenHandshake) {
  public :
  SC_OUTMASTER_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> en;
    sc_terminal_out<int,TT_ADDRESS> A;
  };
  SC_INMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> en;
    sc_terminal_out<int,TT_ADDRESS> A;
  };
  SC_INOUTMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> din;
    sc_terminal_out<datatype,TT_DATA> dout;
    sc_terminal_out<bool,TT_CONTROL> en;
    sc_terminal_out<bool,TT_CONTROL> nRW;
    sc_terminal_out<int,TT_ADDRESS> A;
 };
  SC_OUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> en;
    sc_terminal_in<int,TT_ADDRESS> A;
  };
  SC_INSLAVE_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> en;
    sc_terminal_in<int,TT_ADDRESS> A;
  };
  SC_INOUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> din;
    sc_terminal_in<datatype,TT_DATA> dout;
    sc_terminal_in<bool,TT_CONTROL> en;
    sc_terminal_in<bool,TT_CONTROL> nRW;
    sc_terminal_in<int,TT_ADDRESS> A;
 };
};

template<class datatype,int size,int adrwidth>
SC_PROTOCOL(sc_memfullHandshake) {
  public :
  SC_OUTMASTER_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> req;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<int,TT_ADDRESS> A;
  };
  SC_INMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_out<bool,TT_CONTROL> req;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<int,TT_ADDRESS> A;
  };
  SC_INOUTMASTER_RPC {
    sc_terminal_in<datatype,TT_DATA> din;
    sc_terminal_out<datatype,TT_DATA> dout;
    sc_terminal_out<bool,TT_CONTROL> req;
    sc_terminal_in<bool,TT_CONTROL> ack;
    sc_terminal_out<bool,TT_CONTROL> nRW;
    sc_terminal_out<int,TT_ADDRESS> A;
 };
  SC_OUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> req;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_out<int,TT_ADDRESS> A;
  };
  SC_INSLAVE_RPC {
    sc_terminal_in<datatype,TT_DATA> d;
    sc_terminal_in<bool,TT_CONTROL> req;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_in<int,TT_ADDRESS> A;
  };
  SC_INOUTSLAVE_RPC {
    sc_terminal_out<datatype,TT_DATA> din;
    sc_terminal_in<datatype,TT_DATA> dout;
    sc_terminal_in<bool,TT_CONTROL> req;
    sc_terminal_out<bool,TT_CONTROL> ack;
    sc_terminal_in<bool,TT_CONTROL> nRW;
    sc_terminal_in<int,TT_ADDRESS> A;
 };
};

template <class datatype>
SC_PROTOCOL(sc_abstract) {
  public:
  SC_MASTER_RPC {

  };
  SC_OUTMASTER_RPC {

  };
  SC_INMASTER_RPC {

  };
  SC_INOUTMASTER_RPC {

  };
  SC_SLAVE_RPC {

  };
  SC_OUTSLAVE_RPC {

  };
  SC_INSLAVE_RPC {

  };
  SC_INOUTSLAVE_RPC {

 };
   
};



#endif
