https://open-source-silicon.dev logo
#openlane
Title
# openlane
k

Ke-Haur Taur

06/09/2021, 3:59 PM
Hello, I encountered a problem when reading a Systemverilog package with Yosys. Error message is as shown below:
Copy code
2. Executing Verilog-2005 frontend: ./designs/src/opentitan_soc/ip/prim/rtl/prim_util_pkg.sv
./designs/src/opentitan_soc/ip/prim/rtl/prim_util_pkg.sv:28: ERROR: syntax error, unexpected TOK_FUNCTION
And the part of the code it is complaining about looks like: (line 28 is the 
function automatic...
)
Copy code
function automatic integer _clog2(integer value);
    integer result;
    integer v = value;
    v = v - 1;
    for (result = 0; v > 0; result++) begin
      v = v >> 1;
    end
    return result;
  endfunction
Is it because Yosys has yet to support Systemverilog functions in packages?
I saw that there is a recent PR for that http://phoenix.yizimg.com/YosysHQ/yosys/pull/2801 Thanks
@mehdi
m

mehdi

06/10/2021, 9:24 PM
Hi Everyone, is anyone able to synthesize systemVerilog using the latest of Yosys? Either way, what do you guys do and which sv2v tool work for you? @User @User @User
z

Zeeshan Rafique

06/11/2021, 9:42 AM
@Ke-Haur Taur make sure this package is not declare in a generate block of verilog.
k

Ke-Haur Taur

06/11/2021, 9:43 AM
@Zeeshan Rafique No that function is not in a generate block And it is not imported in a generate block either. The error was thrown before Yosys got to the files where it actually used the package. Yosys stopped parsing that package due to the
function
construct which is only supported by the latest build I think
z

Zeeshan Rafique

06/11/2021, 9:44 AM
Is it independent of any block?
k

Ke-Haur Taur

06/11/2021, 9:44 AM
@Peijun Hou
3 Views