#ifndef IORESPONSEMUX_H
#define IORESPONSEMUX_H

#ifndef PROCESSOR_H
#error This file should be included in Processor.h
#endif

class IOResponseMultiplexer : public Object
{
private:
    RegisterFile&                m_regFile;

    struct IOResponse
    {
        IODeviceID  device;
        IOData      data;
    };
    Buffer<IOResponse>            m_incoming;

    typedef Buffer<RegAddr>       WriteBackQueue;
    std::vector<WriteBackQueue*>  m_wb_buffers;

    Process p_dummy;
    Result DoNothing() { return SUCCESS; }

public:
    IOResponseMultiplexer(const std::string& name, Object& parent, Clock& clock, RegisterFile& rf, size_t numDevices, Config& config);
    ~IOResponseMultiplexer();

    // sent by device select upon an I/O read from the processor
    bool QueueWriteBackAddress(IODeviceID dev, const RegAddr& addr);

    // triggered by the IOBusInterface
    bool OnReadResponseReceived(IODeviceID from, MemAddr address, const IOData& data);

    Process p_IncomingReadResponses;
    
    // upon data available on m_incoming
    Result DoReceivedReadResponses();
};



#endif

#ifndef IORESPONSEMUX_H
#define IORESPONSEMUX_H

#ifndef PROCESSOR_H
#error This file should be included in Processor.h
#endif

class IOResponseMultiplexer : public Object
{
private:
    RegisterFile&                m_regFile;

    struct IOResponse
    {
        IODeviceID  device;
        IOData      data;
    };
    Buffer<IOResponse>            m_incoming;

    typedef Buffer<RegAddr>       WriteBackQueue;
    std::vector<WriteBackQueue*>  m_wb_buffers;

    Process p_dummy;
    Result DoNothing() { p_dummy.Deactivate(); return SUCCESS; }

public:
    IOResponseMultiplexer(const std::string& name, Object& parent, Clock& clock, RegisterFile& rf, size_t numDevices, Config& config);
    ~IOResponseMultiplexer();

    // sent by device select upon an I/O read from the processor
    bool QueueWriteBackAddress(IODeviceID dev, const RegAddr& addr);

    // triggered by the IOBusInterface
    bool OnReadResponseReceived(IODeviceID from, MemAddr address, const IOData& data);

    Process p_IncomingReadResponses;
    
    // upon data available on m_incoming
    Result DoReceivedReadResponses();
};



#endif

Reduce the amount of process activity for incoming I/O read responses.
[mgsim-refactor] Reduce the amount of process activity for incoming I/O read responses.

git-svn-id: c257622338fa90c299bfd3fbe1eee5dac8caa856@4465 e97e5017-a994-416e-809d-76780e9f78db
