[yosys] 19/38: Added SigSpec::has_const()

Ruben Undheim rubund-guest at moszumanska.debian.org
Mon Feb 9 19:36:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to tag upstream/0.5.0
in repository yosys.

commit 05d4223fb675ee063ded20cf24eb922c4570634a
Author: Clifford Wolf <clifford at clifford.at>
Date:   Sun Feb 8 00:01:51 2015 +0100

    Added SigSpec::has_const()
---
 kernel/rtlil.cc | 12 ++++++++++++
 kernel/rtlil.h  |  1 +
 2 files changed, 13 insertions(+)

diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index b1e2c0e..776625b 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -1078,6 +1078,7 @@ void RTLIL::Module::check()
 
 	for (auto &it : connections_) {
 		log_assert(it.first.size() == it.second.size());
+		log_assert(!it.first.has_const());
 		it.first.check();
 		it.second.check();
 	}
@@ -2968,6 +2969,17 @@ bool RTLIL::SigSpec::is_fully_undef() const
 	return true;
 }
 
+bool RTLIL::SigSpec::has_const() const
+{
+	cover("kernel.rtlil.sigspec.has_const");
+
+	pack();
+	for (auto it = chunks_.begin(); it != chunks_.end(); it++)
+		if (it->width > 0 && it->wire == NULL)
+			return true;
+	return false;
+}
+
 bool RTLIL::SigSpec::has_marked_bits() const
 {
 	cover("kernel.rtlil.sigspec.has_marked_bits");
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 985bffe..dd40e2f 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -672,6 +672,7 @@ public:
 	bool is_fully_const() const;
 	bool is_fully_def() const;
 	bool is_fully_undef() const;
+	bool has_const() const;
 	bool has_marked_bits() const;
 
 	bool as_bool() const;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yosys.git



More information about the debian-science-commits mailing list