Skip to content

Multiple directories with same name #1197

@bennyslbs

Description

@bennyslbs

I have a problem with directories with the same name, and proposed a solution.

Our directory structure:

project_root
├── generallib
│   ├── rtl
│   ├── sim
│   └── tb
└── specific
    ├── comp1
    │   ├── rtl
    │   ├── sim
    │   └── tb
    └── comp2
        ├── rtl
        ├── sim
        └── tb

The issue is regarding directories containg vunit_pkg.toml.

  • rtl and tb folders contains vunit_pkg.toml.
  • sim folders contains run.py

Normal python import handles __init__.py fine via:

import comp1
import comp1.rtl
import comp1.tb

I have created a branch (on my forked repo):
master...mrlogic-dk:vunit:feature-add_package-via_path

Problem solved by this patch:

  • Multiple packages with the same directory name, e.g. rtl / tb.
    • Original add_package("package_name") will just insert the first found.
    • Enhanced package, with `path` argument,
      add_package(path"../../general-lib/tb")= will insert that
      specific package via vunit_pkg.toml

Whot do you think about the change with respect to functionality and implementation?

I can't run the test `pytest tests/unit/` neither on `master` or with my changes.

I don't know where to add test to test the behaviour.

I can't push to VUnit/vunit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions