-
Notifications
You must be signed in to change notification settings - Fork 200
[xls][mlir] Fix emission of debug locations in xls_translate
#1992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'd have had trace as separate change (just make it easier to see in git history). Could you split it out?
I have it as a separate commit in this PR (one of five) - Do you need it as a separate PR because this somehow gets squashed while merging? |
Yes indeed (each PR becomes one commit in the history). The rest actually fits well together in one. [well and if I do it manually I think only one gets attributed to you, which is not accurate] |
Got it. I had a PR1 with three commits land a few weeks ago, and "from the outside" they seemed to stay separate234 - so I assumed that was fine and got lazy 👼 Copybara works in mysterious ways. Will fixup + rebase tomorrow. Footnotes |
Makes it consistent with all other values in XLS MLIR assembly.
bfbaea4
to
4ab2f04
Compare
`xls_translate` previously assigned an ID to every source file encountered in the MLIR `Location` of input ops and referenced these IDs in the XLS `pos` attribute of the produced IR nodes, but did not actually add these source file names to the XLS package, leading to invalid `pos` attributes. This patch fixes this by relying on `Package::AddSourceLocation` to both construct the `SourceLocation` for nodes and automatically registering the file with the package. With this, `xls_translate` can also re-use the file name ID assignment/lookup from XLS proper.
4ab2f04
to
a76de5f
Compare
Rebased + trace op conversion removed. Note that I also had to drop the round-trip testing because that will not work without trace. That will also follow in a different PR. Ready from my side. |
See also:
Note that #2005 relies on both this PR and #2004 for CI to pass. |
Turns out it was a simple fix. I rolled it into this PR because it seems relevant enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, one extra fix rolled in :-)
As noted in #1916, I was not able to easily add a round-trip test for channel attributes due to some issues with debug locations in
xls_translate
.While fixing this, I wanted to verify that round-trip conversion worked by smoke testing with
ops_translate.mlir
, where I noticed that my xls->mlir translation did not supporttrace
and that my naming of the fifo flop kind enum was inconsistent.Poping the stack, this PR contains the following commits addressing all of the above:
[xls][mlir] Use underscore in zero latency enum case name
Makes it consistent with all other values in XLS MLIR assembly.
[xls][mlir] Add xls->mlir translation of trace IR node
[xls][mlir] Emit well-formed XLS source location infos in xls_translate
xls_translate
previously assigned an ID to every source file encountered in the MLIRLocation
of input ops and referenced these IDs in the XLSpos
attribute of the produced IR nodes, but did not actually add these source file names to the XLS package, leading to invalidpos
attributes.This patch fixes this by relying on
Package::AddSourceLocation
to both construct theSourceLocation
for nodes and automatically registering the file with the package.With this,
xls_translate
can also re-use the file name ID assignment/lookup from XLS proper.[xls][mlir] Add round-trip conversion test for channel properties
This was previously not easily possible due to the incorrect emission of XLS file locations in
xls_translate
.[xls][mlir] Expand ops_translate.mlir test to round-trip verification.
I rolled all this into a single PR because these are all interdependent, probably making review a bit more annoying. Sorry 😇
@jpienaar @jmolloy