Skip to content
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

[FIRRTL][OMIR] Two small format fixes #2053

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/Dialect/FIRRTL/Transforms/EmitOMIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ void EmitOMIRPass::emitSourceInfo(Location input, SmallString<64> &into) {
});
if (!into.empty())
into.append("]");
else
into.append("UnlocatableSourceInfo");
}

/// Emit an entire `OMNode` as JSON.
Expand Down Expand Up @@ -626,7 +628,7 @@ void EmitOMIRPass::emitTrackedTarget(DictionaryAttr node,
// `OMDeleted` node.
if (type == "OMReferenceTarget" || type == "OMMemberReferenceTarget" ||
type == "OMMemberInstanceTarget")
return jsonStream.value("OMDeleted");
return jsonStream.value("OMDeleted:");

// The remaining types produce an error upon removal of the target.
auto diag = getOperation().emitError("tracked OMIR target of type `")
Expand Down
8 changes: 4 additions & 4 deletions test/Dialect/FIRRTL/emit-omir.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ firrtl.circuit "EmptyNode" attributes {annotations = [{class = "freechips.rocket
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: sv.verbatim
// CHECK-SAME: \22info\22: \22\22
// CHECK-SAME: \22info\22: \22UnlocatableSourceInfo\22
// CHECK-SAME: \22id\22: \22OMID:0\22
// CHECK-SAME: \22fields\22: []

Expand Down Expand Up @@ -228,11 +228,11 @@ firrtl.circuit "DeletedTargets" attributes {annotations = [{
// CHECK-LABEL: firrtl.circuit "DeletedTargets"
// CHECK: sv.verbatim
// CHECK-SAME: \22name\22: \22a\22
// CHECK-SAME: \22value\22: \22OMDeleted\22
// CHECK-SAME: \22value\22: \22OMDeleted:\22
// CHECK-SAME: \22name\22: \22b\22
// CHECK-SAME: \22value\22: \22OMDeleted\22
// CHECK-SAME: \22value\22: \22OMDeleted:\22
// CHECK-SAME: \22name\22: \22c\22
// CHECK-SAME: \22value\22: \22OMDeleted\22
// CHECK-SAME: \22value\22: \22OMDeleted:\22

//===----------------------------------------------------------------------===//
// Make SRAM Paths Absolute (`SetOMIRSRAMPaths`)
Expand Down