Code clean-up

This commit is contained in:
Màrius Montón 2021-11-11 14:53:26 +01:00
parent d8a20db976
commit d0f1d2f3b2
3 changed files with 5 additions and 10 deletions

View File

@ -67,7 +67,6 @@ void Memory::b_transport(tlm::tlm_generic_payload &trans,
return; return;
} }
// Obliged to implement read and write commands // Obliged to implement read and write commands
if (cmd == tlm::TLM_READ_COMMAND) { if (cmd == tlm::TLM_READ_COMMAND) {
std::copy_n(mem.cbegin() + adr, len, ptr); std::copy_n(mem.cbegin() + adr, len, ptr);
@ -97,13 +96,13 @@ void Memory::b_transport(tlm::tlm_generic_payload &trans,
bool Memory::get_direct_mem_ptr(tlm::tlm_generic_payload &trans, bool Memory::get_direct_mem_ptr(tlm::tlm_generic_payload &trans,
tlm::tlm_dmi &dmi_data) { tlm::tlm_dmi &dmi_data) {
(void) trans; (void) trans;
if (memory_offset != 0) { if (memory_offset != 0) {
return false; return false;
} }
// Permit read and write access // Permit read and write access
dmi_data.allow_read_write(); dmi_data.allow_read_write();

View File

@ -10,9 +10,7 @@
MemoryInterface::MemoryInterface() : MemoryInterface::MemoryInterface() :
data_bus("data_bus") { data_bus("data_bus") {}
}
/** /**
* Access data memory to get data * Access data memory to get data

View File

@ -28,15 +28,13 @@ Performance::Performance() {
void Performance::dump() const { void Performance::dump() const {
std::cout << "************************************" << std::endl; std::cout << "************************************" << std::endl;
std::cout << std::dec << "# data memory reads: " << data_memory_read std::cout << std::dec << "# data memory reads: " << data_memory_read << std::endl;
<< std::endl;
std::cout << "# data memory writes: " << data_memory_write << std::endl; std::cout << "# data memory writes: " << data_memory_write << std::endl;
std::cout << "# code memory reads: " << code_memory_read << std::endl; std::cout << "# code memory reads: " << code_memory_read << std::endl;
std::cout << "# code memory writes: " << code_memory_write << std::endl; std::cout << "# code memory writes: " << code_memory_write << std::endl;
std::cout << "# registers read: " << register_read << std::endl; std::cout << "# registers read: " << register_read << std::endl;
std::cout << "# registers write: " << register_write << std::endl; std::cout << "# registers write: " << register_write << std::endl;
std::cout << "# instructions executed: " << instructions_executed std::cout << "# instructions executed: " << instructions_executed << std::endl;
<< std::endl;
std::cout << "************************************" << std::endl; std::cout << "************************************" << std::endl;
} }