Skip to content

Parsing very long strings with read_verilog is much slower than alternatives #5076

@rroohhh

Description

@rroohhh

Version

Yosys 0.50+14 (git sha1 0778195, g++ 11.4.0 -fPIC -O3)

On which OS did this happen?

Linux

Reproduction Steps

Running

yosys -p 'read -sv test.v'

against the attached test.v takes about 8 seconds on my system:

Time spent: 99% 2x read_verilog (8 sec), 0% 1x read (0 sec)

comparing this to the equivalent file in rtlil gives

Time spent: 100% 2x read_rtlil (0 sec)

Finally, reading the same file with yosys-slang's read_slang also reports:

Time spent: 59% 2x read_slang (0 sec), 22% 1x plugin (0 sec)

(Had to zip the input files for github to allow them)
test.zip

Expected Behavior

Parsing the rtlil and the verilog version should have roughly the same performance.

Actual Behavior

The verilog input file takes drastically longer to parse.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions