chipsalliance / f4pga-examples

Example designs showing different ways to use F4PGA toolchains.
https://f4pga-examples.readthedocs.io
Apache License 2.0
263 stars 77 forks source link

Symbiflow-classroom: Array Initializers Do Not Work #263

Open nelsobe opened 2 years ago

nelsobe commented 2 years ago

SYMBIFLOW-CLASSROOM-PROJECT

Using original Yosys frontend.

If SV code contains a legal array declaration and initialization like this:

      // Lookup table for % 3 calculation.
    logic[1:0] modmem[8] = '{0, 1, 2, 0, 1, 2, 0, 1};

a syntax error results. Arrays cannot be initialized this way with the tools (but it is legal SV and works with other tools).

nelsobe commented 2 years ago

@mithro @acomodi @tmichalak @mkurc-ant Would be interested in any feedback you can provide.

rkapuscik commented 2 years ago

Could you provide more details on which tool are you using and with what options? I verified that UHDM plugin for yosys correctly parses this declaration - it is present in UHDM and in Yosys AST. I tested this using both Surelog to create UHDM file and read_verilog_with_uhdm in yosys with plugin.

On the other hand, using this in original yosys' verilog frontend does cause a syntax error:

yosys> read_verilog -sv tests/top.sv
1. Executing Verilog-2005 frontend: tests/top.sv
Parsing SystemVerilog input from `tests/top.sv' to AST representation.
tests/IncompleteTop/top.sv:6: ERROR: syntax error, unexpected OP_CAST
nelsobe commented 2 years ago

Using original Yosys frontend.

jcrob2 commented 2 years ago

Using the following timestamp and hash, the issue still exists. Timestamp: 20220606-234655 Hash: 1667c14

I've included a file that contains a list of the content/versions of the conda environment that we have. conda_list.txt