applies cklang-tidy fixes
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
#define EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_INITIATOR_H_
|
||||
|
||||
#include <cci_configuration>
|
||||
#include <tlm>
|
||||
#include <string>
|
||||
#include <tlm_utils/simple_initiator_socket.h>
|
||||
#include <scc/report.h>
|
||||
#include <string>
|
||||
#include <tlm>
|
||||
#include <tlm_utils/simple_initiator_socket.h>
|
||||
|
||||
/**
|
||||
* @class initiator
|
||||
@@ -46,7 +46,7 @@ SC_MODULE(initiator) {
|
||||
public:
|
||||
int data;
|
||||
|
||||
tlm_utils::simple_initiator_socket<initiator, 32> initiator_socket; ///< Instance of TLM2 simple initiator socket
|
||||
tlm_utils::simple_initiator_socket<initiator, 32> initiator_socket; ///< Instance of TLM2 simple initiator socket
|
||||
|
||||
/**
|
||||
* @fn initiator
|
||||
@@ -54,13 +54,13 @@ public:
|
||||
* @return void
|
||||
*/
|
||||
SC_CTOR(initiator)
|
||||
:
|
||||
data(0), initiator_socket("initiator_socket"), initiator_ID("initiator_ID", "initiator_default") {
|
||||
: data(0)
|
||||
, initiator_socket("initiator_socket")
|
||||
, initiator_ID("initiator_ID", "initiator_default") {
|
||||
SCCINFO(SCMOD) << "[" << initiator_ID.get_value() << " C_TOR] ------- [INITIATOR CONSTRUCTOR BEGINS HERE] --------";
|
||||
|
||||
// initiator's SC_THREAD declaration
|
||||
SC_THREAD(run_initiator);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,18 +69,18 @@ public:
|
||||
* @return void
|
||||
*/
|
||||
void run_initiator(void) {
|
||||
tlm::tlm_generic_payload *trans = new tlm::tlm_generic_payload;
|
||||
tlm::tlm_generic_payload* trans = new tlm::tlm_generic_payload;
|
||||
|
||||
int i = 0;
|
||||
|
||||
static tlm::tlm_command cmds[8] =
|
||||
{ tlm::TLM_WRITE_COMMAND, tlm::TLM_READ_COMMAND, tlm::TLM_WRITE_COMMAND, tlm::TLM_READ_COMMAND, tlm::TLM_READ_COMMAND,
|
||||
tlm::TLM_READ_COMMAND, tlm::TLM_WRITE_COMMAND, tlm::TLM_WRITE_COMMAND };
|
||||
while (1) {
|
||||
static tlm::tlm_command cmds[8] = {tlm::TLM_WRITE_COMMAND, tlm::TLM_READ_COMMAND, tlm::TLM_WRITE_COMMAND, tlm::TLM_READ_COMMAND,
|
||||
tlm::TLM_READ_COMMAND, tlm::TLM_READ_COMMAND, tlm::TLM_WRITE_COMMAND, tlm::TLM_WRITE_COMMAND};
|
||||
while(1) {
|
||||
tlm::tlm_command cmd = cmds[(i >> 2) % 8];
|
||||
//static_cast<tlm::tlm_command>(cmd_dist(rng));
|
||||
// static_cast<tlm::tlm_command>(cmd_dist(rng));
|
||||
|
||||
if (cmd == tlm::TLM_WRITE_COMMAND) data = 0xFF000000 | i;
|
||||
if(cmd == tlm::TLM_WRITE_COMMAND)
|
||||
data = 0xFF000000 | i;
|
||||
|
||||
trans->set_command(cmd);
|
||||
trans->set_address(i);
|
||||
@@ -92,27 +92,28 @@ public:
|
||||
trans->set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
|
||||
sc_core::sc_time delay = sc_core::sc_time(0, sc_core::SC_NS);
|
||||
|
||||
if (cmd == tlm::TLM_WRITE_COMMAND) {
|
||||
if(cmd == tlm::TLM_WRITE_COMMAND) {
|
||||
SCCINFO(SCMOD) << "[Initiators Message]=>At address " << std::hex << i << " sending transaction with command = Write"
|
||||
<< ", data=" << std::hex << data << " at time " << sc_core::sc_time_stamp();
|
||||
<< ", data=" << std::hex << data << " at time " << sc_core::sc_time_stamp();
|
||||
} else {
|
||||
SCCINFO(SCMOD) << "[Initiators Message]=>At address " << std::hex << i << " sending transaction with command= Read "
|
||||
<< " at time " << sc_core::sc_time_stamp();
|
||||
<< " at time " << sc_core::sc_time_stamp();
|
||||
}
|
||||
|
||||
initiator_socket->b_transport(*trans, delay);
|
||||
|
||||
if (trans->is_response_error())
|
||||
SCCERR(SCMOD) << "TLM_2" << trans->get_response_string().c_str();
|
||||
if(trans->is_response_error())
|
||||
SCCERR(SCMOD) << "TLM_2" << trans->get_response_string().c_str();
|
||||
|
||||
if (delay.to_double() != 0) wait(delay);
|
||||
if(delay.to_double() != 0)
|
||||
wait(delay);
|
||||
|
||||
if (cmd == tlm::TLM_WRITE_COMMAND) {
|
||||
if(cmd == tlm::TLM_WRITE_COMMAND) {
|
||||
SCCINFO(SCMOD) << "[Initiators Message]=>At address " << std::hex << i << " received response of Write transaction "
|
||||
<< " at time " << sc_core::sc_time_stamp();
|
||||
<< " at time " << sc_core::sc_time_stamp();
|
||||
} else {
|
||||
SCCINFO(SCMOD) << "[Initiators Message]=>At address " << std::hex << i << " received response of Read transaction "
|
||||
<< " data " << data << " at time " << sc_core::sc_time_stamp();
|
||||
<< " data " << data << " at time " << sc_core::sc_time_stamp();
|
||||
}
|
||||
|
||||
SCCINFO(SCMOD) << "--------------------------------------------------------";
|
||||
@@ -124,17 +125,15 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
cci::cci_param<std::string, cci::CCI_MUTABLE_PARAM> initiator_ID; ///< Elab Time Param for assigning initiator ID (initialized by top_module)
|
||||
cci::cci_param<std::string, cci::CCI_MUTABLE_PARAM>
|
||||
initiator_ID; ///< Elab Time Param for assigning initiator ID (initialized by top_module)
|
||||
/**
|
||||
* @fn void end_of_elaboration()
|
||||
* @brief end of elaboration function to lock structural param
|
||||
* @return void
|
||||
*/
|
||||
void end_of_elaboration() {
|
||||
initiator_ID.lock();
|
||||
}
|
||||
|
||||
void end_of_elaboration() { initiator_ID.lock(); }
|
||||
};
|
||||
// initiator
|
||||
// initiator
|
||||
|
||||
#endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_INITIATOR_H_
|
||||
#endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_INITIATOR_H_
|
||||
|
Reference in New Issue
Block a user