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

verible-verilog-obfuscate crashes when program has pragma directive #2159

Open
rafasumi opened this issue Apr 15, 2024 · 0 comments
Open

verible-verilog-obfuscate crashes when program has pragma directive #2159

rafasumi opened this issue Apr 15, 2024 · 0 comments
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).

Comments

@rafasumi
Copy link

When you try to obfuscate SystemVerilog code with the `pragma protect directive, the obfuscator crashes because decoding the obfuscated code doesn't match the original code. For instance, take this example:

`pragma protect begin_protected
`pragma protect key_keyowner = "Cyberdyne Technologies", key_keyname = "cdn_rsa_key", key_method = "rsa"
`pragma protect end_protected

If you try to use it with verible-verilog-obfuscate without any additional options, it crashes with the following output:

Internal error: decode(encode) != original
ORIGINAL:
`pragma protect begin_protected
`pragma protect key_keyowner = "Cyberdyne Technologies", key_keyname = "cdn_rsa_key", key_method = "rsa"
`pragma protect end_protected

ENCODED:


DECODED:


*** Please file a bug. ***

I'm not sure what is the expected behavior for this example. The parser apparently ignores the rest of the line whenever there is a `pragma. However, I believe the obfuscator isn't expected to crash in cases like this.

@rafasumi rafasumi added the rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017). label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).
Projects
None yet
Development

No branches or pull requests

1 participant