google / xls

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

Add record types to IR #195

Open meheff opened 4 years ago

meheff commented 4 years ago

A record type is a tuple with named fields. I'm guessing it will be possible to mostly just treat records as special tuples. Tupleindex instruction would work the same. Might need a new instruction kRecord which is analogous to kTuple but with field names. Similarly structured record types and tuple types would not be compatible.

The motivation is to enable richer types (structs) in the emitted SystemVerilog.

proppy commented 5 months ago

@grotival was mentioning that this would enable the codegen to emit SystemVerilog w/ multiple output ports.

proppy commented 5 months ago

https://internals.rust-lang.org/t/record-types/18258 discuss support for record type in Rust; which could be an inspiration for a future DSLX syntax.