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

Libero - Add flexible TCL script hooks #268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlosedp
Copy link
Contributor

@carlosedp carlosedp commented Sep 3, 2021

This allow adding TCL scripts on pre-synthesize, pre-pnr and
pre-bistream generation for the Libero backend.

In the .core file, this would be defined like:

  polarfireeval:
    files:
      - rtl/corescore_polarfire_eval_clock_gen.v: { file_type: verilogSource }
      - rtl/corescore_polarfire.v: { file_type: verilogSource }
      - data/polarfire_eval.pdc: { file_type: PDC }
      - data/script_pre_synth.tcl: { file_type: tclSourcePreSynth }
      - data/script_pre_pnr.tcl: { file_type: tclSourcePrePnR }
      - data/script_pre_bitstream.tcl: { file_type: tclSourcePreBitstream }

Multiple files of each kind could be used.

Signed-off-by: Carlos de Paula me@carlosedp.com

@carlosedp
Copy link
Contributor Author

Ping @olofk ... News on this?
Cc. @green4free

@carlosedp carlosedp force-pushed the tclhooks branch 2 times, most recently from 5b68802 to d640d88 Compare September 20, 2021 17:48
@carlosedp
Copy link
Contributor Author

I'll probably have to rebase this once #274 is merged.

@green4free
Copy link
Contributor

I'll probably have to rebase this once #274 is merged.

I think that it will be quite painless, I have tried combining them and got no merge conflicts.

@carlosedp carlosedp force-pushed the tclhooks branch 2 times, most recently from 8f8bc13 to aa98950 Compare November 5, 2021 22:57
This allow adding TCL scripts on pre-synthesize, pre-pnr and
pre-bistream generation for the Libero backend.

In the .core file, this would be defined like:

```yaml
  polarfireeval:
    files:
      - rtl/corescore_polarfire_eval_clock_gen.v: { file_type: verilogSource }
      - rtl/corescore_polarfire.v: { file_type: verilogSource }
      - data/polarfire_eval.pdc: { file_type: PDC }
      - data/script_pre_synth.tcl: { file_type: tclSourcePresynth }
      - data/script_pre_pnr.tcl: { file_type: tclSourcePrepnr }
      - data/script_pre_bitstream.tcl: { file_type: tclSourcePrebistream }
```

Signed-off-by: Carlos de Paula <me@carlosedp.com>
@carlosedp
Copy link
Contributor Author

Rebased after the merge of #274. @olofk PTAL.
Thanks!

@carlosedp
Copy link
Contributor Author

Ping @olofk ... :)

@olofk
Copy link
Owner

olofk commented Dec 20, 2021

I'm not super excited about introducing these new file types but I understand the need to distinguish between these. My first question would be how Libero itself handles this. Is there some built-ink hook API we can use?

More long-term I see a need in other flows as well for specifying which tool in a toolchain that should consume particular files. To solve the general problem I think we need to introduced custom attributes to files in core description files. In this case it could look something like some_tcl_file.tcl : {file_type : tclSource, stage : preSynth}.

But if this PR solves an immediate need I could be convinced to merge it with the expectation that these file types might be deprecated in a not too distant future

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

3 participants