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

fusesoc export xsa file #656

Closed
isomoye opened this issue Dec 17, 2023 · 3 comments
Closed

fusesoc export xsa file #656

isomoye opened this issue Dec 17, 2023 · 3 comments

Comments

@isomoye
Copy link

isomoye commented Dec 17, 2023

I usually build petalinux after generating hardware. right now fusesoc only exports the bitstream which means i need to open up the project later on and export the full xsa. Would we be able to just add the xsa export too.

@olofk
Copy link
Owner

olofk commented Dec 18, 2023

I think the easiest way is to add some tcl script that does the xsa export. You can add custom tcl files by setting file_type : tclSource. Now, the trick is to make sure the tcl script is executed at the right time. I'm not familiar with xsa in particular, but generally speaking there are two options here. Either, it's just a property that you set for the project, and then you will get your xsa file, or it's an extra command that needs to be run at the right point. For the latter, which I suspect is the case here, you would need to define a script hook in your custom TCL script so that Vivado will pick it up at the right time. Let me see if I can find some example of that.

@garankonic
Copy link
Contributor

garankonic commented Jan 16, 2024

In the top-level project, you can create a dedicated target which build xsa (without bitstream):

filesets:
   xsa:
        files:
          - scripts/export_xsa.tcl: { file_type: tclSource }
targets:
    xsa_target:
        toplevel: your_toplevel
        filesets:
          - xsa
        flow: vivado
        flow_options:
          part: your_part
          source_mgmt_mode: All
          jobs: 1

In this way XSA script will be the last one to execute. The script itself looks as follows:

# switches to vhdl top-level
set_property target_language VHDL [current_project]
# generate output products
generate_target all [get_files *.bd]
# export xsa
write_hw_platform -fixed -force -file file.xsa

@isomoye
Copy link
Author

isomoye commented Jan 17, 2024

This solution worked. Thansk @garankonic . closing issue.

@isomoye isomoye closed this as completed Jan 17, 2024
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

No branches or pull requests

3 participants