[verilator simutil] Make C/C++ lint happy
* "Fix" include guards.
* Make the code pass the CI version of clang-format.
Signed-off-by: Philipp Wagner <phw@lowrisc.org>
diff --git a/hw/dv/verilator/cpp/verilator_memutil.h b/hw/dv/verilator/cpp/verilator_memutil.h
index 4e6476a..2833c37 100644
--- a/hw/dv/verilator/cpp/verilator_memutil.h
+++ b/hw/dv/verilator/cpp/verilator_memutil.h
@@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
-#ifndef VERILATOR_MEMUTIL_H_
-#define VERILATOR_MEMUTIL_H_
+#ifndef OPENTITAN_HW_DV_VERILATOR_CPP_VERILATOR_MEMUTIL_H_
+#define OPENTITAN_HW_DV_VERILATOR_CPP_VERILATOR_MEMUTIL_H_
#include "sim_ctrl_extension.h"
@@ -112,4 +112,4 @@
bool WriteVmemToMem(const svScope &scope, const std::string &filepath);
};
-#endif // VERILATOR_MEMUTIL_H_
+#endif // OPENTITAN_HW_DV_VERILATOR_CPP_VERILATOR_MEMUTIL_H_
diff --git a/hw/dv/verilator/simutil_verilator/cpp/sim_ctrl_extension.h b/hw/dv/verilator/simutil_verilator/cpp/sim_ctrl_extension.h
index 7ff6b0b..bfe2c25 100644
--- a/hw/dv/verilator/simutil_verilator/cpp/sim_ctrl_extension.h
+++ b/hw/dv/verilator/simutil_verilator/cpp/sim_ctrl_extension.h
@@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
-#ifndef SIM_CTRL_EXTENSION_H_
-#define SIM_CTRL_EXTENSION_H_
+#ifndef OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_SIM_CTRL_EXTENSION_H_
+#define OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_SIM_CTRL_EXTENSION_H_
class SimCtrlExtension {
public:
@@ -38,4 +38,4 @@
virtual void PostExec() {}
};
-#endif // SIM_CTRL_EXTENSION_H_
+#endif // OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_SIM_CTRL_EXTENSION_H_
diff --git a/hw/dv/verilator/simutil_verilator/cpp/verilated_toplevel.h b/hw/dv/verilator/simutil_verilator/cpp/verilated_toplevel.h
index f6e6496..1d7cc7d 100644
--- a/hw/dv/verilator/simutil_verilator/cpp/verilated_toplevel.h
+++ b/hw/dv/verilator/simutil_verilator/cpp/verilated_toplevel.h
@@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
-#ifndef VERILATED_TOPLEVEL_H_
-#define VERILATED_TOPLEVEL_H_
+#ifndef OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATED_TOPLEVEL_H_
+#define OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATED_TOPLEVEL_H_
#ifndef TOPLEVEL_NAME
#error "TOPLEVEL_NAME must be set to the name of the toplevel."
@@ -152,4 +152,4 @@
}
};
-#endif // VERILATED_TOPLEVEL_H_
+#endif // OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATED_TOPLEVEL_H_
diff --git a/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.cc b/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.cc
index 545fa4a..158f79b 100644
--- a/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.cc
+++ b/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.cc
@@ -5,12 +5,11 @@
#include "verilator_sim_ctrl.h"
#include <getopt.h>
+#include <iostream>
#include <signal.h>
#include <sys/stat.h>
#include <verilated.h>
-#include <iostream>
-
// This is defined by Verilator and passed through the command line
#ifndef VM_TRACE
#define VM_TRACE 0
@@ -202,9 +201,7 @@
}
void VerilatorSimCtrl::PrintHelp() const {
- std::cout << "Execute a simulation model for " << GetName()
- << "\n"
- "\n";
+ std::cout << "Execute a simulation model for " << GetName() << "\n\n";
if (tracing_possible_) {
std::cout << "-t|--trace\n"
" Write a trace file from the start\n\n";
diff --git a/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.h b/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.h
index c371ee8..c46cdee 100644
--- a/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.h
+++ b/hw/dv/verilator/simutil_verilator/cpp/verilator_sim_ctrl.h
@@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
-#ifndef VERILATOR_SIM_CTRL_H_
-#define VERILATOR_SIM_CTRL_H_
+#ifndef OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATOR_SIM_CTRL_H_
+#define OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATOR_SIM_CTRL_H_
#include <chrono>
#include <string>
@@ -237,4 +237,4 @@
void Trace();
};
-#endif // VERILATOR_SIM_CTRL_H_
+#endif // OPENTITAN_HW_DV_VERILATOR_SIMUTIL_VERILATOR_CPP_VERILATOR_SIM_CTRL_H_