File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
main/scala/dependentChisel
test/scala/dependentChisel Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11package dependentChisel
22
3- /* global vars */
3+ /** global and package-wide settings
4+ *
5+ * same as package object in scala 2
6+ */
47object global {
58 val enableWidthCheck = true
69 // val enableWidthCheck = false
@@ -12,4 +15,10 @@ object global {
1215 counter += 1
1316 counter
1417 }
18+
19+ /** my pprint, not show field names
20+ *
21+ * @param x
22+ */
23+ def mPPrint [T ](x : T ) = { pprint.pprintln(x, showFieldNames = false ) }
1524}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import dependentChisel.codegen.sequentialCommands.WeakStmt
2525import dependentChisel .codegen .sequentialCommands .VarDecls
2626import dependentChisel .codegen .sequentialCommands .Skip
2727import dependentChisel .codegen .sequentialCommands .BoolProp
28+ import dependentChisel .global .mPPrint
2829
2930/* more tests for parameterized mod*/
3031class astTransformSuite extends AnyFunSuite {
@@ -33,7 +34,7 @@ class astTransformSuite extends AnyFunSuite {
3334 new adder.Adder1prop
3435 })
3536
36- pprint.pprintln (m.moduleData.commandAsTree())
37+ mPPrint (m.moduleData.commandAsTree())
3738 val newAst =
3839 m.moduleData.transformTree { (ast : TreeNode [Ctrl | Cmds ]) =>
3940 val predicate : Ctrl | Cmds => Boolean = {
@@ -44,7 +45,8 @@ class astTransformSuite extends AnyFunSuite {
4445 treeTraverse.filterTop(predicate, ast)
4546 }
4647
47- pprint.pprintln(newAst)
48+ mPPrint(newAst)
49+ assert(newAst.children.length == 1 , " filtered AST should have only 1 assertion" )
4850 }
4951
5052}
You can’t perform that action at this time.
0 commit comments