Corona_with_TLM_FIFO/include/core.h

35 lines
925 B
C++

#pragma once
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <queue>
#include <iostream>
#include <vector>
#include <string>
#include <iostream>
#include <cstdlib> // For rand()
#include <ctime> // For time()
#include "configuration.h"
// Initiator module (processor core)
SC_MODULE(core) {
tlm_utils::simple_initiator_socket<core> socket;
tlm_utils::simple_target_socket<core> target_socket;
unsigned int source_router_id; // Source router ID for this core
unsigned int source_core_id;
SC_CTOR(core);
// Thread for sending data
void thread();
/// Forwarding function for receiving data from router
tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay);
void log_info(std::string msg);
void log_error(std::string msg);
};