diff options
| author | Andrew Waterman | 2016-08-15 22:48:14 -0700 |
|---|---|---|
| committer | GitHub | 2016-08-15 22:48:14 -0700 |
| commit | ddb7278760029be9d960ba8bf2b06ac8a8aac767 (patch) | |
| tree | 1c9e7306c2de99abc233d4dc8fe8640ce82e5cad /chiselFrontend/src/main/scala/chisel3/core/Bits.scala | |
| parent | 2a074c828ddd8e6c20fa21d618664d50120f3d7a (diff) | |
Make "def width" a private API; expose isWidthKnown instead (#257)
* Make "def width" a private API; expose isWidthKnown instead
Resolves #256.
Since width was used to determine whether getWidth would succeed, I added
def isWidthKnown: Boolean
but another option would be to expose something like
def widthOption: Option[Int]
...thoughts?
* Document getWidth/isWidthKnown
* Add widthOption for more idiomatic Scala manipulation of widths
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Bits.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Bits.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala index 9cca5d9d..015b9dfb 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala @@ -14,7 +14,7 @@ import chisel3.internal.firrtl.PrimOp._ /** Element is a leaf data type: it cannot contain other Data objects. Example * uses are for representing primitive data types, like integers and bits. */ -abstract class Element(dirArg: Direction, val width: Width) extends Data(dirArg) +abstract class Element(dirArg: Direction, private[core] val width: Width) extends Data(dirArg) /** A data type for values represented by a single bitvector. Provides basic * bitwise operations. |
