Added SCC and refactored CMake files

This commit is contained in:
2019-01-01 12:19:44 +01:00
parent 262f093eb5
commit e633cc6134
15 changed files with 371 additions and 30 deletions

15
components/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
FILE(GLOB LibHeaders *.h)
set(LIB_HEADERS ${LibHeaders} )
set(LIB_SOURCES
initiator.cpp
logging.cpp
target.cpp
)
# Define two variables in order not to repeat ourselves.
set(LIBRARY_NAME components)
# Define the library
add_library(${LIBRARY_NAME} SHARED ${LIB_SOURCES})
target_link_libraries (${LIBRARY_NAME} LINK_PUBLIC sc-components)

View File

@ -9,8 +9,7 @@
#define COMPONENTS_H_
//#include "tx_example_mods.h"
#include <systemc.h>
#include "logging.h"
//#include "logging.h"
#include "initiator.h"
#include "router.h"
#include "target.h"

View File

@ -6,7 +6,8 @@
*/
#include "initiator.h"
#include "logging.h"
#include <scc/report.h>
Initiator::Initiator(::sc_core::sc_module_name nm)
@ -51,7 +52,7 @@ void Initiator::thread_process() {
wait( dmi_data.get_write_latency() );
}
LOG_INFO << "DMI = { " << (cmd ? 'W' : 'R') << ", " << hex << i
SCINFO() << "DMI = { " << (cmd ? 'W' : 'R') << ", " << hex << i
<< " } , data = " << hex << data << " at time " << sc_time_stamp();
}
else
@ -97,7 +98,7 @@ void Initiator::thread_process() {
dmi_ptr_valid = socket->get_direct_mem_ptr( *trans, dmi_data );
}
LOG_INFO << "trans = { " << (cmd ? 'W' : 'R') << ", " << hex << i
SCINFO() << "trans = { " << (cmd ? 'W' : 'R') << ", " << hex << i
<< " } , data = " << hex << data << " at time " << sc_time_stamp();
}
}
@ -115,7 +116,7 @@ void Initiator::thread_process() {
for (unsigned int i = 0; i < n_bytes; i += 4)
{
LOG_INFO << "mem[" << (A + i) << "] = "
SCINFO() << "mem[" << (A + i) << "] = "
<< *(reinterpret_cast<unsigned int*>( &data[i] ));
}
@ -127,7 +128,7 @@ void Initiator::thread_process() {
for (unsigned int i = 0; i < n_bytes; i += 4)
{
LOG_INFO << "mem[" << (A + i) << "] = "
SCINFO() << "mem[" << (A + i) << "] = "
<< *(reinterpret_cast<unsigned int*>( &data[i] ));
}
}

View File

@ -6,12 +6,12 @@
*/
#include "logging.h"
#include <systemc>
#include <deque>
#include <array>
#include <sstream>
#include <iomanip>
#include "logging_.h"
using namespace sc_core;