Internals: Add some VL_UNLIKELY. No functional change.

This commit is contained in:
Wilson Snyder
2022-11-29 20:36:56 -05:00
parent b51bb4d0e7
commit 6143892619
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -2453,7 +2453,7 @@ void VerilatedContext::timeprecision(int value) VL_MT_SAFE {
sc_prec = 15;
}
}
if (value != sc_prec) {
if (VL_UNLIKELY(value != sc_prec)) {
std::ostringstream msg;
msg << "SystemC's sc_set_time_resolution is 10^-" << sc_prec
<< ", which does not match Verilog timeprecision 10^-" << value
@@ -2524,7 +2524,7 @@ void VerilatedContext::internalsDump() const VL_MT_SAFE {
void VerilatedContext::addModel(VerilatedModel* modelp) {
threadPoolp(); // Ensure thread pool is created, so m_threads cannot change any more
if (modelp->threads() > m_threads) {
if (VL_UNLIKELY(modelp->threads() > m_threads)) {
std::ostringstream msg;
msg << "VerilatedContext has " << m_threads << " threads but model '"
<< modelp->modelName() << "' (instantiated as '" << modelp->hierName()