diff options
| author | ducky | 2016-11-17 13:22:31 -0800 |
|---|---|---|
| committer | ducky | 2016-11-21 13:31:12 -0800 |
| commit | c270598ddb8cbfa32f8c86cc5187c89d00e6ded0 (patch) | |
| tree | 76567ca12ea4ed42732f96527e2b1ffae571488a /chiselFrontend | |
| parent | 37a569372c70a651c813d0beb44124878a596e73 (diff) | |
Remove () from as_Int
Diffstat (limited to 'chiselFrontend')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/package.scala | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/package.scala b/chiselFrontend/src/main/scala/chisel3/core/package.scala index cae64df6..3defb4f9 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/package.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/package.scala @@ -33,24 +33,16 @@ package chisel3 { /** Int to UInt conversion, recommended style for variables. */ - def asUInt(): UInt = UInt.Lit(x, Width()) + def asUInt: UInt = UInt.Lit(x, Width()) /** Int to SInt conversion, recommended style for variables. */ - def asSInt(): SInt = SInt.Lit(x, Width()) + def asSInt: SInt = SInt.Lit(x, Width()) /** Int to UInt conversion with specified width, recommended style for variables. */ def asUInt(width: Width): UInt = UInt.Lit(x, width) /** Int to SInt conversion with specified width, recommended style for variables. */ def asSInt(width: Width): SInt = SInt.Lit(x, width) - - /** Int to UInt conversion with specified width, recommended style for variables. - */ - //def asUInt(width: Int): UInt = UInt.Lit(x, Width(width)) - /** Int to SInt conversion with specified width, recommended style for variables. - */ - //def asSInt(width: Int): SInt = SInt(x, Width(width)) - } implicit class fromBigIntToLiteral(val x: BigInt) { @@ -69,33 +61,32 @@ package chisel3 { /** Int to UInt conversion, recommended style for variables. */ - def asUInt(): UInt = UInt.Lit(x, Width()) + def asUInt: UInt = UInt.Lit(x, Width()) /** Int to SInt conversion, recommended style for variables. */ - def asSInt(): SInt = SInt.Lit(x, Width()) + def asSInt: SInt = SInt.Lit(x, Width()) /** Int to UInt conversion with specified width, recommended style for variables. */ def asUInt(width: Width): UInt = UInt.Lit(x, width) /** Int to SInt conversion with specified width, recommended style for variables. */ def asSInt(width: Width): SInt = SInt.Lit(x, width) - - /** Int to UInt conversion with specified width, recommended style for variables. - */ - // def asUInt(width: Int): UInt = UInt.Lit(x, Width(width)) - /** Int to SInt conversion with specified width, recommended style for variables. - */ - // def asSInt(width: Int): SInt = SInt(x, width) } implicit class fromStringToLiteral(val x: String) { /** String to UInt parse, recommended style for constants. */ - def U: UInt = UInt.Lit(fromStringToLiteral.parse(x), fromStringToLiteral.parsedWidth(x)) // scalastyle:ignore method.name + def U: UInt = UInt.Lit(fromStringToLiteral.parse(x), fromStringToLiteral.parsedWidth(x)) // scalastyle:ignore method.name + /** String to UInt parse with specified width, recommended style for constants. + */ + def U(width: Width): UInt = UInt.Lit(fromStringToLiteral.parse(x), width) // scalastyle:ignore method.name /** String to UInt parse, recommended style for variables. */ def asUInt: UInt = UInt.Lit(fromStringToLiteral.parse(x), fromStringToLiteral.parsedWidth(x)) + /** String to UInt parse with specified width, recommended style for variables. + */ + def asUInt(width: Width): UInt = UInt.Lit(fromStringToLiteral.parse(x), width) } object fromStringToLiteral { |
