17 Commits

Author SHA1 Message Date
ffb9f28f89 adds memory page_boundary_check test
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-12-09 07:58:28 +01:00
5dec262eb4 removes scc git submodule and adds as FetchContent 2025-12-09 07:58:06 +01:00
bf2222686f removes accidentially added file
All checks were successful
SCC Test/pipeline/head This commit looks good
2025-12-05 12:40:51 +01:00
a0970534ae update scc
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-12-05 12:39:31 +01:00
cfdd5d75d7 updates scc
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-12-05 10:28:17 +01:00
ac8386d0d9 updates scc
All checks were successful
SCC Test/pipeline/head This commit looks good
2025-12-04 16:53:54 +01:00
b89b86a711 updates scc
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-12-04 16:48:12 +01:00
79d76eea80 updates scc
All checks were successful
SCC Test/pipeline/head This commit looks good
2025-12-04 16:24:40 +01:00
52114bf895 updates scc and used packages
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-12-04 14:42:10 +01:00
d97bb9877e updates scc
All checks were successful
SCC Test/pipeline/head This commit looks good
2025-11-28 15:10:17 +01:00
d9a9693c77 fixes cci_example test
All checks were successful
SCC Test/pipeline/head This commit looks good
2025-11-26 08:19:00 +01:00
e2e35f6c1a enables clang-format step in Jenkinsfile
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-11-26 07:44:38 +01:00
1d4a805f1e forces conan to rebuild all packages in Jenkinsfile
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-11-26 07:39:19 +01:00
a710b1ae0c forces conan to rebuild all packages in Jenkinsfile
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-11-26 07:37:25 +01:00
c9ea0779fe adds removal of SystemC package to Jenkinsfile
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-11-25 19:45:47 +01:00
86851e4309 adds removal of SystemC package to Jenkinsfile
Some checks failed
SCC Test/pipeline/head Something is wrong with the build of this commit
2025-11-25 19:43:15 +01:00
0f4d1915a2 fixes typo in Jenkins file
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
2025-11-25 19:33:54 +01:00
9 changed files with 103 additions and 36 deletions

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "scc"]
path = scc
url = https://github.com/Minres/SystemC-Components.git
[submodule "cmake-conan"]
path = cmake-conan
url = https://github.com/conan-io/cmake-conan.git

9
.vscode/launch.json vendored
View File

@@ -13,6 +13,15 @@
"SCC_TEST_VERBOSE": "7"
}
},
{
"type": "gdb",
"request": "launch",
"name": "cci-example",
"program": "${workspaceFolder}/build/Debug/tests/configuration/cci-example",
"environment": {
"SCC_TEST_VERBOSE": "7"
}
},
{
"name": "cppdbg quantum_keeper_mt",
"type": "cppdbg",

View File

@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.16)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/scc/cmake)
cmake_policy(SET CMP0110 NEW)
project(SCC_Test)
@@ -11,6 +10,22 @@ option(ENABLE_CLANG_FORMAT "Enable clang-format targets" OFF)
option(THREAD_SANITIZER "Enable thread sanitizer TSan" OFF)
option(ADDR_SANITIZER "Enable address sanitizer ASan" OFF)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/scc")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/scc/cmake)
else()
include(FetchContent)
FetchContent_Declare(
scc_git
GIT_REPOSITORY https://github.com/Minres/SystemC-Components.git
GIT_TAG develop
)
FetchContent_GetProperties(scc_git)
if(NOT scc_git_POPULATED)
FetchContent_Populate(scc_git)
endif()
list(APPEND CMAKE_MODULE_PATH ${scc_git_SOURCE_DIR}/cmake)
endif()
include(GNUInstallDirs)
include(BuildType)
@@ -72,6 +87,11 @@ include(CTest)
include(Catch)
enable_testing()
set(WITH_SCP4SCC ON)
add_subdirectory(scc)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/scc")
add_subdirectory(scc)
else()
add_subdirectory(${scc_git_SOURCE_DIR})
endif()
add_subdirectory(src)
add_subdirectory(tests)

View File

