Skip to content

Commit b59c1d1

Browse files
oharboeclaude
andcommitted
AUTO_MEMORIES: an escaped macro module gets its cost
The cost loop looked each blackboxes.txt name up in the module list as a Tcl list. yosys lists an escaped module with its leading backslash, `\1d_ram`, which list parsing reads as an escape, and blackboxes.txt names it as read_slang takes it, `1d_ram`; the lookup missed, the module was taken for absent and skipped, and keep_hierarchy -min_cost stopped with "Missing cost information on instanced blackbox \1d_ram". The list is now read one name per line, without the backslash. Checked with read_slang on a design with `ram` and `\1d_ram` blackboxed: before, the error above; now both get their cost and keep_hierarchy -min_cost runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent a3305f1 commit b59c1d1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,16 @@ proc convert_liberty_areas { } {
273273
# keep_hierarchy -min_cost refuses it ("Missing cost information on
274274
# instanced blackbox"). Its view is not read in its place, as its pins
275275
# need not be the module's (FakeRAM uses its own names).
276-
set modules [tee -q -s result.string select -list-mod =*]
276+
# One name per line, not a Tcl list: yosys lists an escaped module with
277+
# its leading backslash (`\1d_ram`), which list parsing reads as an
278+
# escape, and blackboxes.txt names it as read_slang takes it (`1d_ram`).
279+
set modules {}
280+
foreach line [split [tee -q -s result.string select -list-mod =*] "\n"] {
281+
set line [string trim $line]
282+
if { $line ne "" } {
283+
lappend modules [regsub {^\\} $line {}]
284+
}
285+
}
277286
dict for {m area} [auto_memories_areas] {
278287
if { [lsearch -exact $modules $m] < 0 } {
279288
# slang imports a blackboxed module only where it is instanced

0 commit comments

Comments
 (0)