PySysC-SC/vp_components/initiator.h

44 lines
986 B
C
Raw Normal View History

2018-11-30 11:08:08 +01:00
#ifndef INITIATOR_H
#define INITIATOR_H
#include "systemc"
using namespace sc_core;
using namespace sc_dt;
using namespace std;
#include "tlm.h"
#include "tlm_utils/simple_initiator_socket.h"
2019-01-06 15:26:13 +01:00
#include <scc/utilities.h>
2018-11-30 11:08:08 +01:00
// Initiator module generating generic payload transactions
struct Initiator: sc_module
{
// TLM-2 socket, defaults to 32-bits wide, base protocol
tlm_utils::simple_initiator_socket<Initiator> socket;
2019-01-03 21:18:09 +01:00
sc_core::sc_in<sc_core::sc_time> clk_i;
sc_core::sc_in<sc_dt::sc_logic> reset_i;
2018-11-30 11:08:08 +01:00
SC_HAS_PROCESS(Initiator);
Initiator( ::sc_core::sc_module_name );
void thread_process();
// TLM-2 backward DMI method
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range){
// Ignore range and invalidate all DMI pointers regardless
dmi_ptr_valid = false;
}
bool dmi_ptr_valid;
tlm::tlm_dmi dmi_data;
2019-01-06 15:26:13 +01:00
void trace(sc_core::sc_trace_file* trf) const override {
TRACE_VAR(trf, dmi_ptr_valid);
}
2018-11-30 11:08:08 +01:00
};
#endif