RubyRequest.hh revision 8092:6782b51ae8a8
19919Ssteve.reinhardt@amd.com/*
213610Sgiacomo.gabrielli@arm.com * Copyright (c) 2009 Mark D. Hill and David A. Wood
312109SRekai.GonzalezAlberquilla@arm.com * All rights reserved.
412109SRekai.GonzalezAlberquilla@arm.com *
512109SRekai.GonzalezAlberquilla@arm.com * Redistribution and use in source and binary forms, with or without
612109SRekai.GonzalezAlberquilla@arm.com * modification, are permitted provided that the following conditions are
712109SRekai.GonzalezAlberquilla@arm.com * met: redistributions of source code must retain the above copyright
812109SRekai.GonzalezAlberquilla@arm.com * notice, this list of conditions and the following disclaimer;
912109SRekai.GonzalezAlberquilla@arm.com * redistributions in binary form must reproduce the above copyright
1012109SRekai.GonzalezAlberquilla@arm.com * notice, this list of conditions and the following disclaimer in the
1112109SRekai.GonzalezAlberquilla@arm.com * documentation and/or other materials provided with the distribution;
1212109SRekai.GonzalezAlberquilla@arm.com * neither the name of the copyright holders nor the names of its
1312109SRekai.GonzalezAlberquilla@arm.com * contributors may be used to endorse or promote products derived from
149919Ssteve.reinhardt@amd.com * this software without specific prior written permission.
159919Ssteve.reinhardt@amd.com *
169919Ssteve.reinhardt@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179919Ssteve.reinhardt@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
189919Ssteve.reinhardt@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
199919Ssteve.reinhardt@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
209919Ssteve.reinhardt@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
219919Ssteve.reinhardt@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
229919Ssteve.reinhardt@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239919Ssteve.reinhardt@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249919Ssteve.reinhardt@amd.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259919Ssteve.reinhardt@amd.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
269919Ssteve.reinhardt@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279919Ssteve.reinhardt@amd.com */
289919Ssteve.reinhardt@amd.com
299919Ssteve.reinhardt@amd.com#ifndef __MEM_RUBY_SLICC_INTERFACE_RUBY_REQUEST_HH__
309919Ssteve.reinhardt@amd.com#define __MEM_RUBY_SLICC_INTERFACE_RUBY_REQUEST_HH__
319919Ssteve.reinhardt@amd.com
329919Ssteve.reinhardt@amd.com#include <ostream>
339919Ssteve.reinhardt@amd.com
349919Ssteve.reinhardt@amd.com#include "mem/packet.hh"
359919Ssteve.reinhardt@amd.com#include "mem/protocol/AccessModeType.hh"
369919Ssteve.reinhardt@amd.com#include "mem/protocol/CacheRequestType.hh"
379919Ssteve.reinhardt@amd.com#include "mem/protocol/Message.hh"
389919Ssteve.reinhardt@amd.com#include "mem/protocol/PrefetchBit.hh"
399919Ssteve.reinhardt@amd.com#include "mem/ruby/common/Address.hh"
409919Ssteve.reinhardt@amd.com
419919Ssteve.reinhardt@amd.comtypedef void* RubyPortHandle;
429919Ssteve.reinhardt@amd.comenum RubyRequestType {
439919Ssteve.reinhardt@amd.com  RubyRequestType_NULL,
449919Ssteve.reinhardt@amd.com  RubyRequestType_IFETCH,
459919Ssteve.reinhardt@amd.com  RubyRequestType_LD,
469919Ssteve.reinhardt@amd.com  RubyRequestType_ST,
479919Ssteve.reinhardt@amd.com  RubyRequestType_Load_Linked,
4811793Sbrandon.potter@amd.com  RubyRequestType_Store_Conditional,
4912109SRekai.GonzalezAlberquilla@arm.com  RubyRequestType_RMW_Read,
5012109SRekai.GonzalezAlberquilla@arm.com  RubyRequestType_RMW_Write,
519919Ssteve.reinhardt@amd.com  RubyRequestType_Locked_RMW_Read,
529919Ssteve.reinhardt@amd.com  RubyRequestType_Locked_RMW_Write,
539920Syasuko.eckert@amd.com  RubyRequestType_NUM
5412109SRekai.GonzalezAlberquilla@arm.com};
5513610Sgiacomo.gabrielli@arm.com
5612109SRekai.GonzalezAlberquilla@arm.comenum RubyAccessMode {
5712109SRekai.GonzalezAlberquilla@arm.com  RubyAccessMode_User,
589919Ssteve.reinhardt@amd.com  RubyAccessMode_Supervisor,
599919Ssteve.reinhardt@amd.com  RubyAccessMode_Device
6012109SRekai.GonzalezAlberquilla@arm.com};
6113610Sgiacomo.gabrielli@arm.com
629920Syasuko.eckert@amd.comclass RubyRequest
6312105Snathanael.premillieu@arm.com{
6412105Snathanael.premillieu@arm.com  public:
6512109SRekai.GonzalezAlberquilla@arm.com    uint64_t paddr;
6612109SRekai.GonzalezAlberquilla@arm.com    uint8_t* data;
6712109SRekai.GonzalezAlberquilla@arm.com    int len;
6813610Sgiacomo.gabrielli@arm.com    uint64_t pc;
6912105Snathanael.premillieu@arm.com    RubyRequestType type;
709920Syasuko.eckert@amd.com    RubyAccessMode access_mode;
719920Syasuko.eckert@amd.com    PacketPtr pkt;
7212109SRekai.GonzalezAlberquilla@arm.com    unsigned proc_id;
7312109SRekai.GonzalezAlberquilla@arm.com
7413610Sgiacomo.gabrielli@arm.com    RubyRequest() {}
7512109SRekai.GonzalezAlberquilla@arm.com    RubyRequest(uint64_t _paddr,
7612109SRekai.GonzalezAlberquilla@arm.com                uint8_t* _data,
779919Ssteve.reinhardt@amd.com                int _len,
7812105Snathanael.premillieu@arm.com                uint64_t _pc,
7912105Snathanael.premillieu@arm.com                RubyRequestType _type,
8012105Snathanael.premillieu@arm.com                RubyAccessMode _access_mode,
819920Syasuko.eckert@amd.com                PacketPtr _pkt,
829920Syasuko.eckert@amd.com                unsigned _proc_id = 100)
839920Syasuko.eckert@amd.com        : paddr(_paddr),
849920Syasuko.eckert@amd.com          data(_data),
859920Syasuko.eckert@amd.com          len(_len),
869920Syasuko.eckert@amd.com          pc(_pc),
8712105Snathanael.premillieu@arm.com          type(_type),
8812105Snathanael.premillieu@arm.com          access_mode(_access_mode),
8912105Snathanael.premillieu@arm.com          pkt(_pkt),
9012105Snathanael.premillieu@arm.com          proc_id(_proc_id)
9112105Snathanael.premillieu@arm.com    {}
9212105Snathanael.premillieu@arm.com
9312105Snathanael.premillieu@arm.com    void print(std::ostream& out) const;
9412105Snathanael.premillieu@arm.com};
9512105Snathanael.premillieu@arm.com
9612105Snathanael.premillieu@arm.comstd::string RubyRequestType_to_string(const RubyRequestType& obj);
9712105Snathanael.premillieu@arm.comRubyRequestType string_to_RubyRequestType(std::string);
9812109SRekai.GonzalezAlberquilla@arm.comstd::ostream& operator<<(std::ostream& out, const RubyRequestType& obj);
9912109SRekai.GonzalezAlberquilla@arm.comstd::ostream& operator<<(std::ostream& out, const RubyRequest& obj);
10012109SRekai.GonzalezAlberquilla@arm.com
10112109SRekai.GonzalezAlberquilla@arm.com#endif
10212109SRekai.GonzalezAlberquilla@arm.com