aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2020-08-27 11:58:56 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-08-27 13:17:42 +0200
commit880df4c89763464b471b1e2044f3f296bb3332b4 (patch)
treea3531ca1738b49e7c74ae11c15688e3683859451 /passes
parent925c0f2594699b72dfb36d2633df42e2b3c47f13 (diff)
downloadyosys-880df4c89763464b471b1e2044f3f296bb3332b4.tar.gz
yosys-880df4c89763464b471b1e2044f3f296bb3332b4.tar.bz2
yosys-880df4c89763464b471b1e2044f3f296bb3332b4.zip
dfflegalize: Fix decision tree for adffe.
When an adffe is being legalized, and is not natively supported, prioritize unmapping to adff over converting to dffsre if dffsre is not natively supported itself. Fixes #2361.
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/dfflegalize.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/passes/techmap/dfflegalize.cc b/passes/techmap/dfflegalize.cc
index 8ad65493f..c1e7e557d 100644
--- a/passes/techmap/dfflegalize.cc
+++ b/passes/techmap/dfflegalize.cc
@@ -418,7 +418,8 @@ unmap_enable:
ff_type = has_set ? FF_ADFFE1 : FF_ADFFE0;
break;
}
- if (supported_dffsr & initmask) {
+ if (supported_cells[has_en ? FF_DFFSRE : FF_DFFSR] & initmask) {
+adff_to_dffsr:
// Throw in a set/reset, retry in DFFSR/DFFSRE branch.
if (has_set) {
sig_s = sig_r;
@@ -441,6 +442,9 @@ unmap_enable:
ff_type = has_set ? FF_ADFF1 : FF_ADFF0;
goto unmap_enable;
}
+ if (supported_dffsr & initmask) {
+ goto adff_to_dffsr;
+ }
log_assert(!((has_set ? supported_adff1 : supported_adff0) & initmask));
// Alright, so this particular combination of initval and
// resetval is not natively supported. First, try flipping