2020-06-02 19:08:38 +08:00
|
|
|
/*!
|
|
|
|
\file MemoryInterface.h
|
|
|
|
\brief CPU to Memory Interface class
|
|
|
|
\author Màrius Montón
|
|
|
|
\date May 2020
|
|
|
|
*/
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
#ifndef INC_MEMORYINTERFACE_H_
|
|
|
|
#define INC_MEMORYINTERFACE_H_
|
|
|
|
|
|
|
|
#include "systemc"
|
|
|
|
|
|
|
|
#include "tlm.h"
|
|
|
|
#include "tlm_utils/simple_initiator_socket.h"
|
|
|
|
#include "tlm_utils/tlm_quantumkeeper.h"
|
|
|
|
|
|
|
|
#include "memory.h"
|
|
|
|
|
2021-11-30 03:35:26 +08:00
|
|
|
namespace riscv_tlm {
|
|
|
|
|
2020-06-02 19:08:38 +08:00
|
|
|
/**
|
|
|
|
* @brief Memory Interface
|
|
|
|
*/
|
2021-11-30 03:35:26 +08:00
|
|
|
class MemoryInterface {
|
|
|
|
public:
|
|
|
|
|
|
|
|
tlm_utils::simple_initiator_socket<MemoryInterface> data_bus;
|
2020-06-02 19:08:38 +08:00
|
|
|
|
2021-11-30 03:35:26 +08:00
|
|
|
MemoryInterface();
|
2020-06-02 19:08:38 +08:00
|
|
|
|
2021-11-30 03:35:26 +08:00
|
|
|
std::uint32_t readDataMem(std::uint32_t addr, int size);
|
2020-06-02 19:08:38 +08:00
|
|
|
|
2021-11-30 03:35:26 +08:00
|
|
|
void writeDataMem(std::uint32_t addr, std::uint32_t data, int size);
|
|
|
|
};
|
|
|
|
}
|
2020-06-02 19:08:38 +08:00
|
|
|
#endif /* INC_MEMORYINTERFACE_H_ */
|