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

Support for legacy protection pre-processor directives #1032

Closed
rahultadak opened this issue Jun 15, 2024 · 6 comments
Closed

Support for legacy protection pre-processor directives #1032

rahultadak opened this issue Jun 15, 2024 · 6 comments

Comments

@rahultadak
Copy link

rahultadak commented Jun 15, 2024

Based on issue #612 and my experience with v6.0, slang doesn't seem to support older code protection directives described below:

`protect
...
`endprotect

After encrypting source code tagged as above it is turned into:

`protected
... <base64 blob>...
`endprotected

Is. it possible to add support for these kinds of protected blocks so that usage of slang on IPs written with the older methods are still supported?

@MikePopoloski
Copy link
Owner

Is there documentation anywhere about how these directives work exactly? They aren't covered in the LRM -- are they literally identical to the corresponding pragma directives?

@rahultadak
Copy link
Author

That is a good question. I've not actually created protected code using this, but I've seen protected code failing compile with slang. I could probably recreate this and put in a log here.

In the meantime, this is the closest I've found to a description on how this might work.

https://redirect.cs.umbc.edu/portal/help/VHDL/verilog/compiler_directives.html

@rahultadak
Copy link
Author

Without going into too much detail, I have something like this in a file:

`protected
...
...
`endprotected

Trying to run it with slang like this:

$ slang file.svp

file.svp:line:1: error: unknown macro or compiler directive '`protected'
`protected
^

I removed the details of the files and line numbers.

@sequencer
Copy link

We also encountered this under the SNPS VIP flow.

@jcurtiss8086
Copy link

jcurtiss8086 commented Jun 19, 2024

While I'm not saying Slang shouldn't support this, as customers you should also contact SNPS and ask them to deliver LRM compliant code. i.e. they should be using `pragma protect, not `protected. Avery VIPs do this properly.

@MikePopoloski
Copy link
Owner

Added in 2daa108

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

4 participants