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

SystemVerilog procedural assignments within expressions #3870

Closed
imlibra opened this issue Aug 1, 2023 · 3 comments · Fixed by #3920
Closed

SystemVerilog procedural assignments within expressions #3870

imlibra opened this issue Aug 1, 2023 · 3 comments · Fixed by #3920
Assignees
Labels
SystemVerilog Issues and questions related to SystemVerilog

Comments

@imlibra
Copy link

imlibra commented Aug 1, 2023

Version

“unexpected TOK_INCREMENT” when SystemVerilog source contains ++

On which OS did this happen?

Linux

Reproduction Steps

yosys -read -sv hamming/hamming_dec.sv

Expected Behavior

……

Actual Behavior

-- Parsing hamming/hamming_dec.sv' using frontend -sv' --

  1. Executing Verilog-2005 frontend: hamming/hamming_dec.sv
    Parsing SystemVerilog input from `hamming/hamming_dec.sv' to AST representation.
    hamming/hamming_parameters.svh:57: ERROR: syntax error, unexpected TOK_INCREMENT
@imlibra imlibra added the pending-verification This issue is pending verification and/or reproduction label Aug 1, 2023
@Ravenslofty
Copy link
Collaborator

The line in question is generate_permutation[cDBITS + k++] = i;, which I think is a bit more specific than just "when SystemVerilog source contains ++"; for example if Yosys didn't like ++ it'd have errored elsewhere.

@Ravenslofty Ravenslofty added SystemVerilog Issues and questions related to SystemVerilog and removed pending-verification This issue is pending verification and/or reproduction labels Aug 1, 2023
@zachjs
Copy link
Collaborator

zachjs commented Aug 1, 2023

I'm interested in adding support for assignment expressions to Yosys, but it's not something I'm currently working on. In the meantime, you could use https://github.com/zachjs/sv2v, which already supports this feature.

@zachjs zachjs changed the title “unexpected TOK_INCREMENT” when SystemVerilog source contains ++ SystemVerilog procedural assignments within expressions Sep 3, 2023
@zachjs zachjs self-assigned this Sep 5, 2023
@zachjs
Copy link
Collaborator

zachjs commented Sep 6, 2023

@imlibra If you have the time, please try out my patch in #3920, which adds support for assignments within expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SystemVerilog Issues and questions related to SystemVerilog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants