CDC: --cdc now implies early exit, to allow eventual set_logic_0/1 on sigs

This commit is contained in:
Wilson Snyder 2010-01-16 20:14:52 -05:00
parent d651063749
commit d46074e0ad
3 changed files with 17 additions and 8 deletions

View File

@ -314,9 +314,9 @@ Specifies C++ without SystemC output mode; see also --sc and --sp.
=item --cdc =item --cdc
Experimental. Perform some clock domain crossing checks and issue related Experimental. Perform some clock domain crossing checks and issue related
warnings. Additional warning information is written to the file warnings (CDCRSTLOGIC) and then exit; if warnings other than CDC warnings
{prefix}__cdc.txt. Generally used with --lint-only. Enables CDCRSTLOGIC are needed make a second run with --lint-only. Additional warning
warning. information is also written to the file {prefix}__cdc.txt.
Currently only checks some items that other CDC tools missed; if you have Currently only checks some items that other CDC tools missed; if you have
interest in adding more traditional CDC checks, please contact the authors. interest in adding more traditional CDC checks, please contact the authors.

View File

@ -356,6 +356,8 @@ void process () {
// Clock domain crossing analysis // Clock domain crossing analysis
if (v3Global.opt.cdc()) { if (v3Global.opt.cdc()) {
V3Cdc::cdcAll(v3Global.rootp()); V3Cdc::cdcAll(v3Global.rootp());
V3Error::abortIfErrors();
return;
} }
// Reorder assignments in pipelined blocks // Reorder assignments in pipelined blocks
@ -527,6 +529,8 @@ void process () {
// Makefile must be after all other emitters // Makefile must be after all other emitters
V3EmitMk::emitmk(v3Global.rootp()); V3EmitMk::emitmk(v3Global.rootp());
} }
// Note early return above when opt.cdc()
} }
//###################################################################### //######################################################################
@ -550,8 +554,11 @@ int main(int argc, char** argv, char** env) {
if (v3Global.opt.coverage() && !v3Global.opt.systemPerl() && !v3Global.opt.lintOnly()) { if (v3Global.opt.coverage() && !v3Global.opt.systemPerl() && !v3Global.opt.lintOnly()) {
v3fatal("Unsupported: Coverage analysis requires --sp output."); v3fatal("Unsupported: Coverage analysis requires --sp output.");
} }
if (!v3Global.opt.outFormatOk() && !v3Global.opt.preprocOnly() && !v3Global.opt.lintOnly()) { if (!v3Global.opt.outFormatOk()
v3fatal("verilator: Need --cc, --sc, --sp, --lint-only or --E option"); && !v3Global.opt.preprocOnly()
&& !v3Global.opt.lintOnly()
&& !v3Global.opt.cdc()) {
v3fatal("verilator: Need --cc, --sc, --sp, --cdc, --lint-only or --E option");
} }
// Check environment // Check environment
V3Options::getenvSYSTEMC(); V3Options::getenvSYSTEMC();
@ -566,6 +573,7 @@ int main(int argc, char** argv, char** env) {
if (v3Global.opt.skipIdentical() if (v3Global.opt.skipIdentical()
&& !v3Global.opt.preprocOnly() && !v3Global.opt.preprocOnly()
&& !v3Global.opt.lintOnly() && !v3Global.opt.lintOnly()
&& !v3Global.opt.cdc()
&& V3File::checkTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString)) { && V3File::checkTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString)) {
UINFO(1,"--skip-identical: No change to any source files, exiting\n"); UINFO(1,"--skip-identical: No change to any source files, exiting\n");
exit(0); exit(0);
@ -593,10 +601,11 @@ int main(int argc, char** argv, char** env) {
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",99)); v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",99));
V3Error::abortIfWarnings(); V3Error::abortIfWarnings();
if (!v3Global.opt.lintOnly() && v3Global.opt.makeDepend()) { if (!v3Global.opt.lintOnly() && !v3Global.opt.cdc()
&& v3Global.opt.makeDepend()) {
V3File::writeDepend(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__ver.d"); V3File::writeDepend(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__ver.d");
} }
if (!v3Global.opt.lintOnly() if (!v3Global.opt.lintOnly() && !v3Global.opt.cdc()
&& (v3Global.opt.skipIdentical() || v3Global.opt.makeDepend())) { && (v3Global.opt.skipIdentical() || v3Global.opt.makeDepend())) {
V3File::writeTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString); V3File::writeTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString);
} }

View File

@ -8,7 +8,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0. # Version 2.0.
compile ( compile (
v_flags => ['--cdc --lint-only'], v_flags => ['--cdc'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
fails => 1, fails => 1,
expect=> expect=>