summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/chisel3/package.scala27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/main/scala/chisel3/package.scala b/src/main/scala/chisel3/package.scala
index 7b07d964..50cb3dbe 100644
--- a/src/main/scala/chisel3/package.scala
+++ b/src/main/scala/chisel3/package.scala
@@ -30,18 +30,25 @@ package object chisel3 { // scalastyle:ignore package.object.name
type Element = chisel3.core.Element
type Bits = chisel3.core.Bits
+ // Some possible regex replacements for the literal specifier deprecation:
+ // (note: these are not guaranteed to handle all edge cases! check all replacements!)
+ // Bool((true|false))
+ // => $1.B
+ // UInt\(width\s*=\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\)
+ // => UInt($1.W)
+ // (UInt|SInt|Bits).width\((\d+|[_a-zA-Z][_0-9a-zA-Z]*)\)
+ // => $1($2.W)
+ // (U|S)Int\((-?\d+|0[xX][0-9a-fA-F]+)\)
+ // => $2.$1
+ // UInt\((\d+|0[xX][0-9a-fA-F]+),\s*(?:width\s*=)?\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\)
+ // => $1.U($2.W)
+ // (UInt|SInt|Bool)\(([_a-zA-Z][_0-9a-zA-Z]*)\)
+ // => $2.as$1
+ // (UInt|SInt)\(([_a-zA-Z][_0-9a-zA-Z]*),\s*(?:width\s*=)?\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\)
+ // => $2.as$1($3.W)
+
/** This contains literal constructor factory methods that are deprecated as of Chisel3.
* These will be removed very soon. It's recommended you port your code ASAP.
- *
- * Some recommended regex replacements:
- * (note: these are not guaranteed to handle all edge cases! check all replacements!)
- * Bool((true|false)) => $1.B
- * UInt\(width\s*=\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\) => UInt($1.W)
- * (UInt|SInt|Bits).width\((\d+|[_a-zA-Z][_0-9a-zA-Z]*)\) => $1($2.W)
- * (U|S)Int\((-?\d+|0[xX][0-9a-fA-F]+)\) => $2.$1
- * UInt\((\d+|0[xX][0-9a-fA-F]+),\s*(?:width\s*=)?\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\) => $1.U($2.W)
- * (UInt|SInt|Bool)\(([_a-zA-Z][_0-9a-zA-Z]*)\) => $2.as$1
- * (UInt|SInt)\(([_a-zA-Z][_0-9a-zA-Z]*),\s*(?:width\s*=)?\s*(\d+|[_a-zA-Z][_0-9a-zA-Z]*)\) => $2.as$1($3.W)
*/
trait UIntFactory extends chisel3.core.UIntFactory {
/** Create a UInt literal with inferred width. */