diff options
| author | Jack Koenig | 2019-09-16 15:54:31 -0700 |
|---|---|---|
| committer | Jim Lawson | 2019-09-16 15:54:31 -0700 |
| commit | e939181aebb5a0131562609a5782e1f1df88699d (patch) | |
| tree | cb01c1e3438ae123061f2147600fd961ce509f1e /coreMacros/src | |
| parent | a83647a91326bcd2ac0e3c664056b5ced212cc67 (diff) | |
Da steve101 tree reduce (#485)
* Add a tree reduce function to Vec
* Change function names of reduce operation function in Vec
* Change reference to single layer operation in Vec.reduce
* Commint name change for pair macro
* Remove pair, call not necessary and can just be used from grouped(2) and map
* Changed to reduceTree, added default identity function for single reduce.
* Change style of Vec.reduceTree and tests to chisel3 and canonical Scala style
* Cleanup Vec initialization, implicitCompileOptions
Diffstat (limited to 'coreMacros/src')
| -rw-r--r-- | coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala index e69c569a..d38396f4 100644 --- a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala +++ b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala @@ -84,6 +84,12 @@ class VecTransform(val c: Context) extends SourceInfoTransformMacro { def contains(x: c.Tree)(ev: c.Tree): c.Tree = { q"$thisObj.do_contains($x)($implicitSourceInfo, $ev, $implicitCompileOptions)" } + def reduceTree(redOp: c.Tree, layerOp: c.Tree): c.Tree = { + q"$thisObj.do_reduceTree($redOp,$layerOp)($implicitSourceInfo, $implicitCompileOptions)" + } + def reduceTreeDefault(redOp: c.Tree ): c.Tree = { + q"$thisObj.do_reduceTree($redOp)($implicitSourceInfo, $implicitCompileOptions)" + } } /** "Automatic" source information transform / insertion macros, which generate the function name |
