google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.21k stars 178 forks source link

Add support for Enumerate Operator in IR conversion #164

Open vincent-mirian-google opened 4 years ago

vincent-mirian-google commented 4 years ago

When using the enumerate operator, the IR conversion tool throws an error.

Test case: fn f(input: u32[4]) -> u32 { let result = for ((i, elem), accum): ((u32, u32), u32) in enumerate(input) { u32:0 }(u32:0); u32:0 }

Error: For-loop is of an unsupported form for IR conversion; only a 'range(0, const)' call is supported, found non-range callee.

To execute: _ir_convertermain \<DSLX file with content above>

hongted commented 4 years ago

This issue is to address

https://github.com/google/xls/blob/2ebaec60e59e206df9491f00459f6936d481fb00/xls/dslx/ir_converter.py#L711-L715