Code Search for Developers
 
 
  

PLB.h from GreenSocs at Krugle


Show PLB.h syntax highlighted

/*
Copyright (c) 2006 : Technical University of Braunschweig, Germany

All rights reserved.

Authors: Robert Guenzel, Wolfgang Klingauf, TU Braunschweig, E.I.S.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.  Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.  Neither the name of
the Technical University of Braunschweig, Germany nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __PLB_h__
#define __PLB_h__

#include "gstlm/attributes.h"
#include "protocol/generic.h"

/**
 *
 */

using namespace tlm;

ATTRIBUTE (MPrio, class_wrapper<unsigned int>, "PLB Master priority");

#define PLBPHASES PLBPhase::SecondaryRequest, PLBPhase::WrPrim, PLBPhase::RdPrim

namespace PLB {

  // the PLB additional phases
  namespace PLBPhase
  {
    enum {
      SecondaryRequest = GenericPhase::LAST_GENERIC_PHASE,
      WrPrim,
      RdPrim
    };
  };

  class PLBMasterAccess : public virtual GenericMasterAccess {

  public :

    virtual void set_mPrio(const MPrio&) =0;
    virtual const MPrio& get_mPrio() const =0;

  };

  class PLBTargetAccess : public virtual GenericTargetAccess {

  public :

    virtual const MPrio& get_mPrio() const =0;

  };

  class PLBRouterAccess : public virtual GenericRouterAccess {

  public :
    virtual const MPrio& get_mPrio() const =0;

  };

  class PLBTransaction :
    public PLBMasterAccess,
    public PLBTargetAccess,
    public PLBRouterAccess,
    public GenericTransaction 
  {

 private:
    MPrio mPrio;

  public:
    void set_mPrio(const MPrio& _mPrio) {mPrio=_mPrio;};
    const MPrio& get_mPrio() const {return mPrio;}

    PLBTransaction() :GenericTransaction(), mPrio(1)
    {
      is_extended=true;
      extendedType="PLB";
      INITATTRIBUTE(mPrio);
      ADDEXTTOPHASE(mPrio, REQUESTPHASE, DATAPHASE, RESPONSEPHASE, PLBPHASES);
      ADDTOPHASE(mCmd, PLBPhase::SecondaryRequest);
      ADDTOPHASE(mAddr,PLBPHASES);    
      ADDTOPHASE(msData,PLBPhase::WrPrim);    
      ADDTOPHASE(mBurstLength,PLBPhase::SecondaryRequest);    
      ADDTOPHASE(mID, PLBPHASES);   
    }

  };

  typedef boost::shared_ptr<PLBTransaction> PLBTransaction_P;



typedef GenericInitiatorAPI<master_port<GenericTransaction, PLBMasterAccess, GenericPhase, PLBTransaction > > PLBMasterPort;
typedef GenericTargetAPI<target_port<GenericTransaction, GenericTargetAccess, GenericPhase> > PLBTargetPort;

}

#endif




See more files for this project here

GreenSocs

To develop SystemC infrustructure, basic IP, patches and add on library code for eventual standerdization.\r\nThe GreenSocs project is made up of a number of contributions (sub projects). Please visit www.greensocs.com for more information.

Project homepage: http://sourceforge.net/projects/greensocs
Programming language(s): C,C++,Java,Perl,XML
License: other

  PLB.h
  generic.dynamic_casts.h
  generic.h
  generic.static_casts.h
  generic2.h
  splitcomplete.h