zachjs / sv2v

SystemVerilog to Verilog conversion
BSD 3-Clause "New" or "Revised" License
498 stars 50 forks source link

Unary increment/decrement in assignment support #196

Closed mikhailmoiseev closed 2 years ago

mikhailmoiseev commented 2 years ago

sv2v reports ""Parse error: unexpected token '++' (Sym_plus_plus)" for unary increment in expression:

a = b++;
a = ++b;
a = (b++) + c;
...

The same for decrement.

Are you planning to support that?

zachjs commented 2 years ago

Yes, I am interested in adding support. You can expect an update within a few days.

mikhailmoiseev commented 2 years ago

Thank you for support.

sv2v is really great tool. I have checked it with 300+ complex SV files from Intel Compiler for SystemC (ICSC) testbench, no major issues found. Specially, I am impressed with multi-return functions to task conversion.

Do you mind if I add a link to this repo from ICSC GitHub wiki?

zachjs commented 2 years ago

sv2v is really great tool. I have checked it with 300+ complex SV files from Intel Compiler for SystemC (ICSC) testbench, no major issues found.

That's great to hear!

Specially, I am impressed with multi-return functions to task conversion.

Out of curiosity, are you referring to the conversion of conversion of return, continue, and break, or something else?

Do you mind if I add a link to this repo from ICSC GitHub wiki?

Not at all. Thank you!

mikhailmoiseev commented 2 years ago

Out of curiosity, are you referring to the conversion of conversion of return, continue, and break, or something else?

Yes, it is about conversion of multiple returns from function. ICSC translates multi-state FSM in SystemC threads into awlays_comb with function call, where the function contains case of FSM state variable and multiple returns from it. So, that is important.

zachjs commented 2 years ago

I just pushed support for assignments within expressions. Please let me know if it works well for you!

mikhailmoiseev commented 2 years ago

That works well. Thank you!

zachjs commented 2 years ago

I'm glad it's working for you!