applies cklang-tidy fixes
This commit is contained in:
@@ -32,13 +32,13 @@
|
||||
#define EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TOP_MODULE_H_
|
||||
|
||||
#include <cci_configuration>
|
||||
#include <scc/report.h>
|
||||
#include <sstream>
|
||||
#include <tlm>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <scc/report.h>
|
||||
|
||||
#include "router.h"
|
||||
#include "initiator.h"
|
||||
#include "router.h"
|
||||
#include "target.h"
|
||||
|
||||
/**
|
||||
@@ -52,8 +52,9 @@ public:
|
||||
* @brief The class constructor
|
||||
*/
|
||||
SC_CTOR(top_module)
|
||||
:
|
||||
n_initiators("number_of_initiators", 0), n_targets("number_of_targets", 0), m_broker(cci::cci_get_broker()) {
|
||||
: n_initiators("number_of_initiators", 0)
|
||||
, n_targets("number_of_targets", 0)
|
||||
, m_broker(cci::cci_get_broker()) {
|
||||
std::stringstream ss;
|
||||
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] -- [TOP MODULE CONSTRUCTOR BEGINS HERE]";
|
||||
@@ -80,14 +81,14 @@ public:
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
cci::cci_param_handle r_addr_limit_handle = m_broker.get_param_handle("top_module_inst.RouterInstance.addr_limit");
|
||||
if (r_addr_limit_handle.is_valid()) {
|
||||
if(r_addr_limit_handle.is_valid()) {
|
||||
r_addr_max = atoi((r_addr_limit_handle.get_cci_value().to_json()).c_str());
|
||||
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Router's maximum addressable limit : " << r_addr_max;
|
||||
}
|
||||
|
||||
/// Creating instances of initiator(s)
|
||||
for (int i = 0; i < n_initiators; i++) {
|
||||
for(int i = 0; i < n_initiators; i++) {
|
||||
snprintf(initiatorName, sizeof(initiatorName), "initiator_%d", i);
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Creating initiator : " << initiatorName;
|
||||
|
||||
@@ -107,7 +108,7 @@ public:
|
||||
targetSize = 128;
|
||||
|
||||
// Creating instances of target(s)
|
||||
for (int i = 0; i < n_targets; i++) {
|
||||
for(int i = 0; i < n_targets; i++) {
|
||||
snprintf(targetName, sizeof(targetName), "target_%d", i);
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Creating target : " << targetName;
|
||||
|
||||
@@ -131,7 +132,7 @@ public:
|
||||
}
|
||||
|
||||
// Try re-setting locked values for Router Table contents
|
||||
for (int i = 0; i < n_targets; i++) {
|
||||
for(int i = 0; i < n_targets; i++) {
|
||||
snprintf(targetName, sizeof(targetName), "%s.RouterInstance.r_index_%d", name(), i);
|
||||
ss.clear();
|
||||
ss.str("");
|
||||
@@ -140,7 +141,7 @@ public:
|
||||
try {
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Re-setting fields of target_" << i;
|
||||
m_broker.set_preset_cci_value(targetName, cci::cci_value::from_json(ss.str()));
|
||||
} catch (sc_core::sc_report const &exception) {
|
||||
} catch(sc_core::sc_report const& exception) {
|
||||
SCCINFO(SCMOD) << "[ROUTER : Caught] : " << exception.what();
|
||||
}
|
||||
|
||||
@@ -157,7 +158,7 @@ public:
|
||||
try {
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Re-setting start addr of target_" << i;
|
||||
m_broker.set_preset_cci_value(targetName, cci::cci_value::from_json(ss.str()));
|
||||
} catch (sc_core::sc_report const &exception) {
|
||||
} catch(sc_core::sc_report const& exception) {
|
||||
SCCINFO(SCMOD) << "[ROUTER : Caught] : " << exception.what();
|
||||
}
|
||||
|
||||
@@ -169,7 +170,7 @@ public:
|
||||
try {
|
||||
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Re-setting end addr of target_" << i;
|
||||
m_broker.set_preset_cci_value(targetName, cci::cci_value::from_json(ss.str()));
|
||||
} catch (sc_core::sc_report const &exception) {
|
||||
} catch(sc_core::sc_report const& exception) {
|
||||
SCCINFO(SCMOD) << "[ROUTER : Caught] : " << exception.what();
|
||||
}
|
||||
}
|
||||
@@ -181,16 +182,16 @@ public:
|
||||
* @return void
|
||||
*/
|
||||
~top_module() {
|
||||
if (!initiatorList.empty()) {
|
||||
for (std::vector<initiator*>::iterator it = initiatorList.begin(); it != initiatorList.end(); ++it) {
|
||||
delete (*it);
|
||||
if(!initiatorList.empty()) {
|
||||
for(std::vector<initiator*>::iterator it = initiatorList.begin(); it != initiatorList.end(); ++it) {
|
||||
delete(*it);
|
||||
}
|
||||
initiatorList.clear();
|
||||
}
|
||||
|
||||
if (!targetList.empty()) {
|
||||
for (std::vector<target*>::iterator it = targetList.begin(); it != targetList.end(); ++it) {
|
||||
delete (*it);
|
||||
if(!targetList.empty()) {
|
||||
for(std::vector<target*>::iterator it = targetList.begin(); it != targetList.end(); ++it) {
|
||||
delete(*it);
|
||||
}
|
||||
targetList.clear();
|
||||
}
|
||||
@@ -199,26 +200,25 @@ public:
|
||||
private:
|
||||
// Immutable type cci-parameters
|
||||
cci::cci_param<int, cci::CCI_IMMUTABLE_PARAM> n_initiators; ///< Number of initiators to be instantiated
|
||||
cci::cci_param<int, cci::CCI_IMMUTABLE_PARAM> n_targets; ///< Number of targets to be instantiated
|
||||
cci::cci_param<int, cci::CCI_IMMUTABLE_PARAM> n_targets; ///< Number of targets to be instantiated
|
||||
|
||||
cci::cci_broker_handle m_broker; ///< Configuration broker handle
|
||||
|
||||
router *routerInstance; ///< Declaration of a router pointer
|
||||
router* routerInstance; ///< Declaration of a router pointer
|
||||
|
||||
// STD::VECTORs for creating instances of initiator and target
|
||||
std::vector<initiator*> initiatorList; ///< STD::VECTOR for initiators
|
||||
std::vector<target*> targetList; ///< STD::VECTOR for targets
|
||||
std::vector<initiator*> initiatorList; ///< STD::VECTOR for initiators
|
||||
std::vector<target*> targetList; ///< STD::VECTOR for targets
|
||||
|
||||
char initiatorName[50]; ///< initiator_ID
|
||||
char targetName[50]; ///< target_ID
|
||||
char stringMisc[50]; ///< String to be used for misc things
|
||||
char targetBaseAddr[50]; ///< The base address of the target
|
||||
char initiatorName[50]; ///< initiator_ID
|
||||
char targetName[50]; ///< target_ID
|
||||
char stringMisc[50]; ///< String to be used for misc things
|
||||
char targetBaseAddr[50]; ///< The base address of the target
|
||||
|
||||
int addrValue
|
||||
{ 0 }; ///< Address Value
|
||||
int targetSize; ///< Maximum target Size (preset value)
|
||||
int r_addr_max; ///< Maximum Router Table's memory range
|
||||
int addrValue{0}; ///< Address Value
|
||||
int targetSize; ///< Maximum target Size (preset value)
|
||||
int r_addr_max; ///< Maximum Router Table's memory range
|
||||
};
|
||||
// top_module
|
||||
// top_module
|
||||
|
||||
#endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TOP_MODULE_H_
|
||||
#endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TOP_MODULE_H_
|
||||
|
Reference in New Issue
Block a user