google / google/xls

DSLX parsing of nonexistent channel types should be improved.

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

Description

Initially reported by hongted internally:

Running the interpreter on the following proc

```
import std

proc test_impl {
in0: chan in ab;
out0 : chan out u32;

config(in0: chan in u32,
out0: chan out u32) {
(in0, out0)
}

next(tok: token, state: u32) {
let (tok0, i0) = recv(tok, in0);
let tok_send = send(tok0, out0, i0);

let state = i0;

(state,)
}
}

pub proc proc_main {
config(in0: chan in u32,
out0: chan out u32) {
spawn test_impl(in0, out0)
(u32:0);
()
}

next(tok: token) { () }
}
```

via

```
interpreter_main test.x --compare="none"
```

gives an error message of

```
F0811 10:58:13.208087 255390 parser.h:68] Check failed: completed_ Uncompleted state transaction!
```

Ideally, the error message should point to the specific line/number or channel with the the error.

```
in0: chan in ab;
~~~~~~~~~~~~~~~^^ ParseError: Cannot find a definition for name: 'ab'
```

The root error here is a missing transaction completion, almost certainly due a missing absl::Cleanup before an XLS_ASSIGN_OR_RETURN type thing.

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.