google / google/xls

[enhancement:DSLX] Validate "input" as a parameter at the DSLX level (long before codegen)

Open
#1,710 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

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

Right now if you use "input" as a parameter name for a function, DSLX will accept it happily, but if you try to run that through code generation it will give you:

```
Error: INVALID_ARGUMENT: Port `input` is a keyword.; Running pass #15: Legalize names to avoid keywords [short: name_legalization]; Running pass #15: Top level codegen pass pipeline [short: codegen]
```

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

Rename the argument by hand.

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

Flag this as either a warning or an error at the DSLX level. I'd welcome some input on whether it's best to be a warning or an error.

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.