@@ -30,14 +30,22 @@
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "DebugCXX20",
"inherits": "Base",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "DebugWFormat",
"inherits": "Base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_CLANG_FORMAT": "ON"
}
},
{
"name": "DebugCXX20",
"inherits": "Base",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "RelWithDebInfo",
"inherits": "Base",

11
Jenkinsfile vendored
View File

@@ -31,10 +31,11 @@ void checkout_project() {
void build_n_test_project() {
sh'''
python3 -mvenv .venv
. .venv/bin/activate
pip3 install -r requirements.txt
cmake -S . -B build --preset Release
python3 -mvenv .venv
. .venv/bin/activate
pip3 install -r requirements.txt
conan remove -c "systemc/*"
cmake -S . -B build --preset Release -DCONAN_INSTALL_ARGS="--build=*" -DENABLE_CLANG_FORMAT=ON
cmake --build build --target format-check
cmake --build build -j12
cmake --build build --target test
@@ -71,7 +72,7 @@ pipeline {
stage('Checkout') { steps { checkout_project() }}
stage('Build & test') { steps { build_n_test_project() }}
}
qq }
}
}
}
}

View File

@@ -6,9 +6,7 @@ import os
class Pkg(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = (
"CMakeDeps"
)
generators = "CMakeDeps"
default_options = {
"systemc/*:shared": "True",
"boost/*:fPIC": "True",
@@ -35,24 +33,29 @@ class Pkg(ConanFile):
}
def requirements(self):
self.requires("systemc/3.0.1")
self.requires("fmt/8.0.1")
self.requires("spdlog/1.9.2")
self.requires("boost/1.85.0")
self.requires("catch2/3.1.0")
self.requires("lz4/1.9.4")
self.requires("yaml-cpp/0.7.0")
self.requires("jsoncpp/1.9.5")
if self.settings.compiler.cppstd:
cppstd = str(self.settings.compiler.cppstd).replace("gnu", "")
if cppstd == "11" or cppstd == "14":
self.requires("systemc/2.3.4")
else:
self.requires("systemc/3.0.1")
else:
self.requires("systemc/2.3.4")
self.requires("spdlog/1.16.0")
self.requires("boost/1.89.0")
self.requires("lz4/1.10.0")
self.requires("yaml-cpp/0.8.0")
self.requires("jsoncpp/1.9.6")
self.requires("zlib/1.3.1")
self.requires("catch2/3.1.0")
def build_requirements(self):
pass
def layout(self):
cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
tc.user_presets_path = False
tc.generate()

1
scc

Submodule scc deleted from 25252a4de6

View File

@@ -38,6 +38,7 @@
#include <tlm>
#include <vector>
#include "cci/core/cci_value.h"
#include "initiator.h"
#include "router.h"
#include "target.h"
@@ -114,7 +115,9 @@ public:
auto paramName0 = fmt::format("{}.{}.initiator_ID", name(), targetName);
auto quotedTargetName = fmt::format("\"target_{}\"", i);
m_broker.set_preset_cci_value(paramName0, cci::cci_value::from_json(targetName));
cci::cci_value v;
v.set(targetName);
m_broker.set_preset_cci_value(paramName0, v);
// Set preset value for maximum target size(memory)
auto paramName1 = fmt::format("{}.{}.initiator_ID", name(), targetName);
@@ -141,7 +144,7 @@ public:
SCCINFO(SCMOD) << "[TOP_MODULE C_TOR] : Re-setting fields of target_" << i;
m_broker.set_preset_cci_value(targetName, cci::cci_value::from_json(ss.str()));
} catch(sc_core::sc_report const& exception) {
SCCINFO(SCMOD) << "[ROUTER : Caught] : " << exception.what();
SCCINFO(SCMOD) << "[ROUTER : Caught] : " << exception.what() << " (expected)";
}
targetName = fmt::format("{}.RouterInstance.r_sa_{}", name(), i);

View File

@@ -6,8 +6,6 @@
#include <array>
#include <catch2/catch_all.hpp>
#include <cstdint>
#include <deque>
#include <unordered_map>
using namespace sc_core;
namespace scc {
@@ -69,4 +67,33 @@ TEST_CASE("dmi_access", "[memory][tlm-level]") {
sc_start(dut.clk.read());
}
TEST_CASE("page_boundary_check", "[memory][tlm-level]") {
auto& dut = factory::get<testbench>();
constexpr uint64_t kPageSize = decltype(dut.mem3)::page_size;
std::array<uint8_t, 2> write_data{{0xAAu, 0xBBu}};
tlm::tlm_generic_payload write;
sc_core::sc_time delay = sc_core::SC_ZERO_TIME;
write.set_command(tlm::TLM_WRITE_COMMAND);
write.set_address(kPageSize - 1); // straddles page boundary
write.set_data_length(write_data.size());
write.set_streaming_width(write_data.size());
write.set_data_ptr(write_data.data());
dut.mem3.handle_operation(write, delay);
std::array<uint8_t, 4> read_buf{{0xEEu, 0x00u, 0x00u, 0xEEu}};
tlm::tlm_generic_payload read;
read.set_command(tlm::TLM_READ_COMMAND);
read.set_address(kPageSize - 1);
read.set_data_length(write_data.size());
read.set_streaming_width(write_data.size());
read.set_data_ptr(read_buf.data() + 1); // leave guard bytes at both ends
dut.mem3.handle_operation(read, delay);
REQUIRE(read_buf[0] == 0xEEu); // leading guard untouched
REQUIRE(read_buf[1] == 0xAAu); // first byte read correctly
REQUIRE(read_buf[2] == 0xBBu); // second byte read correctly
REQUIRE(read_buf[3] == 0xEEu); // trailing guard must remain
}
} // namespace scc