summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Counter.scala
diff options
context:
space:
mode:
authorJack Koenig2017-12-13 21:13:52 -0800
committeredwardcwang2017-12-13 22:09:55 -0800
commitc327dc328ca819031a086ae102fefe2909831e24 (patch)
treee9b4c9a97b2cb37247b382ce3889127dcfb8adc9 /src/main/scala/chisel3/util/Counter.scala
parentb657a2d5de6d53d5ce7da28908c89773e35083a8 (diff)
Improve some of the ScalaDoc in chisel3.util
Diffstat (limited to 'src/main/scala/chisel3/util/Counter.scala')
-rw-r--r--src/main/scala/chisel3/util/Counter.scala21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/scala/chisel3/util/Counter.scala b/src/main/scala/chisel3/util/Counter.scala
index aa0c0d43..f6f99f67 100644
--- a/src/main/scala/chisel3/util/Counter.scala
+++ b/src/main/scala/chisel3/util/Counter.scala
@@ -4,10 +4,19 @@ package chisel3.util
import chisel3._
import chisel3.internal.naming.chiselName // can't use chisel3_ version because of compile order
-//import chisel3.core.ExplicitCompileOptions.Strict
/** A counter module
- *
+ *
+ * Typically instantiated with apply methods in [[Counter$ object Counter]]
+ *
+ * @example {{{
+ * val countOn = true.B // increment counter every clock cycle
+ * val (counterValue, counterWrap) = Counter(countOn, 4)
+ * when (counterValue === 3.U) {
+ * ...
+ * }
+ * }}}
+ *
* @param n number of counts before the counter resets (or one more than the
* maximum output value of the counter), need not be a power of two
*/
@@ -46,14 +55,6 @@ object Counter
* @param n number of counts before the counter resets
* @return tuple of the counter value and whether the counter will wrap (the value is at
* maximum and the condition is true).
- *
- * @example {{{
- * val countOn = true.B // increment counter every clock cycle
- * val (counterValue, counterWrap) = Counter(countOn, 4)
- * when (counterValue === 3.U) {
- * ...
- * }
- * }}}
*/
@chiselName
def apply(cond: Bool, n: Int): (UInt, Bool) = {