Skip to content

Commit 00b5f3a

Browse files
committed
synth: Make corrections; add Booth option
Signed-off-by: Martin Povišer <[email protected]>
1 parent b4daa38 commit 00b5f3a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(* techmap_wrap = "booth" *)
2+
(* techmap_celltype = "$macc" *)
3+
module _70_macc;
4+
endmodule

flow/scripts/synth_wrap_operators.tcl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set deferred_cells {
1111
\$macc
1212
MACC_{CONFIG}_{Y_WIDTH}{%unused}
1313
{BASE -map +/choices/han-carlson.v}
14+
{BOOTH -max_iter 1 -map ../flow/scripts/synth_wrap_operators-booth.v}
1415
}
1516
}
1617

@@ -36,7 +37,7 @@ foreach info $deferred_cells {
3637
t:$type r:A_WIDTH>=10 r:Y_WIDTH>=14 %i %i
3738

3839
# make per-architecture copies of the unmapped module
39-
foreach modname [tee -q -s result.string select -list-mod A:arithmetic_operator A:copy_pending] {
40+
foreach modname [tee -q -s result.string select -list-mod A:arithmetic_operator A:copy_pending %i] {
4041
setattr -mod -unset copy_pending $modname
4142

4243
# iterate over non-default architectures
@@ -52,13 +53,14 @@ foreach info $deferred_cells {
5253
# iterate over all architectures, both the default and non-default
5354
foreach arch [lrange $info 2 end] {
5455
set suffix [lindex $arch 0]
55-
set extra_map_args [lrange $arch 1 end]
56-
57-
# inject booth before we have techmap support for it
58-
#booth A:source_cell=$type A:architecture=$suffix %i
56+
set extra_map_args [lrange $arch 1 end]
5957

6058
# map all operator copies which were selected to have this architecture
6159
techmap -map +/techmap.v {*}$extra_map_args A:source_cell=$type A:architecture=$suffix %i
60+
61+
# booth isn't able to map all $macc configurations: catch if this is one
62+
# of those and delete the option
63+
delete A:source_cell=$type A:architecture=$suffix %i t:\$macc %m %i
6264
}
6365

6466
log -pop
@@ -71,4 +73,4 @@ opt -full
7173
chformal -remove
7274
setattr -mod -set abc9_script {"+&dch;&nf -R 5;"} A:arithmetic_operator
7375
setattr -mod -set abc9_box 1 A:arithmetic_operator
74-
techmap -map +/choices/han-carlson.v
76+
techmap -map +/techmap.v -map +/choices/han-carlson.v

0 commit comments

Comments
 (0)