updates scc and adds simspeed test

This commit is contained in:
Eyck Jentzsch 2025-03-16 18:50:10 +01:00
parent b274b0d80c
commit de4d740187
5 changed files with 35 additions and 4 deletions

View File

@ -15,7 +15,8 @@
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_STANDARD": "17", "CMAKE_CXX_STANDARD": "17",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
} }
}, },
{ {
@ -24,7 +25,8 @@
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
"CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_STANDARD": "17", "CMAKE_CXX_STANDARD": "17",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
} }
}, },
{ {
@ -33,7 +35,8 @@
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_STANDARD": "17", "CMAKE_CXX_STANDARD": "17",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
} }
} }
] ]

2
scc

@ -1 +1 @@
Subproject commit 414a7724e2723acb6cd309ff2fb62a38eb1ab6e5 Subproject commit a288c896f80f68edcde3b2f17fe49e0a31a3afbe

View File

@ -9,6 +9,7 @@ add_subdirectory(configuration)
add_subdirectory(configurer) add_subdirectory(configurer)
add_subdirectory(sc_fixed_tracing) add_subdirectory(sc_fixed_tracing)
add_subdirectory(cxs_tlm) add_subdirectory(cxs_tlm)
add_subdirectory(sim_speed)
if(FULL_TEST_SUITE) if(FULL_TEST_SUITE)
add_subdirectory(sim_performance) add_subdirectory(sim_performance)
endif() endif()

View File

@ -0,0 +1,3 @@
project (sim_speed)
add_executable(${PROJECT_NAME} sc_main.cpp)
target_link_libraries (${PROJECT_NAME} LINK_PUBLIC scc-sysc)

View File

@ -0,0 +1,24 @@
#include <chrono>
#include <stdint.h>
#include <systemc>
using namespace sc_core;
int sc_main(int argc, char* argv[]) {
const uint64_t NS_VAL = 100000000;
sc_clock clk("clk", 1, SC_NS);
sc_time run_time(NS_VAL, SC_NS);
auto start = std::chrono::high_resolution_clock::now();
sc_start(run_time);
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
double simulated_cycles = (double)NS_VAL;
double real_us = duration.count();
double speed_Mhz = simulated_cycles / real_us;
std::cout << "Simulation speed: " << speed_Mhz << " MHz\n";
return 0;
}