aboutsummaryrefslogtreecommitdiffstats
path: root/backends/firrtl
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2023-01-17 12:58:08 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2023-01-17 12:58:08 +0100
commit6574553189fb6ccb5d00a0c043671a625672b3d3 (patch)
tree57e3212ee75493d9f4939c9f9029b95880367a76 /backends/firrtl
parent956c4e485a9463863f60c4dd03372db3fa8332a4 (diff)
downloadyosys-6574553189fb6ccb5d00a0c043671a625672b3d3.tar.gz
yosys-6574553189fb6ccb5d00a0c043671a625672b3d3.tar.bz2
yosys-6574553189fb6ccb5d00a0c043671a625672b3d3.zip
Fixes for some of clang scan-build detected issues
Diffstat (limited to 'backends/firrtl')
-rw-r--r--backends/firrtl/firrtl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/firrtl/firrtl.cc b/backends/firrtl/firrtl.cc
index e483117d1..d68c52563 100644
--- a/backends/firrtl/firrtl.cc
+++ b/backends/firrtl/firrtl.cc
@@ -1238,6 +1238,9 @@ struct FirrtlBackend : public Backend {
if (top == nullptr)
top = last;
+ if (!top)
+ log_cmd_error("There is no top module in this design!\n");
+
std::string circuitFileinfo = getFileinfo(top);
*f << stringf("circuit %s: %s\n", make_id(top->name), circuitFileinfo.c_str());