Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbiyosys: honour include paths #371

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ollie-etl
Copy link

@ollie-etl ollie-etl commented Mar 25, 2023

This PR is on top of #362, because symbiyosys is basically unusable without.

symiyosys tasks are performed within a sub directory of the working directory, and symiyosys copies all working source into that directory. Currently include files are not specified in the [files] section of the file, so are not copied in to that working set.

This PR changes that, and generates entries for the include files. This are of the lesser used form

[files]
working_directory_relative_path/file edalize_build_dir/path/to/file

By using this form, we can honour the include_path property in the include files.
so includes with paths in files can be honoured

a.sv

   `include "subdir/path.svh"

a.core

CAPI=2:
name: etl:macros:axis:1.0.0
description: AxiS includes

filesets:
  rtl:
    files:
      - rtl/a.sv
      - rtl/includes/subdir/path.svh : 
          is_include_file: true
          include_path: rtl/includes
    

generates

[files]
subdir/path.svh edalize_working_dir/rtl/includes/subdir/path.svh
edalize_working_dir/rtl/a.sv

The file structure within the symnbiyosys working directory now contains includes at the correct relative locations

Henkru and others added 3 commits December 29, 2022 13:42
The current `run` step of the symbiyosys backend generates a `sby` command which includes the hardcoded `-d build` argument. However, this command line argument is incompatible with multiple tasks.

This fix removes the hardcoded `-d` argument and introduces a new `extra_options` tool option for the symbiyosys backend, which can be used to pass additional arguments for the `sby` command (e.g. `-d build`, if necessary).

The example usage of the `extra_options`:
```
   symbiyosys:
     tasknames:
       # A list of task names to pass to sby. Defaults to empty (in which case
       # sby will run each task in the .sby file)
       - my_proof
     extra_options:
       # A list of extra command line arguments to sby. Defaults to empty.
       - -d
       - build
```
@ollie-etl
Copy link
Author

@Henkru Can i have your thoughts also please?

@@ -205,7 +246,6 @@ def _get_read_flags(self):
"-D{}={}".format(key, self._param_value_str(value))
for key, value in self.vlogdefine.items()
]
+ ["-I{}".format(inc) for inc in self.incdirs]
Copy link
Author

@ollie-etl ollie-etl Mar 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer do includes with flags. This doesn't work

@@ -275,7 +315,7 @@ def _interpolate_sby(self, src):
"as a Jinja2 template: {}.".format(src_path, err)
)

files = "\n".join(self.rtl_paths)
files = "\n".join(map(lambda x: f"{x.rel_name} {x.name}", self.includes)) + "\n" + "\n".join(self.rtl_paths)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the files template to contain include files in dst src form

],
}

def _get_include_files(self, force_slash=False):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the include file name, no just the include directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants