Skip to content

Commit

Permalink
Generate NUM_CORES macro in the C++ header (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
poemonsense authored Sep 19, 2023
1 parent f22b2da commit de047e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/Difftest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ object DifftestModule {
difftestCpp += s"#define CPU_$cpu_s"
difftestCpp += ""

val numCores = instances.filter(_._1.isUniqueIdentifier).length
val numCores = instances.count(_._1.isUniqueIdentifier)
difftestCpp += s"#define NUM_CORES $numCores"
difftestCpp += ""

val uniqBundles = instances.groupBy(_._1.desiredModuleName)
// Create cpp declaration for each bundle type
uniqBundles.values.map(_.map(_._1)).foreach(bundles => {
Expand Down

0 comments on commit de047e5

Please sign in to comment.