chipsalliance / chipsalliance/synlig

Run some type of function will meet error

Open
#554 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Verilog
Stars
237
Forks
29
PR merge metrics
No merged PRs in 30d

Description

I use the uhdm to translate the orv64 SystemVerilog file into the verilog file, and want to do synthesis by yosys, the orv64 gitlab adress is here: [https://gitlab.com/picorio/OpenSource/hardware/orv64](url)
But there is some error when doing this translate , when the function include following format(Variables include output), the code where use this function will meet error. Here is an example in the orv64
```
function automatic void lru8_update_lru(
output logic [6:0] new_lru,
input logic [6:0] old_lru,
input logic [2:0] way_id
);
new_lru = old_lru;
new_lru[6] = ~old_lru[6];
if (way_id[2])
new_lru[5] = ~old_lru[5];
else
new_lru[4] = ~old_lru[4];

new_lru[way_id[2:1]] = ~old_lru[way_id[2:1]];

endfunction
```

and will meet this error
![148928605-79d1e517-0ad6-4f7b-a90e-caa9f0f783c6](https://user-images.githubusercontent.com/46994147/157805019-e4cc677c-c25f-48d1-8b1d-30fc1d3e5cfa.png)

the function screenshot is this
![148929066-54736ff3-66b3-4b28-a381-db1aafa069ec](https://user-images.githubusercontent.com/46994147/157805116-3d57b7cd-fe4d-4691-bf85-6b8f08e1b7ad.png)

what we can do is change the source code where use this function, and expand this function where it is used, and this problem will be sovled.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the translation using the shown SystemVerilog function with an output variable and the orv64 example, then inspect the reported error in the screenshots. Compare this case with the described workaround of expanding the function at its call site; done means the original function call translates successfully without manual expansion.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.