fusesocotb icon indicating copy to clipboard operation
fusesocotb copied to clipboard

Using cocotb tests from different location than it's core directory

Open stdefeber opened this issue 1 year ago • 1 comments

The directory structure my project uses is roughly like:

<prj_name> /
  ip/
  src/
  verification/
    <tc_name>/
      python/
        src/
          <tc_name>.py
      host/
        src/
          <tc_name>.c
          Makefile 

Currently this does not seem to be supported.

WARNING: The file ../verification/tc01/python/src/test_axis_send_packet.py in fusesoc_libraries/fusesocotb/axis_send_packet.core is not within the directory containing the core file. This is deprecated and will be an error in a future FuseSoC version. A typical solution is to move core file into the root directory of the IP block it describes.
ERROR: Setup failed : Cannot find ../verification/tc01/python/src/test_axis_send_packet.py in fusesoc_libraries/fusesocotb

I do not like to have my test case files in the same directory as my HDL sources.

Could it be re-instated again, cause it seems to be deprecated.

stdefeber avatar Jun 17 '24 12:06 stdefeber

We will not add support for that for both technical and philosophical reasons. We can't rely on things outside of the core to exist in specific directories. A core can't know about the outside world.

But it's totally fine to separate your HDL and test cases. My suggestion in that case is to split it up into a RTL and a verification core description file with the latter living in your verification directory and contains a dependency on your RTL core.

Either that or place a single core description file at a directory level that is common for both, if that is an option.

olofk avatar Jun 17 '24 18:06 olofk