Line 6... |
Line 6... |
*/
|
*/
|
|
|
#ifndef __DEBUGGER_IMEMOP_PLUGIN_H__
|
#ifndef __DEBUGGER_IMEMOP_PLUGIN_H__
|
#define __DEBUGGER_IMEMOP_PLUGIN_H__
|
#define __DEBUGGER_IMEMOP_PLUGIN_H__
|
|
|
#include "iface.h"
|
|
#include <inttypes.h>
|
#include <inttypes.h>
|
#include "isocinfo.h"
|
#include <iface.h>
|
|
#include <attribute.h>
|
|
|
namespace debugger {
|
namespace debugger {
|
|
class IService;
|
|
|
static const char *const IFACE_MEMORY_OPERATION = "IMemoryOperation";
|
static const char *const IFACE_MEMORY_OPERATION = "IMemoryOperation";
|
static const char *const IFACE_AXI4_NB_RESPONSE = "IAxi4NbResponse";
|
static const char *const IFACE_AXI4_NB_RESPONSE = "IAxi4NbResponse";
|
|
|
static const int PAYLOAD_MAX_BYTES = 8;
|
static const int PAYLOAD_MAX_BYTES = 8;
|
Line 29... |
Line 30... |
MemResp_Valid,
|
MemResp_Valid,
|
MemResp_Accepted,
|
MemResp_Accepted,
|
MemResp_Error
|
MemResp_Error
|
};
|
};
|
|
|
|
enum ETransStatus {
|
|
TRANS_OK,
|
|
TRANS_ERROR
|
|
};
|
|
|
typedef struct Axi4TransactionType {
|
typedef struct Axi4TransactionType {
|
EAxi4Action action;
|
EAxi4Action action;
|
EAxi4Response response;
|
EAxi4Response response;
|
uint32_t xsize; // [Bytes] Isn't used XSize AXI format!!!.
|
uint32_t xsize; // [Bytes] Isn't used XSize AXI format!!!.
|
uint32_t wstrb; // 1 bit per byte
|
uint32_t wstrb; // 1 bit per byte
|
Line 59... |
Line 65... |
/**
|
/**
|
* Slave/Targer interface
|
* Slave/Targer interface
|
*/
|
*/
|
class IMemoryOperation : public IFace {
|
class IMemoryOperation : public IFace {
|
public:
|
public:
|
IMemoryOperation() : IFace(IFACE_MEMORY_OPERATION) {}
|
IMemoryOperation() : IFace(IFACE_MEMORY_OPERATION) {
|
|
imap_.make_list(0);
|
|
listMap_.make_list(0);
|
|
baseAddress_.make_uint64(0);
|
|
length_.make_uint64(0);
|
|
}
|
|
|
|
/**
|
|
* Add new device to memory space. Mapping device has to implement
|
|
* IMemoryOperaton interface.
|
|
*/
|
|
virtual void map(IMemoryOperation *imemop) {
|
|
AttributeType t1(imemop);
|
|
imap_.add_to_list(&t1);
|
|
}
|
|
|
/**
|
/**
|
* Blocking transaction
|
* Blocking transaction
|
*
|
*
|
* Must be implemented by any functional/systemc device mapped into memory
|
* Must be implemented by any functional/systemc device mapped into memory
|
*/
|
*/
|
virtual void b_transport(Axi4TransactionType *trans) =0;
|
virtual ETransStatus b_transport(Axi4TransactionType *trans) = 0;
|
|
|
/**
|
/**
|
* Non-blocking transaction
|
* Non-blocking transaction
|
*
|
*
|
* Can be implemented for interaction with the SystemC model for an example.
|
* Can be implemented for interaction with the SystemC model for an example.
|
* Default implementation re-direct to blocking transport
|
* Default implementation re-direct to blocking transport
|
*/
|
*/
|
virtual void nb_transport(Axi4TransactionType *trans,
|
virtual ETransStatus nb_transport(Axi4TransactionType *trans,
|
IAxi4NbResponse *cb) {
|
IAxi4NbResponse *cb) {
|
b_transport(trans);
|
ETransStatus ret = b_transport(trans);
|
cb->nb_response(trans);
|
cb->nb_response(trans);
|
|
return ret;
|
|
}
|
|
|
|
virtual uint64_t getBaseAddress() { return baseAddress_.to_uint64(); }
|
|
virtual void setBaseAddress(uint64_t addr) {
|
|
baseAddress_.make_uint64(addr);
|
}
|
}
|
|
|
virtual uint64_t getBaseAddress() =0;
|
virtual uint64_t getLength() { return length_.to_uint64(); }
|
|
|
virtual uint64_t getLength() =0;
|
/** Higher value, higher priority */
|
|
virtual int getPriority() { return priority_.to_int(); }
|
|
virtual void setPriority(int v) { priority_.make_int64(v); }
|
|
|
|
protected:
|
|
friend class IService;
|
|
AttributeType listMap_;
|
|
AttributeType imap_;
|
|
AttributeType baseAddress_;
|
|
AttributeType length_;
|
|
AttributeType priority_;
|
};
|
};
|
|
|
} // namespace debugger
|
} // namespace debugger
|
|
|
#endif // __DEBUGGER_IMEMOP_PLUGIN_H__
|
#endif // __DEBUGGER_IMEMOP_PLUGIN_H__
|