From 22bc798696236cae38bae2ec829160d820a72977 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 12 Mar 2016 11:21:23 +0000 Subject: [PATCH] Added warning when a latch enable is a synthesised expression. --- synth2.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/synth2.cc b/synth2.cc index aab79ca88..91086870c 100644 --- a/synth2.cc +++ b/synth2.cc @@ -1594,11 +1594,18 @@ bool NetProcTop::synth_async(Design*des) << nex_set[idx].lnk.nexus()->pick_any_net()->name() << "'." << endl; + if (enables.pin(idx).nexus()->pick_any_net()->local_flag()) { + cerr << get_fileline() << ": warning: The latch " + "enable is connected to a synthesized " + "expression. The latch may be sensitive " + "to glitches." << endl; + } + if (debug_synth2) { cerr << get_fileline() << ": debug: " - << "Top level making a " - << nex_set[idx].wid << "-wide " - << "NetLatch device." << endl; + << "Top level making a " + << nex_set[idx].wid << "-wide " + << "NetLatch device." << endl; } NetLatch*latch = new NetLatch(scope(), scope()->local_symbol(),