updates scc and adds simspeed test
This commit is contained in:
parent
b274b0d80c
commit
de4d740187
@ -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
2
scc
@ -1 +1 @@
|
|||||||
Subproject commit 414a7724e2723acb6cd309ff2fb62a38eb1ab6e5
|
Subproject commit a288c896f80f68edcde3b2f17fe49e0a31a3afbe
|
@ -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()
|
||||||
|
3
tests/sim_speed/CMakeLists.txt
Normal file
3
tests/sim_speed/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
project (sim_speed)
|
||||||
|
add_executable(${PROJECT_NAME} sc_main.cpp)
|
||||||
|
target_link_libraries (${PROJECT_NAME} LINK_PUBLIC scc-sysc)
|
24
tests/sim_speed/sc_main.cpp
Normal file
24
tests/sim_speed/sc_main.cpp
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user