Skip to content

Commit

Permalink
Rename DeclareOutputDir to OutputDirPrecedence
Browse files Browse the repository at this point in the history
  • Loading branch information
rwy7 committed May 22, 2024
1 parent b501eee commit 9a8c66a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/Dialects/FIRRTL/FIRRTLAnnotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1478,11 +1478,11 @@ Example:
}
```

### DeclareOutputDirAnnotation
### OutputDirPrecedenceAnnotation

| Property | Type | Description |
| ---------- | ------- | --------------------------------------- |
| class | string | `circt.DeclareOutputDirAnnotation` |
| class | string | `circt.OutputDirPrecedenceAnnotation` |
| name | string | The output directory |
| parent | string | The parent output directory |

Expand Down Expand Up @@ -1512,7 +1512,7 @@ parent.
Example:
```json
{
"class": "circt.DeclareOutputDirAnnotation",
"class": "circt.OutputDirPrecedenceAnnotation",
"name": "verification_extras",
"parent": "verification"
}
Expand Down
4 changes: 2 additions & 2 deletions include/circt/Dialect/FIRRTL/AnnotationDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ constexpr const char *testBenchDirAnnoClass =
constexpr const char *moduleHierAnnoClass =
"sifive.enterprise.firrtl.ModuleHierarchyAnnotation";
constexpr const char *outputDirAnnoClass = "circt.OutputDirAnnotation";
constexpr const char *declareOutputDirAnnoClass =
"circt.DeclareOutputDirAnnotation";
constexpr const char *ouputDirPrecedenceAnnoClass =
"circt.OutputDirPrecedenceAnnotation";
constexpr const char *testHarnessHierAnnoClass =
"sifive.enterprise.firrtl.TestHarnessHierarchyAnnotation";
constexpr const char *retimeModulesFileAnnoClass =
Expand Down
2 changes: 1 addition & 1 deletion include/circt/Dialect/FIRRTL/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def AssignOutputDirs : Pass<"firrtl-assign-output-dirs", "firrtl::CircuitOp"> {

The least common ancestor is chosen according to a precedence graph provided
by the user through a circuit level annotation called
`DeclareOutputDirAnnotation`. The default output directory is implicitly the
`OutputDirPrecedenceAnnotation`. The default output directory is implicitly the
common ancestor of all other output directories.
}];
let constructor = "circt::firrtl::createAssignOutputDirsPass()";
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/AssignOutputDirs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ LogicalResult OutputDirTable::initialize(CircuitOp circuit) {
infoTable.emplace_back(nullptr, 0, SIZE_MAX);
AnnotationSet annos(circuit);
for (auto anno : annos) {
if (anno.isClass(declareOutputDirAnnoClass)) {
if (anno.isClass(ouputDirPrecedenceAnnoClass)) {
auto nameField = anno.getMember<StringAttr>("name");
if (!nameField)
return err() << "output directory declaration missing name";
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static llvm::StringMap<AnnoRecord> annotationRecords{{
{metadataDirectoryAttrName, NoTargetAnnotation},
{moduleHierAnnoClass, NoTargetAnnotation},
{outputDirAnnoClass, {stdResolve, applyOutputDirAnno}},
{declareOutputDirAnnoClass, NoTargetAnnotation},
{ouputDirPrecedenceAnnoClass, NoTargetAnnotation},
{sitestTestHarnessBlackBoxAnnoClass, NoTargetAnnotation},
{testBenchDirAnnoClass, NoTargetAnnotation},
{testHarnessHierAnnoClass, NoTargetAnnotation},
Expand Down
6 changes: 3 additions & 3 deletions test/Dialect/FIRRTL/assign-output-dirs.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ firrtl.circuit "AssignOutputDirs"
// A B
// C D
annotations = [
{class = "circt.DeclareOutputDirAnnotation", name = "B", parent = ""},
{class = "circt.DeclareOutputDirAnnotation", name = "C", parent = "A"},
{class = "circt.DeclareOutputDirAnnotation", name = "D", parent = "A"}
{class = "circt.OutputDirPrecedenceAnnotation", name = "B", parent = ""},
{class = "circt.OutputDirPrecedenceAnnotation", name = "C", parent = "A"},
{class = "circt.OutputDirPrecedenceAnnotation", name = "D", parent = "A"}
]
} {

Expand Down
6 changes: 3 additions & 3 deletions test/firtool/dedup-modules-with-output-dirs.fir
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,17 @@ circuit Top: %[[
"target": "~Top|B"
},
{
"class": "circt.DeclareOutputDirAnnotation",
"class": "circt.OutputDirPrecedenceAnnotation",
"name": "XXX",
"parent": "ZZZ"
},
{
"class": "circt.DeclareOutputDirAnnotation",
"class": "circt.OutputDirPrecedenceAnnotation",
"name": "YYY",
"parent": "ZZZ"
},
{
"class": "circt.DeclareOutputDirAnnotation",
"class": "circt.OutputDirPrecedenceAnnotation",
"name": "ZZZ",
"parent": ""
}
Expand Down

0 comments on commit 9a8c66a

Please sign in to comment.