xref: /XiangShan/src/main/scala/xiangshan/mem/vector/VMergeBuffer.scala (revision 44b4df4f0c270b7de42252e49cbcc7d48e0cceae)
1/***************************************************************************************
2  * Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
3  * Copyright (c) 2020-2021 Peng Cheng Laboratory
4  *
5  * XiangShan is licensed under Mulan PSL v2.
6  * You can use this software according to the terms and conditions of the Mulan PSL v2.
7  * You may obtain a copy of Mulan PSL v2 at:
8  *          http://license.coscl.org.cn/MulanPSL2
9  *
10  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13  *
14  * See the Mulan PSL v2 for more details.
15  ***************************************************************************************/
16
17package xiangshan.mem
18
19import org.chipsalliance.cde.config.Parameters
20import chisel3._
21import chisel3.util._
22import utils._
23import utility._
24import xiangshan._
25import xiangshan.backend.rob.RobPtr
26import xiangshan.backend.Bundles._
27import xiangshan.ExceptionNO._
28import xiangshan.mem._
29import xiangshan.backend.fu.FuType
30import xiangshan.backend.fu.FuConfig._
31import xiangshan.backend.datapath.NewPipelineConnect
32import freechips.rocketchip.diplomacy.BufferParams
33
34class MBufferBundle(implicit p: Parameters) extends VLSUBundle{
35  val data             = UInt(VLEN.W)
36  val mask             = UInt(VLENB.W)
37  val flowNum          = UInt(flowIdxBits.W)
38  val exceptionVec     = ExceptionVec()
39  val uop              = new DynInst
40  // val vdOffset         = UInt(vOffsetBits.W)
41  val sourceType       = VSFQFeedbackType()
42  val flushState       = Bool()
43  val vdIdx            = UInt(3.W)
44  val elemIdx          = UInt(elemIdxBits.W) // element index
45  // for exception
46  val vstart           = UInt(elemIdxBits.W)
47  val vl               = UInt(elemIdxBits.W)
48  val vaNeedExt        = Bool()
49  val vaddr            = UInt(XLEN.W)
50  val gpaddr           = UInt(GPAddrBits.W)
51  val isForVSnonLeafPTE= Bool()
52  val fof              = Bool()
53  val vlmax            = UInt(elemIdxBits.W)
54
55  def allReady(): Bool = (flowNum === 0.U)
56}
57
58abstract class BaseVMergeBuffer(isVStore: Boolean=false)(implicit p: Parameters) extends VLSUModule{
59  val io = IO(new VMergeBufferIO(isVStore))
60
61  // freeliset: store valid entries index.
62  // +---+---+--------------+-----+-----+
63  // | 0 | 1 |      ......  | n-2 | n-1 |
64  // +---+---+--------------+-----+-----+
65  val freeList: FreeList
66  val uopSize: Int
67  val enqWidth = io.fromSplit.length
68  val deqWidth = io.uopWriteback.length
69  val pipeWidth = io.fromPipeline.length
70  lazy val fuCfg = if (isVStore) VstuCfg else VlduCfg
71
72  def EnqConnect(source: MergeBufferReq, sink: MBufferBundle) = {
73    sink.data         := source.data
74    sink.mask         := source.mask
75    sink.flowNum      := source.flowNum
76    sink.exceptionVec := ExceptionNO.selectByFu(0.U.asTypeOf(ExceptionVec()), fuCfg)
77    sink.uop          := source.uop
78    sink.sourceType   := 0.U.asTypeOf(VSFQFeedbackType())
79    sink.flushState   := false.B
80    sink.vdIdx        := source.vdIdx
81    sink.elemIdx      := Fill(elemIdxBits, 1.U)
82    sink.fof          := source.fof
83    sink.vlmax        := source.vlmax
84    sink.vl           := source.uop.vpu.vl
85    sink.vaddr        := source.vaddr
86    sink.vstart       := 0.U
87  }
88  def DeqConnect(source: MBufferBundle): MemExuOutput = {
89    val sink               = WireInit(0.U.asTypeOf(new MemExuOutput(isVector = true)))
90    sink.data             := source.data
91    sink.mask.get         := source.mask
92    sink.uop              := source.uop
93    sink.uop.exceptionVec := ExceptionNO.selectByFu(source.exceptionVec, fuCfg)
94    sink.uop.vpu.vmask    := source.mask
95    sink.debug            := 0.U.asTypeOf(new DebugBundle)
96    sink.vdIdxInField.get := source.vdIdx // Mgu needs to use this.
97    sink.vdIdx.get        := source.vdIdx
98    sink.uop.vpu.vstart   := source.vstart
99    sink.uop.vpu.vl       := source.vl
100    sink
101  }
102  def ToLsqConnect(source: MBufferBundle): FeedbackToLsqIO = {
103    val sink                                 = WireInit(0.U.asTypeOf(new FeedbackToLsqIO))
104    val hasExp                               = ExceptionNO.selectByFu(source.exceptionVec, fuCfg).asUInt.orR
105    sink.robidx                             := source.uop.robIdx
106    sink.uopidx                             := source.uop.uopIdx
107    sink.feedback(VecFeedbacks.COMMIT)      := !hasExp
108    sink.feedback(VecFeedbacks.FLUSH)       := hasExp
109    sink.feedback(VecFeedbacks.LAST)        := true.B
110    sink.vstart                             := source.vstart // TODO: if lsq need vl for fof?
111    sink.vaddr                              := source.vaddr
112    sink.vaNeedExt                          := source.vaNeedExt
113    sink.gpaddr                             := source.gpaddr
114    sink.isForVSnonLeafPTE                  := source.isForVSnonLeafPTE
115    sink.vl                                 := source.vl
116    sink.exceptionVec                       := ExceptionNO.selectByFu(source.exceptionVec, fuCfg)
117    sink
118  }
119
120
121  val entries      = Reg(Vec(uopSize, new MBufferBundle))
122  val needCancel   = WireInit(VecInit(Seq.fill(uopSize)(false.B)))
123  val allocated    = RegInit(VecInit(Seq.fill(uopSize)(false.B)))
124  val freeMaskVec  = WireInit(VecInit(Seq.fill(uopSize)(false.B)))
125  val uopFinish    = RegInit(VecInit(Seq.fill(uopSize)(false.B)))
126  val needRSReplay = RegInit(VecInit(Seq.fill(uopSize)(false.B)))
127  // enq, from splitPipeline
128  // val allowEnqueue =
129  val cancelEnq    = io.fromSplit.map(_.req.bits.uop.robIdx.needFlush(io.redirect))
130  val canEnqueue   = io.fromSplit.map(_.req.valid)
131  val needEnqueue  = (0 until enqWidth).map{i =>
132    canEnqueue(i) && !cancelEnq(i)
133  }
134
135  val freeCount    = uopSize.U - freeList.io.validCount
136
137  for ((enq, i) <- io.fromSplit.zipWithIndex){
138    freeList.io.doAllocate(i) := false.B
139
140    freeList.io.allocateReq(i) := true.B
141
142    val offset    = PopCount(needEnqueue.take(i))
143    val canAccept = freeList.io.canAllocate(offset)
144    val enqIndex  = freeList.io.allocateSlot(offset)
145    enq.req.ready := freeCount >= (i + 1).U // for better timing
146
147    when(needEnqueue(i) && enq.req.ready){
148      freeList.io.doAllocate(i) := true.B
149      // enqueue
150      allocated(enqIndex)       := true.B
151      uopFinish(enqIndex)       := false.B
152      needRSReplay(enqIndex)    := false.B
153
154      EnqConnect(enq.req.bits, entries(enqIndex))// initial entry
155    }
156
157    enq.resp.bits.mBIndex := enqIndex
158    enq.resp.bits.fail    := false.B
159    enq.resp.valid        := freeCount >= (i + 1).U // for better timing
160  }
161
162  //redirect
163  for (i <- 0 until uopSize){
164    needCancel(i) := entries(i).uop.robIdx.needFlush(io.redirect) && allocated(i)
165    when (needCancel(i)) {
166      allocated(i)   := false.B
167      freeMaskVec(i) := true.B
168      uopFinish(i)   := false.B
169      needRSReplay(i):= false.B
170    }
171  }
172  freeList.io.free := freeMaskVec.asUInt
173  //pipelineWriteback
174  // handle the situation where multiple ports are going to write the same uop queue entry
175  // select the oldest exception and count the flownum of the pipeline writeback.
176  val mergePortMatrix        = Wire(Vec(pipeWidth, Vec(pipeWidth, Bool())))
177  val mergedByPrevPortVec    = Wire(Vec(pipeWidth, Bool()))
178  (0 until pipeWidth).map{case i => (0 until pipeWidth).map{case j =>
179    mergePortMatrix(i)(j) := (j == i).B ||
180      (j > i).B &&
181      io.fromPipeline(j).bits.mBIndex === io.fromPipeline(i).bits.mBIndex &&
182      io.fromPipeline(j).valid
183  }}
184  (0 until pipeWidth).map{case i =>
185    mergedByPrevPortVec(i) := (i != 0).B && Cat((0 until i).map(j =>
186      io.fromPipeline(j).bits.mBIndex === io.fromPipeline(i).bits.mBIndex &&
187      io.fromPipeline(j).valid)).orR
188  }
189  dontTouch(mergePortMatrix)
190  dontTouch(mergedByPrevPortVec)
191
192  // for exception, select exception, when multi port writeback exception, we need select oldest one
193  def selectOldest[T <: VecPipelineFeedbackIO](valid: Seq[Bool], bits: Seq[T], sel: Seq[UInt]): (Seq[Bool], Seq[T], Seq[UInt]) = {
194    assert(valid.length == bits.length)
195    assert(valid.length == sel.length)
196    if (valid.length == 0 || valid.length == 1) {
197      (valid, bits, sel)
198    } else if (valid.length == 2) {
199      val res = Seq.fill(2)(Wire(ValidIO(chiselTypeOf(bits(0)))))
200      for (i <- res.indices) {
201        res(i).valid := valid(i)
202        res(i).bits := bits(i)
203      }
204      val oldest = Mux(valid(0) && valid(1),
205        Mux(sel(0) < sel(1),
206            res(0), res(1)),
207        Mux(valid(0) && !valid(1), res(0), res(1)))
208
209      val oldidx = Mux(valid(0) && valid(1),
210        Mux(sel(0) < sel(1),
211          sel(0), sel(1)),
212        Mux(valid(0) && !valid(1), sel(0), sel(1)))
213      (Seq(oldest.valid), Seq(oldest.bits), Seq(oldidx))
214    } else {
215      val left  = selectOldest(valid.take(valid.length / 2), bits.take(bits.length / 2), sel.take(sel.length / 2))
216      val right = selectOldest(valid.takeRight(valid.length - (valid.length / 2)), bits.takeRight(bits.length - (bits.length / 2)), sel.takeRight(sel.length - (sel.length / 2)))
217      selectOldest(left._1 ++ right._1, left._2 ++ right._2, left._3 ++ right._3)
218    }
219  }
220
221  val pipeValid        = io.fromPipeline.map(_.valid)
222  val pipeBits         = io.fromPipeline.map(_.bits)
223  val wbElemIdx        = pipeBits.map(_.elemIdx)
224  val wbMbIndex        = pipeBits.map(_.mBIndex)
225  val wbElemIdxInField = wbElemIdx.zip(wbMbIndex).map(x => x._1 & (entries(x._2).vlmax - 1.U))
226
227  val portHasExcp       = pipeBits.zip(mergePortMatrix).map{case (port, v) =>
228    (0 until pipeWidth).map{case i =>
229      val pipeHasExcep = ExceptionNO.selectByFu(port.exceptionVec, fuCfg).asUInt.orR
230      (v(i) && ((pipeHasExcep && io.fromPipeline(i).bits.mask.orR) || TriggerAction.isDmode(port.trigger))) // this port have exception or merged port have exception
231    }.reduce(_ || _)
232  }
233
234  for((pipewb, i) <- io.fromPipeline.zipWithIndex){
235    val entry               = entries(wbMbIndex(i))
236    val entryVeew           = entry.uop.vpu.veew
237    val entryIsUS           = LSUOpType.isAllUS(entry.uop.fuOpType)
238    val entryHasException   = ExceptionNO.selectByFu(entry.exceptionVec, fuCfg).asUInt.orR
239    val entryExcp           = entryHasException && entry.mask.orR
240    val entryVaddr          = entry.vaddr
241    val entryVstart         = entry.vstart
242    val entryElemIdx        = entry.elemIdx
243
244    val sel                    = selectOldest(mergePortMatrix(i), pipeBits, wbElemIdxInField)
245    val selPort                = sel._2
246    val selElemInfield         = selPort(0).elemIdx & (entries(wbMbIndex(i)).vlmax - 1.U)
247    val selExceptionVec        = selPort(0).exceptionVec
248    val selVaddr               = selPort(0).vaddr
249    val selElemIdx             = selPort(0).elemIdx
250
251    val isUSFirstUop           = !selPort(0).elemIdx.orR
252    // Only the first unaligned uop of unit-stride needs to be offset.
253    // When unaligned, the lowest bit of mask is 0.
254    //  example: 16'b1111_1111_1111_0000
255    val firstUnmask            = genVFirstUnmask(selPort(0).mask).asUInt
256    val vaddrOffset            = Mux(entryIsUS, firstUnmask, 0.U)
257    val vaddr                  = selVaddr + vaddrOffset
258    val vstart                 = Mux(entryIsUS, selPort(0).vstart, selElemInfield)
259
260    // select oldest port to raise exception
261    when((((entryElemIdx >= selElemIdx) && entryExcp && portHasExcp(i)) || (!entryExcp && portHasExcp(i))) && pipewb.valid && !mergedByPrevPortVec(i)) {
262      entry.uop.trigger     := selPort(0).trigger
263      entry.elemIdx         := selElemIdx
264      when(!entry.fof || vstart === 0.U){
265        // For fof loads, if element 0 raises an exception, vl is not modified, and the trap is taken.
266        entry.vstart       := vstart
267        entry.exceptionVec := ExceptionNO.selectByFu(selExceptionVec, fuCfg)
268        entry.vaddr        := vaddr
269        entry.vaNeedExt    := selPort(0).vaNeedExt
270        entry.gpaddr       := selPort(0).gpaddr
271        entry.isForVSnonLeafPTE := selPort(0).isForVSnonLeafPTE
272      }.otherwise{
273        entry.vl           := vstart
274      }
275    }
276  }
277
278  // for pipeline writeback
279  for((pipewb, i) <- io.fromPipeline.zipWithIndex){
280    val wbIndex          = pipewb.bits.mBIndex
281    val flowNumOffset    = Mux(pipewb.bits.usSecondInv,
282                               2.U,
283                               PopCount(mergePortMatrix(i)))
284    val sourceTypeNext   = entries(wbIndex).sourceType | pipewb.bits.sourceType
285    val hasExp           = ExceptionNO.selectByFu(pipewb.bits.exceptionVec, fuCfg).asUInt.orR
286
287    // if is VLoad, need latch 1 cycle to merge data. only flowNum and wbIndex need to latch
288    val latchWbValid     = if(isVStore) pipewb.valid else RegNext(pipewb.valid)
289    val latchWbIndex     = if(isVStore) wbIndex      else RegEnable(wbIndex, pipewb.valid)
290    val latchFlowNum     = if(isVStore) flowNumOffset else RegEnable(flowNumOffset, pipewb.valid)
291    val latchMergeByPre  = if(isVStore) mergedByPrevPortVec(i) else RegEnable(mergedByPrevPortVec(i), pipewb.valid)
292    when(latchWbValid && !latchMergeByPre){
293      entries(latchWbIndex).flowNum := entries(latchWbIndex).flowNum - latchFlowNum
294    }
295
296    when(pipewb.valid){
297      entries(wbIndex).sourceType   := sourceTypeNext
298      entries(wbIndex).flushState   := pipewb.bits.flushState
299    }
300    when(pipewb.valid && !pipewb.bits.hit){
301      needRSReplay(wbIndex) := true.B
302    }
303    pipewb.ready := true.B
304    XSError((entries(latchWbIndex).flowNum - latchFlowNum > entries(latchWbIndex).flowNum) && latchWbValid && !latchMergeByPre, "FlowWriteback overflow!!\n")
305    XSError(!allocated(latchWbIndex) && latchWbValid, "Writeback error flow!!\n")
306  }
307  // for inorder mem asscess
308  io.toSplit := DontCare
309
310  //uopwriteback(deq)
311  for (i <- 0 until uopSize){
312    when(allocated(i) && entries(i).allReady()){
313      uopFinish(i) := true.B
314    }
315  }
316   val selPolicy = SelectOne("circ", uopFinish, deqWidth) // select one entry to deq
317   private val pipelineOut              = Wire(Vec(deqWidth, DecoupledIO(new MemExuOutput(isVector = true))))
318   private val writeBackOut             = Wire(Vec(deqWidth, DecoupledIO(new MemExuOutput(isVector = true))))
319   private val writeBackOutExceptionVec = writeBackOut.map(_.bits.uop.exceptionVec)
320   for(((port, lsqport), i) <- (pipelineOut zip io.toLsq).zipWithIndex){
321    val canGo    = port.ready
322    val (selValid, selOHVec) = selPolicy.getNthOH(i + 1)
323    val entryIdx = OHToUInt(selOHVec)
324    val selEntry = entries(entryIdx)
325    val selAllocated = allocated(entryIdx)
326    val selFire  = selValid && canGo
327    when(selFire){
328      freeMaskVec(entryIdx) := selAllocated
329      allocated(entryIdx)   := false.B
330      uopFinish(entryIdx)   := false.B
331      needRSReplay(entryIdx):= false.B
332    }
333    //writeback connect
334    port.valid   := selFire && selAllocated && !needRSReplay(entryIdx) && !selEntry.uop.robIdx.needFlush(io.redirect)
335    port.bits    := DeqConnect(selEntry)
336    //to lsq
337    lsqport.bits := ToLsqConnect(selEntry) // when uopwriteback, free MBuffer entry, write to lsq
338    lsqport.valid:= selFire && selAllocated && !needRSReplay(entryIdx)
339    //to RS
340    val feedbackOut                       = WireInit(0.U.asTypeOf(io.feedback(i).bits)).suggestName(s"feedbackOut_${i}")
341    val feedbackValid                     = selFire && selAllocated
342    feedbackOut.hit                      := !needRSReplay(entryIdx)
343    feedbackOut.robIdx                   := selEntry.uop.robIdx
344    feedbackOut.sourceType               := selEntry.sourceType
345    feedbackOut.flushState               := selEntry.flushState
346    feedbackOut.dataInvalidSqIdx         := DontCare
347    feedbackOut.sqIdx                    := selEntry.uop.sqIdx
348    feedbackOut.lqIdx                    := selEntry.uop.lqIdx
349
350    io.feedback(i).valid                 := RegNext(feedbackValid)
351    io.feedback(i).bits                  := RegEnable(feedbackOut, feedbackValid)
352
353    NewPipelineConnect(
354      port, writeBackOut(i), writeBackOut(i).fire,
355      Mux(port.fire,
356        selEntry.uop.robIdx.needFlush(io.redirect),
357        writeBackOut(i).bits.uop.robIdx.needFlush(io.redirect)),
358      Option(s"VMergebufferPipelineConnect${i}")
359    )
360     io.uopWriteback(i)                  <> writeBackOut(i)
361     io.uopWriteback(i).bits.uop.exceptionVec := ExceptionNO.selectByFu(writeBackOutExceptionVec(i), fuCfg)
362   }
363
364  QueuePerf(uopSize, freeList.io.validCount, freeList.io.validCount === 0.U)
365}
366
367class VLMergeBufferImp(implicit p: Parameters) extends BaseVMergeBuffer(isVStore=false){
368  override lazy val uopSize = VlMergeBufferSize
369  println(s"VLMergeBuffer Size: ${VlMergeBufferSize}")
370  override lazy val freeList = Module(new FreeList(
371    size = uopSize,
372    allocWidth = VecLoadPipelineWidth,
373    freeWidth = deqWidth,
374    enablePreAlloc = false,
375    moduleName = "VLoad MergeBuffer freelist"
376  ))
377
378  //merge data
379  val flowWbElemIdx     = Wire(Vec(pipeWidth, UInt(elemIdxBits.W)))
380  val flowWbElemIdxInVd = Wire(Vec(pipeWidth, UInt(elemIdxBits.W)))
381  val pipewbValidReg    = Wire(Vec(pipeWidth, Bool()))
382  val wbIndexReg        = Wire(Vec(pipeWidth, UInt(vlmBindexBits.W)))
383  val mergeDataReg      = Wire(Vec(pipeWidth, UInt(VLEN.W)))
384
385  val maskWithexceptionMask = io.fromPipeline.map{ x=>
386    Mux(
387      TriggerAction.isExp(x.bits.trigger) || TriggerAction.isDmode(x.bits.trigger),
388      ~x.bits.vecTriggerMask,
389      Fill(x.bits.mask.getWidth, !ExceptionNO.selectByFuAndUnSelect(x.bits.exceptionVec, fuCfg, Seq(breakPoint)).asUInt.orR)
390    ).asUInt & x.bits.mask
391  }
392
393  for((pipewb, i) <- io.fromPipeline.zipWithIndex){
394    /** step0 **/
395    val wbIndex = pipewb.bits.mBIndex
396    val alignedType = pipewb.bits.alignedType
397    val elemIdxInsideVd = pipewb.bits.elemIdxInsideVd
398    flowWbElemIdx(i) := pipewb.bits.elemIdx
399    flowWbElemIdxInVd(i) := elemIdxInsideVd.get
400
401    val oldData = PriorityMux(Seq(
402      (pipewbValidReg(0) && (wbIndexReg(0) === wbIndex)) -> mergeDataReg(0),
403      (pipewbValidReg(1) && (wbIndexReg(1) === wbIndex)) -> mergeDataReg(1),
404      (pipewbValidReg(2) && (wbIndexReg(2) === wbIndex)) -> mergeDataReg(2),
405      true.B                                             -> entries(wbIndex).data // default use entries_data
406    ))
407    val mergedData = mergeDataWithElemIdx(
408      oldData = oldData,
409      newData = io.fromPipeline.map(_.bits.vecdata.get),
410      alignedType = alignedType(1,0),
411      elemIdx = flowWbElemIdxInVd,
412      valids = mergePortMatrix(i)
413    )
414    /* this only for unit-stride load data merge
415     * cycle0: broden 128-bits to 256-bits (max 6 to 1)
416     * cycle1: select 128-bits data from 256-bits (16 to 1)
417     */
418    val (brodenMergeData, brodenMergeMask)     = mergeDataByIndex(
419      data    = io.fromPipeline.map(_.bits.vecdata.get).drop(i),
420      mask    = maskWithexceptionMask.drop(i),
421      index   = io.fromPipeline(i).bits.elemIdxInsideVd.get,
422      valids  = mergePortMatrix(i).drop(i)
423    )
424    /** step1 **/
425    pipewbValidReg(i)      := RegNext(pipewb.valid)
426    wbIndexReg(i)          := RegEnable(wbIndex, pipewb.valid)
427    mergeDataReg(i)        := RegEnable(mergedData, pipewb.valid) // for not Unit-stride
428    val brodenMergeDataReg  = RegEnable(brodenMergeData, pipewb.valid) // only for Unit-stride
429    val brodenMergeMaskReg  = RegEnable(brodenMergeMask, pipewb.valid)
430    val mergedByPrevPortReg = RegEnable(mergedByPrevPortVec(i), pipewb.valid)
431    val regOffsetReg        = RegEnable(pipewb.bits.reg_offset.get, pipewb.valid) // only for Unit-stride
432    val isusMerge           = RegEnable(alignedType(2), pipewb.valid)
433
434    val usSelData           = Mux1H(UIntToOH(regOffsetReg), (0 until VLENB).map{case i => getNoAlignedSlice(brodenMergeDataReg, i, 128)})
435    val usSelMask           = Mux1H(UIntToOH(regOffsetReg), (0 until VLENB).map{case i => brodenMergeMaskReg(16 + i - 1, i)})
436    val usMergeData         = mergeDataByByte(entries(wbIndexReg(i)).data, usSelData, usSelMask)
437    when(pipewbValidReg(i) && !mergedByPrevPortReg){
438      entries(wbIndexReg(i)).data := Mux(isusMerge, usMergeData, mergeDataReg(i)) // if aligned(2) == 1, is Unit-Stride inst
439    }
440  }
441}
442
443class VSMergeBufferImp(implicit p: Parameters) extends BaseVMergeBuffer(isVStore=true){
444  override lazy val uopSize = VsMergeBufferSize
445  println(s"VSMergeBuffer Size: ${VsMergeBufferSize}")
446  override lazy val freeList = Module(new FreeList(
447    size = uopSize,
448    allocWidth = VecStorePipelineWidth,
449    freeWidth = deqWidth,
450    enablePreAlloc = false,
451    moduleName = "VStore MergeBuffer freelist"
452  ))
453  override def DeqConnect(source: MBufferBundle): MemExuOutput = {
454    val sink               = Wire(new MemExuOutput(isVector = true))
455    sink.data             := DontCare
456    sink.mask.get         := DontCare
457    sink.uop              := source.uop
458    sink.uop.exceptionVec := source.exceptionVec
459    sink.debug            := 0.U.asTypeOf(new DebugBundle)
460    sink.vdIdxInField.get := DontCare
461    sink.vdIdx.get        := DontCare
462    sink.uop.vpu.vstart   := source.vstart
463    sink
464  }
465}
466