Skip to content

Commit 0086e5f

Browse files
povikprecisionmoon
authored andcommitted
synth: Add "has extracted operators" utility
Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent 3166cbb commit 0086e5f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎flow/scripts/synth_wrap_operators.tcl‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ foreach info $deferred_cells {
7474
# make per-architecture copies of the unmapped module
7575
foreach modname [tee -q -s result.string select -list-mod A:arithmetic_operator A:copy_pending %i] { # tclint-disable-line line-length
7676
setattr -mod -unset copy_pending $modname
77+
set base [rtlil::get_attr -string -mod $modname implements_operator]
78+
setattr -set implements_operator \"$base\" t:$modname
7779

7880
# iterate over non-default architectures
7981
foreach arch [lrange $info 3 end] {
8082
set suffix [lindex $arch 0]
81-
set base [rtlil::get_attr -string -mod $modname implements_operator]
8283
set newname ${base}_${suffix}
8384
yosys copy $modname $newname
8485
yosys setattr -mod -set architecture \"$suffix\" $newname
@@ -109,3 +110,8 @@ chformal -remove
109110
setattr -mod -set abc9_script {"+&dch;&nf -R 5;"} A:arithmetic_operator
110111
setattr -mod -set abc9_box 1 A:arithmetic_operator
111112
techmap -map +/techmap.v -map +/choices/han-carlson.v
113+
114+
proc design_has_extracted_operators {} {
115+
set no_extracted [yosys tee -q -s result.string select -count a:implements_operator]
116+
return [expr [lindex $no_extracted 0] > 0]
117+
}

0 commit comments

Comments
 (0)