0

When I change .vhd files I need to regenerate Qsys and then compile the design. How can I use tcl commands inside Quartus to regenerate the Qsys and then compile the project as well?​

Is there a way to automatically generate the Qsys systems when project is compiled? Why is this not done automatically? The problem arises since Qsys keeps local copies of the HDL source files.

gyuunyuu
  • 1,933
  • 7
  • 31
  • 1
    It shouldn't be necessary to rerun Qsys every time you compile. What exactly are you doing? – Dave Tweed Jun 25 '19 at 14:52
  • There are some custom components. Git is being used to source control the vhd files. These source files change when we move to different branch but the local copies of Qsys do not. We require to rerun Qsys generate to update those local copies. – gyuunyuu Jun 26 '19 at 06:36
  • This seems odd. Where are you storing the QSys generated vhd files and are you ignoring them in Git? I currently have several projects containing QSys components and have never needed to regenerate when switching branches. – Vance Jun 26 '19 at 12:27
  • Basically, it is like this. I make change to custom component in Qsys i.e change its VHDL code. Now, I must regenerate the Qsys and then (after that) compile the project so the hardware shall incorporate the changes that I have made to the custom component. Anyway, is there no tcl command to generate the system? – gyuunyuu Jun 26 '19 at 12:30
  • I think I see now. Generally, it's sub-optimal to manually edit the QSys generated files for this very reason. While you can edit away, the new files won't be added to the QSys instantiation in your project until you run generate vhdl code. This is unlike standalone hdl files which will have the latest saved version grabbed during synthesis so I can see why it feels a little unintuitive. – Vance Jun 26 '19 at 12:43

2 Answers2

1

Does including this in your QSF solve your problem?

set_global_assignment -name PROJECT_IP_REGENERATION_POLICY ALWAYS_REGENERATE_IP
Charles Clayton
  • 155
  • 2
  • 16
1

With help from $QUARTUS_ROOT/ip/altera:

set qsys_file <your_file>.qsys
set project_file <your_project>.qpf
qexec "qsys-generate --quartus-project=$project_file --synthesis=VHDL $qsys_file"
Xerusial
  • 111
  • 2