Skip to content

Commit

Permalink
applies clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eyck committed Dec 22, 2023
1 parent 6ccf67c commit 6063f8d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/sysc/scc/configurer.cpp
Expand Up @@ -239,7 +239,7 @@ struct json_config_reader : public config_reader {
for(auto itr = o.MemberBegin(); itr != o.MemberEnd(); ++itr) {
if(!itr->name.IsString())
return;
auto key_name = itr->name.GetString();
std::string key_name = itr->name.GetString();
Value const& val = itr->value;
auto hier_name = prefix.size() ? prefix + "." + key_name : key_name;
if(val.IsNull() || val.IsArray())
Expand Down
2 changes: 1 addition & 1 deletion src/sysc/scc/scv/scv_tr_sqlite.cpp
Expand Up @@ -58,7 +58,7 @@ class SQLiteDB {
if(nRet != SQLITE_OK)
throw SQLiteException(nRet, sqlite3_errmsg(db), false);
sqlite3_busy_timeout(db, busyTimeoutMs);
nRet = sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, 1ULL << 26, 1ULL << 30);
sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, 1ULL << 26, 1ULL << 30);
char* zSql = sqlite3_mprintf("PRAGMA journal_mode=OFF;\n"
"PRAGMA synchronous=OFF;\n");
char* zErrMsg = nullptr;
Expand Down
29 changes: 16 additions & 13 deletions src/sysc/scc/utilities.h
Expand Up @@ -279,19 +279,22 @@ inline sc_core::sc_time parse_from_string(std::string value) noexcept {
}

inline sc_core::sc_time time_to_next_posedge(sc_core::sc_clock const* clk) {
auto period = clk->period();
auto m_posedge_time = period - period * clk->duty_cycle();
auto clk_run_time = sc_core::sc_time_stamp() - clk->start_time();
auto clk_period_point = clk_run_time % period;
if(clk_period_point == sc_core::SC_ZERO_TIME)
clk_period_point = period;
if(clk->posedge_first())
return clk_period_point;
else if(clk_period_point < m_posedge_time) {
return m_posedge_time - clk_period_point;
} else {
return period + m_posedge_time - clk_period_point;
}
if(clk) {
auto period = clk->period();
auto m_posedge_time = period - period * clk->duty_cycle();
auto clk_run_time = sc_core::sc_time_stamp() - clk->start_time();
auto clk_period_point = clk_run_time % period;
if(clk_period_point == sc_core::SC_ZERO_TIME)
clk_period_point = period;
if(clk->posedge_first())
return clk_period_point;
else if(clk_period_point < m_posedge_time) {
return m_posedge_time - clk_period_point;
} else {
return period + m_posedge_time - clk_period_point;
}
} else
return sc_core::SC_ZERO_TIME;
}

#if __cplusplus < 201402L
Expand Down
2 changes: 1 addition & 1 deletion third_party/axi_chi
2 changes: 2 additions & 0 deletions third_party/cci-1.0.0/CMakeLists.txt
Expand Up @@ -41,7 +41,9 @@ set_target_properties(cciapi PROPERTIES
VERSION ${PROJECT_VERSION}
FRAMEWORK FALSE
PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/cci_configuration
CXX_CLANG_TIDY ""
)

set(CCIAPI_CMAKE_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/cciapi)
install(TARGETS cciapi COMPONENT cci EXPORT cciapi-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
1 change: 1 addition & 0 deletions third_party/scv-tr/src/CMakeLists.txt
Expand Up @@ -41,6 +41,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
FRAMEWORK FALSE
PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/scv-tr.h
CXX_CLANG_TIDY ""
)

install(TARGETS ${PROJECT_NAME} COMPONENT scv-tr EXPORT ${PROJECT_NAME}-targets
Expand Down

0 comments on commit 6063f8d

Please sign in to comment.