google / google/xls

Allow ordering semantics of asserts/traces to carry over to SV codegen

Open
#1,441 0 comments 0 reactions 0 assignees View on GitHub
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)

As described in https://github.com/google/xls/issues/1234#issuecomment-2138193805, the emitted RTL for asserts and traces are effectively split into distinct processes, which may be evaluated in arbitrary order. This contrasts with dslx and the XLS IR (through tokens) which have sequential ordering within a proc/function.

It's not clear if this should be configurable, but it should be possible to preserve the same ordering as in interpreted XLS.

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

Simulation of the generated RTL may produce different logs or error out on a later assertion. This may lead the user to associate the trace values with the wrong expressions, or assume that an preceding assertion passed.

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

Default behavior should match the interpreted XLS. This can be accomplished by combining the assertions within the same procedural block, and similarly for the guarded `$display` statements for traces.

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.