Skip to content

[slang] Support a way to map from non-mangled presynthesis name to mangled post synthesis name #3774

@oharboe

Description

@oharboe

Description

Is there a way to disable the name mangling to be compatible with Yosys?

Of course there are cases when names need to be individualized due to parameters, but for my use-case there's no SystemVerilog parameterization, so there's no ambiguity.

slang mangles module names during synthesis.

Original name Foo_3 mangled name Foo_3$SomeTop.bar.foo.

This is the code that's broken: original_name is no longer pre-synthesis, but mangled slang name.

set mapping {}
set block [ord::get_db_block]
foreach module [$block getModules] {
  set prop [odb::dbStringProperty_find $module "original_name"]
  if { $prop != "NULL" } {
	set module_name [$module getName]
	set original_name [$prop getValue]
    if {[catch {dict get $mapping $original_name} current]} {
        set current {}
    } else {
        set current [dict get $mapping $original_name]
    }
    lappend current $module_name
    dict set mapping $original_name $current
  } else {
    dict set mapping [$module getName] {}
  }
}

Suggested Solution

How to disable this mangling? Alternatively write out a reports/ file with a map.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions