Skip to content

Commit

Permalink
Axi4Stream: remove dataWidth to userWidth dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
oletf committed Nov 27, 2023
1 parent a0f6837 commit 6313695
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/main/scala/spinal/lib/bus/amba4/axis/Axi4Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import spinal.lib._
* @param dataWidth Width of the bus in BYTES
* @param idWidth Width of the ID field in bits
* @param destWidth Width of the Destination field in bits
* @param userWidth Width of the User field in bits
* @param userWidth Width of the User field in BYTES
* @param useStrb Use byte strobe bits
* @param useKeep Use byte keep bits
* @param useLast Use last bit
Expand Down Expand Up @@ -36,7 +36,7 @@ object Axi4Stream {
val keep = (config.useKeep) generate Bits(config.dataWidth bit)
val last = (config.useLast) generate Bool()
val dest = (config.useDest) generate UInt(config.destWidth bit)
val user = (config.useUser) generate Bits(config.userWidth*config.dataWidth bit)
val user = (config.useUser) generate Bits(8*config.userWidth bit)

def isLast = if (this.last != null) this.last else False

Expand Down Expand Up @@ -65,8 +65,8 @@ object Axi4Stream {
case (true, false) => B(this.user.bitsRange -> false)
case (false, true) => LocatedPendingError(s"${that.user} can't drive $this because the corresponding sink signal does not exist")
case (true, true) => {
val sourceSlices = that.user.subdivideIn(that.config.dataWidth slices)
val sinkSlices = this.user.subdivideIn(this.config.dataWidth slices)
val sourceSlices = that.user.subdivideIn(that.config.userWidth slices)
val sinkSlices = this.user.subdivideIn(this.config.userWidth slices)
val sourceSlicesPad = sourceSlices.padTo(sinkSlices.length, null)
sourceSlicesPad.zip(sinkSlices).foreach(pair => {
val (sourceSlice, sinkSlice) = pair
Expand Down

0 comments on commit 6313695

Please sign in to comment.