Skip to content

Commit

Permalink
wip: libdeps
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 19, 2024
1 parent 908dd30 commit f32991d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions fusesoc/filters/splitlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
logger = logging.getLogger(__name__)


def flatten_vlnv(vlnv):
return str(vlnv).lstrip(":").replace(":", "_").replace(".", "_")


class Splitlib:
def run(self, edam, work_root):
libdeps = {}
for k, v in edam["dependencies"].items():
libdeps[flatten_vlnv(k)] = [flatten_vlnv(x) for x in v]

libdeps.update(edam["flow_options"].get("library_dependencies", {}))
# edam["flow_options"]["library_dependencies"] = libdeps
edam["library_dependencies"] = libdeps
for f in edam["files"]:
if not "logical_name" in f:
f["logical_name"] = (
str(f["core"]).lstrip(":").replace(":", "_").replace(".", "_")
)
f["logical_name"] = flatten_vlnv(f["core"])
return edam

0 comments on commit f32991d

Please sign in to comment.