diff options
| author | Aditya Naik | 2023-12-24 12:14:15 -0800 |
|---|---|---|
| committer | Aditya Naik | 2023-12-24 12:14:15 -0800 |
| commit | 5b39780a564bb46fecda1be0302ec496b6595ef1 (patch) | |
| tree | 48663c94c7f66d31ea7f43a346ea8ae92cfba6b3 /core/src | |
| parent | 783bcb8b3436e342a04169eaf967db2dbc58abc7 (diff) | |
Add arithmetic
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/main/scala/chisel3/Bits.scala | 2 | ||||
| -rw-r--r-- | core/src/main/scala/chisel3/MetaConnect.scala | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/core/src/main/scala/chisel3/Bits.scala b/core/src/main/scala/chisel3/Bits.scala index 70704e01..65c5cedf 100644 --- a/core/src/main/scala/chisel3/Bits.scala +++ b/core/src/main/scala/chisel3/Bits.scala @@ -453,7 +453,7 @@ sealed abstract class Bits(private[chisel3] val width: Width) extends Element wi * @define expandingWidth @note The width of the returned $coll is `width of this` + `1`. * @define constantWidth @note The width of the returned $coll is unchanged, i.e., `width of this`. */ -sealed class UInt private[chisel3] (width: Width) extends Bits(width) with Num[UInt] { +class UInt (width: Width) extends Bits(width) with Num[UInt] { override def toString: String = { litOption match { case Some(value) => s"UInt$width($value)" diff --git a/core/src/main/scala/chisel3/MetaConnect.scala b/core/src/main/scala/chisel3/MetaConnect.scala new file mode 100644 index 00000000..ebdff5f8 --- /dev/null +++ b/core/src/main/scala/chisel3/MetaConnect.scala @@ -0,0 +1,24 @@ +package chisel3 + +object MetaConnect { + implicit class Connection[A](that: A) { + def makeConnection[B](me: B)(implicit f: A => B => A): Unit = { + println(me, that) + (me, that) match { + case (a: Data, b: Data) => { + if (a == b) { + a.connect(b) + } + else { + + } + } + case (_, _) => + } + } + // def makeConnection[B](me: B): Unit = { + + // } + // def :=(a: Data, b: Data) = a.connect(b) + } +} |
