diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-02-15 12:58:12 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-02-15 12:58:12 +0100 |
commit | 40f021e1367af8cc8cd2ea133ba4cb0d2f342cbd (patch) | |
tree | c18c571be0ebdf3d0a12866ba1e7cc529748bb34 /passes/cmds/check.cc | |
parent | a54c994e2be340d3d036c160e5cd065a72fe5603 (diff) | |
download | yosys-40f021e1367af8cc8cd2ea133ba4cb0d2f342cbd.tar.gz yosys-40f021e1367af8cc8cd2ea133ba4cb0d2f342cbd.tar.bz2 yosys-40f021e1367af8cc8cd2ea133ba4cb0d2f342cbd.zip |
Added "check -noinit"
Diffstat (limited to 'passes/cmds/check.cc')
-rw-r--r-- | passes/cmds/check.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/passes/cmds/check.cc b/passes/cmds/check.cc index 6840572eb..824131a7a 100644 --- a/passes/cmds/check.cc +++ b/passes/cmds/check.cc @@ -31,7 +31,7 @@ struct CheckPass : public Pass { { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| log("\n"); - log(" check [selection]\n"); + log(" check [options] [selection]\n"); log("\n"); log("This pass identifies the following problems in the current design:\n"); log("\n"); @@ -41,14 +41,26 @@ struct CheckPass : public Pass { log("\n"); log(" - used wires that do not have a driver\n"); log("\n"); + log("When called with -noinit then this command also checks for wires which have\n"); + log("the 'init' attribute set.\n"); + log("\n"); } virtual void execute(std::vector<std::string> args, RTLIL::Design *design) { int counter = 0; + bool noinit = false; - log_header("Executing CHECK pass (checking for obvious problems).\n"); + size_t argidx; + for (argidx = 1; argidx < args.size(); argidx++) { + if (args[argidx] == "-noinit") { + noinit = true; + continue; + } + break; + } + extra_args(args, argidx, design); - extra_args(args, 1, design); + log_header("Executing CHECK pass (checking for obvious problems).\n"); for (auto module : design->selected_whole_modules_warn()) { @@ -93,6 +105,10 @@ struct CheckPass : public Pass { if (wire->port_output) for (auto bit : sigmap(wire)) if (bit.wire) used_wires.insert(bit); + if (noinit && wire->attributes.count("\\init")) { + log_warning("Wire %s.%s has an unprocessed 'init' attribute.\n", log_id(module), log_id(wire)); + counter++; + } } for (auto it : wire_drivers) |