google / google/xls

[enhancement] parametric support for type aliases

Open
#3,472 0 comments 0 reactions 0 assignees View on GitHub
dslx enhancement
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

### What's hard to do? (limit 100 words)

Currently you can really do things like:

```
type Index = uN[std::clog2(u32) + u32:1];
```
or
```
struct SomeDataChunk {
type Index = uN[std::clog2(u32) + u32:1],
data: u32[N],
index_start: Index,
index_end: Index,
}
```

### Current best alternative workaround (limit 100 words)

Hardcode the type or duplicate the type expression everywhere it's being used.

### Your view of the "best case XLS enhancement" (limit 100 words)

Add support for arbitrary parameterized type alias in all context:
- struct body
- proc body
- parametric definition

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.