Put instPath before label in AutoCounter output (#1274)

* Put instPath before label in AutoCounter output

In a design with many autocounters being output, it is often the case that the instPath can be:
* quite long
* have common substrings across many of the counters

To simplify post-processing, it is strongly preferred that the instPath is first so that common prefix algorithms
can be used to shorten the autocounter labels.

I think @davidbiancolin has other people who have complained about the consistency of name ordering
in other places as well.

* Fixup validation name generator as well.
This commit is contained in:
Tim Snyder 2022-10-20 20:49:53 +00:00 committed by GitHub
parent c51340dcd2
commit 163b189ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -183,7 +183,7 @@ class AutoCounterTransform extends Transform with AutoCounterConsts {
val eventWidth = portWidthMap(anno.topSink.ref)
EventMetadata(
anno.topSink.ref,
(pathlessLabel +: instPath).mkString("_"),
(instPath :+ pathlessLabel).mkString("_"),
autoCounterAnno.description,
eventWidth,
autoCounterAnno.opType)

View File

@ -54,7 +54,7 @@ case class PerfCounterInstance(
}
/* Adds a formatted path to the label to match the behavior of the transform */
def pathPrefixedLabel: String = (label +: (instPath.reverse)).mkString("_")
def pathPrefixedLabel: String = ((instPath.reverse) :+ label).mkString("_")
/* Quotes the description escapes potentially troublesome characters */
def quoteDescriptionForCSV: String =