Reformat all files.
This commit is contained in:
38
tests/tests_simulator/cache/TargetMemory.cpp
vendored
38
tests/tests_simulator/cache/TargetMemory.cpp
vendored
@@ -42,16 +42,16 @@
|
||||
|
||||
DECLARE_EXTENDED_PHASE(INTERNAL);
|
||||
|
||||
TargetMemory::TargetMemory(const sc_core::sc_module_name &name,
|
||||
TargetMemory::TargetMemory(const sc_core::sc_module_name& name,
|
||||
sc_core::sc_time acceptDelay,
|
||||
sc_core::sc_time memoryLatency,
|
||||
std::size_t bufferSize)
|
||||
: sc_core::sc_module(name),
|
||||
tSocket("tSocket"),
|
||||
bufferSize(bufferSize),
|
||||
acceptDelay(acceptDelay),
|
||||
memoryLatency(memoryLatency),
|
||||
peq(this, &TargetMemory::peqCallback)
|
||||
std::size_t bufferSize) :
|
||||
sc_core::sc_module(name),
|
||||
tSocket("tSocket"),
|
||||
bufferSize(bufferSize),
|
||||
acceptDelay(acceptDelay),
|
||||
memoryLatency(memoryLatency),
|
||||
peq(this, &TargetMemory::peqCallback)
|
||||
{
|
||||
tSocket.register_nb_transport_fw(this, &TargetMemory::nb_transport_fw);
|
||||
|
||||
@@ -59,9 +59,9 @@ TargetMemory::TargetMemory(const sc_core::sc_module_name &name,
|
||||
std::fill(memory.begin(), memory.end(), 0);
|
||||
}
|
||||
|
||||
tlm::tlm_sync_enum TargetMemory::nb_transport_fw(tlm::tlm_generic_payload &trans,
|
||||
tlm::tlm_phase &phase,
|
||||
sc_core::sc_time &delay)
|
||||
tlm::tlm_sync_enum TargetMemory::nb_transport_fw(tlm::tlm_generic_payload& trans,
|
||||
tlm::tlm_phase& phase,
|
||||
sc_core::sc_time& delay)
|
||||
{
|
||||
peq.notify(trans, phase, delay);
|
||||
return tlm::TLM_ACCEPTED;
|
||||
@@ -86,7 +86,7 @@ void TargetMemory::printBuffer(int max, int n)
|
||||
std::cout.flush();
|
||||
}
|
||||
|
||||
void TargetMemory::peqCallback(tlm::tlm_generic_payload &trans, const tlm::tlm_phase &phase)
|
||||
void TargetMemory::peqCallback(tlm::tlm_generic_payload& trans, const tlm::tlm_phase& phase)
|
||||
{
|
||||
sc_core::sc_time delay;
|
||||
|
||||
@@ -116,7 +116,7 @@ void TargetMemory::peqCallback(tlm::tlm_generic_payload &trans, const tlm::tlm_p
|
||||
responseInProgress = false;
|
||||
if (!responseQueue.empty())
|
||||
{
|
||||
tlm::tlm_generic_payload *next = responseQueue.front();
|
||||
tlm::tlm_generic_payload* next = responseQueue.front();
|
||||
responseQueue.pop();
|
||||
sendResponse(*next);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void TargetMemory::peqCallback(tlm::tlm_generic_payload &trans, const tlm::tlm_p
|
||||
}
|
||||
}
|
||||
|
||||
void TargetMemory::sendEndRequest(tlm::tlm_generic_payload &trans)
|
||||
void TargetMemory::sendEndRequest(tlm::tlm_generic_payload& trans)
|
||||
{
|
||||
tlm::tlm_phase bw_phase;
|
||||
sc_core::sc_time delay;
|
||||
@@ -165,7 +165,7 @@ void TargetMemory::sendEndRequest(tlm::tlm_generic_payload &trans)
|
||||
printBuffer(bufferSize, currentTransactions);
|
||||
}
|
||||
|
||||
void TargetMemory::sendResponse(tlm::tlm_generic_payload &trans)
|
||||
void TargetMemory::sendResponse(tlm::tlm_generic_payload& trans)
|
||||
{
|
||||
sc_assert(responseInProgress == false);
|
||||
|
||||
@@ -186,13 +186,13 @@ void TargetMemory::sendResponse(tlm::tlm_generic_payload &trans)
|
||||
trans.release();
|
||||
}
|
||||
|
||||
void TargetMemory::executeTransaction(tlm::tlm_generic_payload &trans)
|
||||
void TargetMemory::executeTransaction(tlm::tlm_generic_payload& trans)
|
||||
{
|
||||
tlm::tlm_command command = trans.get_command();
|
||||
sc_dt::uint64 address = trans.get_address();
|
||||
unsigned char *data_ptr = trans.get_data_ptr();
|
||||
unsigned char* data_ptr = trans.get_data_ptr();
|
||||
unsigned int data_length = trans.get_data_length();
|
||||
unsigned char *byte_enable_ptr = trans.get_byte_enable_ptr();
|
||||
unsigned char* byte_enable_ptr = trans.get_byte_enable_ptr();
|
||||
unsigned int streaming_width = trans.get_streaming_width();
|
||||
|
||||
if (address >= SIZE - 64)
|
||||
@@ -225,7 +225,7 @@ void TargetMemory::executeTransaction(tlm::tlm_generic_payload &trans)
|
||||
<< (command == tlm::TLM_WRITE_COMMAND ? "Exec. Write " : "Exec. Read ")
|
||||
<< "Addr = " << std::setfill('0') << std::setw(8) << std::dec << address << " Data = "
|
||||
<< "0x" << std::setfill('0') << std::setw(8) << std::hex
|
||||
<< *reinterpret_cast<int *>(data_ptr) << "\033[0m" << std::endl;
|
||||
<< *reinterpret_cast<int*>(data_ptr) << "\033[0m" << std::endl;
|
||||
|
||||
trans.set_response_status(tlm::TLM_OK_RESPONSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user