summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/experimental
diff options
context:
space:
mode:
authorAditya Naik2024-05-31 16:43:42 -0700
committerAditya Naik2024-05-31 16:43:42 -0700
commit9b61af16227ee41aae15dbcc2243e2c6493955c4 (patch)
treefc192f8a3bb56b927ff66217468a4e6bd944fcfc /core/src/main/scala/chisel3/experimental
parentcaf746088b7d92def18f2b3d6ccb7dfd9860e64b (diff)
Remove sourceinfo, compileoptions and other fixes
35 erros
Diffstat (limited to 'core/src/main/scala/chisel3/experimental')
-rw-r--r--core/src/main/scala/chisel3/experimental/Analog.scala9
-rw-r--r--core/src/main/scala/chisel3/experimental/Attach.scala7
-rw-r--r--core/src/main/scala/chisel3/experimental/ChiselEnum.scala56
-rw-r--r--core/src/main/scala/chisel3/experimental/package.scala26
4 files changed, 39 insertions, 59 deletions
diff --git a/core/src/main/scala/chisel3/experimental/Analog.scala b/core/src/main/scala/chisel3/experimental/Analog.scala
index 7bb0ac5d..c932228f 100644
--- a/core/src/main/scala/chisel3/experimental/Analog.scala
+++ b/core/src/main/scala/chisel3/experimental/Analog.scala
@@ -3,12 +3,10 @@
package chisel3.experimental
import chisel3.internal.firrtl.Width
-import chisel3.internal.sourceinfo.SourceInfo
import chisel3.internal._
import chisel3.{
ActualDirection,
Bits,
- CompileOptions,
Data,
Element,
PString,
@@ -49,7 +47,7 @@ final class Analog private (private[chisel3] val width: Width) extends Element {
// Used to enforce single bulk connect of Analog types, multi-attach is still okay
// Note that this really means 1 bulk connect per Module because a port can
// be connected in the parent module as well
- private[chisel3] val biConnectLocs = mutable.Map.empty[BaseModule, SourceInfo]
+ // private[chisel3] val biConnectLocs = mutable.Map.empty[BaseModule]
// Define setter/getter pairing
// Analog can only be bound to Ports and Wires (and Unbound)
@@ -75,14 +73,11 @@ final class Analog private (private[chisel3] val width: Width) extends Element {
binding = target
}
- override def do_asUInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt =
+ override def do_asUInt: UInt =
throwException("Analog does not support asUInt")
private[chisel3] override def connectFromBits(
that: Bits
- )(
- implicit sourceInfo: SourceInfo,
- compileOptions: CompileOptions
): Unit = {
throwException("Analog does not support connectFromBits")
}
diff --git a/core/src/main/scala/chisel3/experimental/Attach.scala b/core/src/main/scala/chisel3/experimental/Attach.scala
index 1d32e941..a0c6121d 100644
--- a/core/src/main/scala/chisel3/experimental/Attach.scala
+++ b/core/src/main/scala/chisel3/experimental/Attach.scala
@@ -6,7 +6,6 @@ import chisel3.RawModule
import chisel3.internal._
import chisel3.internal.Builder.pushCommand
import chisel3.internal.firrtl._
-import chisel3.internal.sourceinfo.SourceInfo
object attach {
// Exceptions that can be generated by attach
@@ -15,12 +14,12 @@ object attach {
AttachException(": Conditional attach is not allowed!")
// Actual implementation
- private[chisel3] def impl(elts: Seq[Analog], contextModule: BaseModule)(implicit sourceInfo: SourceInfo): Unit = {
+ private[chisel3] def impl(elts: Seq[Analog], contextModule: BaseModule): Unit = {
if (Builder.whenDepth != 0) throw ConditionalAttachException
// TODO Check that references are valid and can be attached
- pushCommand(Attach(sourceInfo, elts.map(_.lref)))
+ pushCommand(Attach(elts.map(_.lref)))
}
/** Create an electrical connection between [[Analog]] components
@@ -34,7 +33,7 @@ object attach {
* attach(a1, a2)
* }}}
*/
- def apply(elts: Analog*)(implicit sourceInfo: SourceInfo): Unit = {
+ def apply(elts: Analog*): Unit = {
try {
impl(elts, Builder.forcedUserModule)
} catch {
diff --git a/core/src/main/scala/chisel3/experimental/ChiselEnum.scala b/core/src/main/scala/chisel3/experimental/ChiselEnum.scala
index b8317a02..d8c3fe0b 100644
--- a/core/src/main/scala/chisel3/experimental/ChiselEnum.scala
+++ b/core/src/main/scala/chisel3/experimental/ChiselEnum.scala
@@ -7,7 +7,6 @@ import chisel3._
import chisel3.internal.Builder.pushOp
import chisel3.internal.firrtl.PrimOp._
import chisel3.internal.firrtl._
-import chisel3.internal.sourceinfo._
import chisel3.internal.{throwException, Binding, Builder, ChildBinding, ConstrainedBinding, InstanceId}
import firrtl.annotations._
@@ -89,7 +88,7 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
override def cloneType: this.type = factory().asInstanceOf[this.type]
- private[chisel3] def compop(sourceInfo: SourceInfo, op: PrimOp, other: EnumType): Bool = {
+ private[chisel3] def compop(op: PrimOp, other: EnumType): Bool = {
requireIsHardware(this, "bits operated on")
requireIsHardware(other, "bits operated on")
@@ -97,7 +96,7 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
throwException(s"Enum types are not equivalent: ${this.enumTypeName}, ${other.enumTypeName}")
}
- pushOp(DefPrim(sourceInfo, Bool(), op, this.ref, other.ref))
+ pushOp(DefPrim(Bool(), op, this.ref, other.ref))
}
private[chisel3] override def typeEquivalent(that: Data): Boolean = {
@@ -107,32 +106,29 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
private[chisel3] override def connectFromBits(
that: Bits
- )(
- implicit sourceInfo: SourceInfo,
- compileOptions: CompileOptions
): Unit = {
this := factory.apply(that.asUInt)
}
- def ===(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, EqualOp, that)
- def =/=(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, NotEqualOp, that)
- def <(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, LessOp, that)
- def >(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, GreaterOp, that)
- def <=(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, LessEqOp, that)
- def >=(that: EnumType)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool =
- compop(sourceInfo, GreaterEqOp, that)
-
- override def asUInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt =
- pushOp(DefPrim(sourceInfo, UInt(width), AsUIntOp, ref))
+ def ===(that: EnumType): Bool =
+ compop(EqualOp, that)
+ def =/=(that: EnumType): Bool =
+ compop(NotEqualOp, that)
+ def <(that: EnumType): Bool =
+ compop(LessOp, that)
+ def >(that: EnumType): Bool =
+ compop(GreaterOp, that)
+ def <=(that: EnumType): Bool =
+ compop(LessEqOp, that)
+ def >=(that: EnumType): Bool =
+ compop(GreaterEqOp, that)
+
+ override def asUInt: UInt =
+ pushOp(DefPrim(UInt(width), AsUIntOp, ref))
protected[chisel3] override def width: Width = factory.width
- def isValid(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = {
+ def isValid: Bool = {
if (litOption.isDefined) {
true.B
} else {
@@ -145,7 +141,7 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
* @param s a [[scala.collection.Seq$ Seq]] of enumeration values to look for
* @return a hardware [[Bool]] that indicates if this value matches any of the given values
*/
- final def isOneOf(s: Seq[EnumType])(using sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = {
+ final def isOneOf(s: Seq[EnumType]): Bool = {
VecInit(s.map(this === _)).asUInt().orR()
}
@@ -158,12 +154,9 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
final def isOneOf(
u1: EnumType,
u2: EnumType*
- )(
- implicit sourceInfo: SourceInfo,
- compileOptions: CompileOptions
): Bool = isOneOf(u1 +: u2.toSeq)
- def next(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): this.type = {
+ def next: this.type = {
if (litOption.isDefined) {
val index = factory.all.indexOf(this)
@@ -247,8 +240,6 @@ abstract class EnumType(private[chisel3] val factory: ChiselEnum, selfAnnotating
protected def enumTypeName: String = factory.enumTypeName
def toPrintable: Printable = {
- implicit val sourceInfo = UnlocatableSourceInfo
- implicit val compileOptions = ExplicitCompileOptions.Strict
val allNames = factory.allNames.zip(factory.all)
val nameSize = allNames.map(_._1.length).max
def leftPad(str: String): String = {
@@ -341,9 +332,6 @@ abstract class EnumFactory {
private def castImpl(
n: UInt,
warn: Boolean
- )(
- implicit sourceInfo: SourceInfo,
- connectionCompileOptions: CompileOptions
): Type = {
if (n.litOption.isDefined) {
enumInstances.find(_.litValue == n.litValue) match {
@@ -374,7 +362,7 @@ abstract class EnumFactory {
* @param n the UInt to cast
* @return the equivalent Enum to the value of the cast UInt
*/
- def apply(n: UInt)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Type =
+ def apply(n: UInt): Type =
castImpl(n, warn = true)
/** Safely cast an [[UInt]] to the type of this Enum
@@ -383,7 +371,7 @@ abstract class EnumFactory {
* @return the equivalent Enum to the value of the cast UInt and a Bool indicating if the
* Enum is valid
*/
- def safe(n: UInt)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): (Type, Bool) = {
+ def safe(n: UInt): (Type, Bool) = {
val t = castImpl(n, warn = false)
(t, t.isValid)
}
diff --git a/core/src/main/scala/chisel3/experimental/package.scala b/core/src/main/scala/chisel3/experimental/package.scala
index f4575ceb..4862e209 100644
--- a/core/src/main/scala/chisel3/experimental/package.scala
+++ b/core/src/main/scala/chisel3/experimental/package.scala
@@ -2,9 +2,7 @@
package chisel3
-import chisel3.ExplicitCompileOptions.Strict
import chisel3.experimental.DataMirror.internal.chiselTypeClone
-import chisel3.internal.sourceinfo.SourceInfo
/** Package for experimental features, which may have their API changed, be removed, etc.
*
@@ -124,7 +122,7 @@ package object experimental {
object BundleLiterals {
implicit class AddBundleLiteralConstructor[T <: Record](x: T) {
- def Lit(elems: (T => (Data, Data))*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = {
+ def Lit(elems: (T => (Data, Data))*): T = {
x._makeLit(elems: _*)
}
}
@@ -141,7 +139,7 @@ package object experimental {
* @param elems tuples of an index and a literal value
* @return
*/
- def Lit(elems: (Int, T)*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Vec[T] = {
+ def Lit(elems: (Int, T)*): Vec[T] = {
x._makeLit(elems: _*)
}
}
@@ -151,7 +149,7 @@ package object experimental {
/** This provides an literal construction method for cases using
* object `Vec` as in `Vec.Lit(1.U, 2.U)`
*/
- def Lit[T <: Data](elems: T*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Vec[T] = {
+ def Lit[T <: Data](elems: T*): Vec[T] = {
require(elems.nonEmpty, s"Lit.Vec(...) must have at least one element")
val indexElements: Seq[(Int, T)] = elems.zipWithIndex.map { case (element, index) => (index, element) }
val widestElement: T = elems.maxBy(_.getWidth)
@@ -198,7 +196,7 @@ package object experimental {
* Users may not instantiate this class directly. Instead they should use the implicit conversion from `Tuple2` in
* `chisel3.experimental.conversions`
*/
- final class HWTuple2[+A <: Data, +B <: Data] private[chisel3] (val _1: A, val _2: B) extends Bundle()(Strict) {
+ final class HWTuple2[+A <: Data, +B <: Data] private[chisel3] (val _1: A, val _2: B) extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple2(chiselTypeClone(_1), chiselTypeClone(_2))
@@ -213,7 +211,7 @@ package object experimental {
val _1: A,
val _2: B,
val _3: C)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple3(
@@ -233,7 +231,7 @@ package object experimental {
val _2: B,
val _3: C,
val _4: D)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple4(
@@ -255,7 +253,7 @@ package object experimental {
val _3: C,
val _4: D,
val _5: E)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple5(
@@ -279,7 +277,7 @@ package object experimental {
val _4: D,
val _5: E,
val _6: F)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple6(
@@ -313,7 +311,7 @@ package object experimental {
val _5: E,
val _6: F,
val _7: G)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple7(
@@ -350,7 +348,7 @@ package object experimental {
val _6: F,
val _7: G,
val _8: H)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple8(
@@ -390,7 +388,7 @@ package object experimental {
val _7: G,
val _8: H,
val _9: I)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple9(
@@ -433,7 +431,7 @@ package object experimental {
val _8: H,
val _9: I,
val _10: J)
- extends Bundle()(Strict) {
+ extends Bundle() {
// Because this implementation exists in chisel3.core, it cannot compile with the plugin, so we implement the behavior manually
override protected def _usingPlugin: Boolean = true
override protected def _cloneTypeImpl: Bundle = new HWTuple10(