google / google/xls

Support proc/fn aliases in DSLX

Open
#890 1 comment 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

Generating IR for a parameterized top (fn or proc) is not currently supported. One natural way of supporting this would be through fn/proc aliases. For example given the parameterized function below:

```
fn foo_fn( ... ) {
...
}

proc foo_proc( ... ) {
...
}
```

Using `foo_fn` (or `foo_proc`) as the "top" entity for generating IR or verilog is not possible. Instead it needs to be wrapped in a non-parametric function/proc. An alternative to wrapping would be to support aliases which give a name to a particular instantiation of the parametric function/proc. For example:

```
fn bar_fn = foo_fn;
proc bar_proc = foo_proc;
```

Then you could use `bar_fn` (or `bar_proc`) as the "top" entity. This feature would be supported for fns and procs.

This also would be generally useful as a nice shortcut if you're instantiating a bunch of parametric fn/procs the same way.

Related: #889

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.