xref: /XiangShan/src/main/scala/xiangshan/Bundle.scala (revision 124bf66ab86a0eea8a5ebddde77457289668a0e7)
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
18
19import chipsalliance.rocketchip.config.Parameters
20import chisel3._
21import chisel3.util.BitPat.bitPatToUInt
22import chisel3.util._
23import utility._
24import utils._
25import xiangshan.backend.CtrlToFtqIO
26import xiangshan.backend.decode.{ImmUnion, XDecode}
27import xiangshan.backend.rob.RobPtr
28import xiangshan.frontend._
29import xiangshan.mem.{LqPtr, SqPtr}
30import xiangshan.v2backend.Bundles.DynInst
31import xiangshan.v2backend.FuType
32
33class ValidUndirectioned[T <: Data](gen: T) extends Bundle {
34  val valid = Bool()
35  val bits = gen.cloneType.asInstanceOf[T]
36
37}
38
39object ValidUndirectioned {
40  def apply[T <: Data](gen: T) = {
41    new ValidUndirectioned[T](gen)
42  }
43}
44
45object RSFeedbackType {
46  val tlbMiss         = 0.U(4.W)
47  val mshrFull        = 1.U(4.W)
48  val dataInvalid     = 2.U(4.W)
49  val bankConflict    = 3.U(4.W)
50  val ldVioCheckRedo  = 4.U(4.W)
51  val feedbackInvalid = 7.U(4.W)
52  val issueSuccess    = 8.U(4.W)
53  val issueFail       = 9.U(4.W)
54  val rfArbitSuccess  = 10.U(4.W)
55  val rfArbitFail     = 11.U(4.W)
56  val fuIdle          = 12.U(4.W)
57  val fuBusy          = 13.U(4.W)
58
59  def apply() = UInt(4.W)
60
61  def isStageSuccess(feedbackType: UInt) = {
62    feedbackType === issueSuccess
63  }
64
65  def isBlocked(feedbackType: UInt) = {
66    feedbackType === issueFail || feedbackType === rfArbitFail || feedbackType === fuBusy
67  }
68}
69
70class PredictorAnswer(implicit p: Parameters) extends XSBundle {
71  val hit    = if (!env.FPGAPlatform) Bool() else UInt(0.W)
72  val taken  = if (!env.FPGAPlatform) Bool() else UInt(0.W)
73  val target = if (!env.FPGAPlatform) UInt(VAddrBits.W) else UInt(0.W)
74}
75
76class CfiUpdateInfo(implicit p: Parameters) extends XSBundle with HasBPUParameter {
77  // from backend
78  val pc = UInt(VAddrBits.W)
79  // frontend -> backend -> frontend
80  val pd = new PreDecodeInfo
81  val rasSp = UInt(log2Up(RasSize).W)
82  val rasEntry = new RASEntry
83  // val hist = new ShiftingGlobalHistory
84  val folded_hist = new AllFoldedHistories(foldedGHistInfos)
85  val afhob = new AllAheadFoldedHistoryOldestBits(foldedGHistInfos)
86  val lastBrNumOH = UInt((numBr+1).W)
87  val ghr = UInt(UbtbGHRLength.W)
88  val histPtr = new CGHPtr
89  val specCnt = Vec(numBr, UInt(10.W))
90  // need pipeline update
91  val br_hit = Bool()
92  val predTaken = Bool()
93  val target = UInt(VAddrBits.W)
94  val taken = Bool()
95  val isMisPred = Bool()
96  val shift = UInt((log2Ceil(numBr)+1).W)
97  val addIntoHist = Bool()
98
99  def fromFtqRedirectSram(entry: Ftq_Redirect_SRAMEntry) = {
100    // this.hist := entry.ghist
101    this.folded_hist := entry.folded_hist
102    this.lastBrNumOH := entry.lastBrNumOH
103    this.afhob := entry.afhob
104    this.histPtr := entry.histPtr
105    this.rasSp := entry.rasSp
106    this.rasEntry := entry.rasTop
107    this
108  }
109}
110
111// Dequeue DecodeWidth insts from Ibuffer
112class CtrlFlow(implicit p: Parameters) extends XSBundle {
113  val instr = UInt(32.W)
114  val pc = UInt(VAddrBits.W)
115  val foldpc = UInt(MemPredPCWidth.W)
116  val exceptionVec = ExceptionVec()
117  val trigger = new TriggerCf
118  val pd = new PreDecodeInfo
119  val pred_taken = Bool()
120  val crossPageIPFFix = Bool()
121  val storeSetHit = Bool() // inst has been allocated an store set
122  val waitForRobIdx = new RobPtr // store set predicted previous store robIdx
123  // Load wait is needed
124  // load inst will not be executed until former store (predicted by mdp) addr calcuated
125  val loadWaitBit = Bool()
126  // If (loadWaitBit && loadWaitStrict), strict load wait is needed
127  // load inst will not be executed until ALL former store addr calcuated
128  val loadWaitStrict = Bool()
129  val ssid = UInt(SSIDWidth.W)
130  val ftqPtr = new FtqPtr
131  val ftqOffset = UInt(log2Up(PredictWidth).W)
132}
133
134
135class FPUCtrlSignals(implicit p: Parameters) extends XSBundle {
136  val isAddSub = Bool() // swap23
137  val typeTagIn = UInt(1.W)
138  val typeTagOut = UInt(1.W)
139  val fromInt = Bool()
140  val wflags = Bool()
141  val fpWen = Bool()
142  val fmaCmd = UInt(2.W)
143  val div = Bool()
144  val sqrt = Bool()
145  val fcvt = Bool()
146  val typ = UInt(2.W)
147  val fmt = UInt(2.W)
148  val ren3 = Bool() //TODO: remove SrcType.fp
149  val rm = UInt(3.W)
150}
151
152// Decode DecodeWidth insts at Decode Stage
153class CtrlSignals(implicit p: Parameters) extends XSBundle {
154  val srcType = Vec(4, SrcType())
155  val lsrc = Vec(4, UInt(6.W))
156  val ldest = UInt(6.W)
157  val fuType = FuType()
158  val fuOpType = FuOpType()
159  val rfWen = Bool()
160  val fpWen = Bool()
161  val vecWen = Bool()
162  val isXSTrap = Bool()
163  val noSpecExec = Bool() // wait forward
164  val blockBackward = Bool() // block backward
165  val flushPipe = Bool() // This inst will flush all the pipe when commit, like exception but can commit
166  val selImm = SelImm()
167  val imm = UInt(ImmUnion.maxLen.W)
168  val commitType = CommitType()
169  val fpu = new FPUCtrlSignals
170  val uopIdx = UInt(5.W)
171  val vconfig = UInt(16.W)
172  val isMove = Bool()
173  val singleStep = Bool()
174  // This inst will flush all the pipe when it is the oldest inst in ROB,
175  // then replay from this inst itself
176  val replayInst = Bool()
177
178  private def allSignals = srcType.take(3) ++ Seq(fuType, fuOpType, rfWen, fpWen, vecWen,
179    isXSTrap, noSpecExec, blockBackward, flushPipe, selImm)
180
181  def decode(inst: UInt, table: Iterable[(BitPat, List[BitPat])]): CtrlSignals = {
182    val decoder: Seq[UInt] = ListLookup(
183      inst, XDecode.decodeDefault.map(bitPatToUInt),
184      table.map{ case (pat, pats) => (pat, pats.map(bitPatToUInt)) }.toArray
185    )
186    allSignals zip decoder foreach { case (s, d) => s := d }
187    commitType := DontCare
188    this
189  }
190
191  def decode(bit: List[BitPat]): CtrlSignals = {
192    allSignals.zip(bit.map(bitPatToUInt(_))).foreach{ case (s, d) => s := d }
193    this
194  }
195
196  def isWFI: Bool = fuType === FuType.csr.U && fuOpType === CSROpType.wfi
197  def isSoftPrefetch: Bool = {
198    fuType === FuType.alu.U && fuOpType === ALUOpType.or && selImm === SelImm.IMM_I && ldest === 0.U
199  }
200}
201
202class CfCtrl(implicit p: Parameters) extends XSBundle {
203  val cf = new CtrlFlow
204  val ctrl = new CtrlSignals
205}
206
207class PerfDebugInfo(implicit p: Parameters) extends XSBundle {
208  val eliminatedMove = Bool()
209  // val fetchTime = UInt(64.W)
210  val renameTime = UInt(XLEN.W)
211  val dispatchTime = UInt(XLEN.W)
212  val enqRsTime = UInt(XLEN.W)
213  val selectTime = UInt(XLEN.W)
214  val issueTime = UInt(XLEN.W)
215  val writebackTime = UInt(XLEN.W)
216  // val commitTime = UInt(64.W)
217  val runahead_checkpoint_id = UInt(64.W)
218}
219
220// Separate LSQ
221class LSIdx(implicit p: Parameters) extends XSBundle {
222  val lqIdx = new LqPtr
223  val sqIdx = new SqPtr
224}
225
226// CfCtrl -> MicroOp at Rename Stage
227class MicroOp(implicit p: Parameters) extends CfCtrl {
228  val srcState = Vec(4, SrcState())
229  val psrc = Vec(4, UInt(PhyRegIdxWidth.W))
230  val pdest = UInt(PhyRegIdxWidth.W)
231  val old_pdest = UInt(PhyRegIdxWidth.W)
232  val robIdx = new RobPtr
233  val lqIdx = new LqPtr
234  val sqIdx = new SqPtr
235  val eliminatedMove = Bool()
236  val debugInfo = new PerfDebugInfo
237  def needRfRPort(index: Int, isFp: Boolean, ignoreState: Boolean = true) : Bool = {
238    val stateReady = srcState(index) === SrcState.rdy || ignoreState.B
239    val readReg = if (isFp) {
240      ctrl.srcType(index) === SrcType.fp
241    } else {
242      ctrl.srcType(index) === SrcType.reg && ctrl.lsrc(index) =/= 0.U
243    }
244    readReg && stateReady
245  }
246  def srcIsReady: Vec[Bool] = {
247    VecInit(ctrl.srcType.zip(srcState).map{ case (t, s) => SrcType.isPcOrImm(t) || s === SrcState.rdy })
248  }
249  def clearExceptions(
250    exceptionBits: Seq[Int] = Seq(),
251    flushPipe: Boolean = false,
252    replayInst: Boolean = false
253  ): MicroOp = {
254    cf.exceptionVec.zipWithIndex.filterNot(x => exceptionBits.contains(x._2)).foreach(_._1 := false.B)
255    if (!flushPipe) { ctrl.flushPipe := false.B }
256    if (!replayInst) { ctrl.replayInst := false.B }
257    this
258  }
259}
260
261class Redirect(implicit p: Parameters) extends XSBundle {
262  val robIdx = new RobPtr
263  val ftqIdx = new FtqPtr
264  val ftqOffset = UInt(log2Up(PredictWidth).W)
265  val level = RedirectLevel()
266  val interrupt = Bool()
267  val cfiUpdate = new CfiUpdateInfo
268
269  val stFtqIdx = new FtqPtr // for load violation predict
270  val stFtqOffset = UInt(log2Up(PredictWidth).W)
271
272  val debug_runahead_checkpoint_id = UInt(64.W)
273
274  def flushItself() = RedirectLevel.flushItself(level)
275}
276
277class ResetPregStateReq(implicit p: Parameters) extends XSBundle {
278  // NOTE: set isInt and isFp both to 'false' when invalid
279  val isInt = Bool()
280  val isFp = Bool()
281  val preg = UInt(PhyRegIdxWidth.W)
282}
283
284class DebugBundle(implicit p: Parameters) extends XSBundle {
285  val isMMIO = Bool()
286  val isPerfCnt = Bool()
287  val paddr = UInt(PAddrBits.W)
288  val vaddr = UInt(VAddrBits.W)
289}
290
291class ExternalInterruptIO(implicit p: Parameters) extends XSBundle {
292  val mtip = Input(Bool())
293  val msip = Input(Bool())
294  val meip = Input(Bool())
295  val seip = Input(Bool())
296  val debug = Input(Bool())
297}
298
299class CSRSpecialIO(implicit p: Parameters) extends XSBundle {
300  val exception = Flipped(ValidIO(new DynInst))
301  val isInterrupt = Input(Bool())
302  val memExceptionVAddr = Input(UInt(VAddrBits.W))
303  val trapTarget = Output(UInt(VAddrBits.W))
304  val externalInterrupt = new ExternalInterruptIO
305  val interrupt = Output(Bool())
306}
307
308class RobCommitInfo(implicit p: Parameters) extends XSBundle {
309  val ldest = UInt(6.W)
310  val rfWen = Bool()
311  val fpWen = Bool()
312  val vecWen = Bool()
313  val wflags = Bool()
314  val commitType = CommitType()
315  val pdest = UInt(PhyRegIdxWidth.W)
316  val old_pdest = UInt(PhyRegIdxWidth.W)
317  val ftqIdx = new FtqPtr
318  val ftqOffset = UInt(log2Up(PredictWidth).W)
319  val isMove = Bool()
320
321  // these should be optimized for synthesis verilog
322  val pc = UInt(VAddrBits.W)
323
324  val uopIdx = UInt(5.W)
325//  val vconfig = UInt(16.W)
326}
327
328class RobCommitIO(implicit p: Parameters) extends XSBundle {
329  val isCommit = Bool()
330  val commitValid = Vec(CommitWidth, Bool())
331
332  val isWalk = Bool()
333  // valid bits optimized for walk
334  val walkValid = Vec(CommitWidth, Bool())
335
336  val info = Vec(CommitWidth, new RobCommitInfo)
337
338  def hasWalkInstr: Bool = isWalk && walkValid.asUInt.orR
339  def hasCommitInstr: Bool = isCommit && commitValid.asUInt.orR
340}
341
342class RSFeedback(implicit p: Parameters) extends XSBundle {
343  val rsIdx = UInt(log2Up(IssQueSize).W)
344  val hit = Bool()
345  val flushState = Bool()
346  val sourceType = RSFeedbackType()
347  val dataInvalidSqIdx = new SqPtr
348}
349
350class MemRSFeedbackIO(implicit p: Parameters) extends XSBundle {
351  // Note: you need to update in implicit Parameters p before imp MemRSFeedbackIO
352  // for instance: MemRSFeedbackIO()(updateP)
353  val feedbackSlow = ValidIO(new RSFeedback()) // dcache miss queue full, dtlb miss
354  val feedbackFast = ValidIO(new RSFeedback()) // bank conflict
355}
356
357class FrontendToCtrlIO(implicit p: Parameters) extends XSBundle {
358  // to backend end
359  val cfVec = Vec(DecodeWidth, DecoupledIO(new CtrlFlow))
360  val fromFtq = new FtqToCtrlIO
361  // from backend
362  val toFtq = Flipped(new CtrlToFtqIO)
363}
364
365class SatpStruct(implicit p: Parameters) extends XSBundle {
366  val mode = UInt(4.W)
367  val asid = UInt(16.W)
368  val ppn  = UInt(44.W)
369}
370
371class TlbSatpBundle(implicit p: Parameters) extends SatpStruct {
372  val changed = Bool()
373
374  def apply(satp_value: UInt): Unit = {
375    require(satp_value.getWidth == XLEN)
376    val sa = satp_value.asTypeOf(new SatpStruct)
377    mode := sa.mode
378    asid := sa.asid
379    ppn := Cat(0.U(44-PAddrBits), sa.ppn(PAddrBits-1, 0)).asUInt()
380    changed := DataChanged(sa.asid) // when ppn is changed, software need do the flush
381  }
382}
383
384class TlbCsrBundle(implicit p: Parameters) extends XSBundle {
385  val satp = new TlbSatpBundle()
386  val priv = new Bundle {
387    val mxr = Bool()
388    val sum = Bool()
389    val imode = UInt(2.W)
390    val dmode = UInt(2.W)
391  }
392
393  override def toPrintable: Printable = {
394    p"Satp mode:0x${Hexadecimal(satp.mode)} asid:0x${Hexadecimal(satp.asid)} ppn:0x${Hexadecimal(satp.ppn)} " +
395      p"Priv mxr:${priv.mxr} sum:${priv.sum} imode:${priv.imode} dmode:${priv.dmode}"
396  }
397}
398
399class SfenceBundle(implicit p: Parameters) extends XSBundle {
400  val valid = Bool()
401  val bits = new Bundle {
402    val rs1 = Bool()
403    val rs2 = Bool()
404    val addr = UInt(VAddrBits.W)
405    val asid = UInt(AsidLength.W)
406    val flushPipe = Bool()
407  }
408
409  override def toPrintable: Printable = {
410    p"valid:0x${Hexadecimal(valid)} rs1:${bits.rs1} rs2:${bits.rs2} addr:${Hexadecimal(bits.addr)}, flushPipe:${bits.flushPipe}"
411  }
412}
413
414// Bundle for load violation predictor updating
415class MemPredUpdateReq(implicit p: Parameters) extends XSBundle  {
416  val valid = Bool()
417
418  // wait table update
419  val waddr = UInt(MemPredPCWidth.W)
420  val wdata = Bool() // true.B by default
421
422  // store set update
423  // by default, ldpc/stpc should be xor folded
424  val ldpc = UInt(MemPredPCWidth.W)
425  val stpc = UInt(MemPredPCWidth.W)
426}
427
428class CustomCSRCtrlIO(implicit p: Parameters) extends XSBundle {
429  // Prefetcher
430  val l1I_pf_enable = Output(Bool())
431  val l2_pf_enable = Output(Bool())
432  // ICache
433  val icache_parity_enable = Output(Bool())
434  // Labeled XiangShan
435  val dsid = Output(UInt(8.W)) // TODO: DsidWidth as parameter
436  // Load violation predictor
437  val lvpred_disable = Output(Bool())
438  val no_spec_load = Output(Bool())
439  val storeset_wait_store = Output(Bool())
440  val storeset_no_fast_wakeup = Output(Bool())
441  val lvpred_timeout = Output(UInt(5.W))
442  // Branch predictor
443  val bp_ctrl = Output(new BPUCtrl)
444  // Memory Block
445  val sbuffer_threshold = Output(UInt(4.W))
446  val ldld_vio_check_enable = Output(Bool())
447  val soft_prefetch_enable = Output(Bool())
448  val cache_error_enable = Output(Bool())
449  val uncache_write_outstanding_enable = Output(Bool())
450  // Rename
451  val fusion_enable = Output(Bool())
452  val wfi_enable = Output(Bool())
453  // Decode
454  val svinval_enable = Output(Bool())
455
456  // distribute csr write signal
457  val distribute_csr = new DistributedCSRIO()
458
459  val singlestep = Output(Bool())
460  val frontend_trigger = new FrontendTdataDistributeIO()
461  val mem_trigger = new MemTdataDistributeIO()
462  val trigger_enable = Output(Vec(10, Bool()))
463}
464
465class DistributedCSRIO(implicit p: Parameters) extends XSBundle {
466  // CSR has been written by csr inst, copies of csr should be updated
467  val w = ValidIO(new Bundle {
468    val addr = Output(UInt(12.W))
469    val data = Output(UInt(XLEN.W))
470  })
471}
472
473class DistributedCSRUpdateReq(implicit p: Parameters) extends XSBundle {
474  // Request csr to be updated
475  //
476  // Note that this request will ONLY update CSR Module it self,
477  // copies of csr will NOT be updated, use it with care!
478  //
479  // For each cycle, no more than 1 DistributedCSRUpdateReq is valid
480  val w = ValidIO(new Bundle {
481    val addr = Output(UInt(12.W))
482    val data = Output(UInt(XLEN.W))
483  })
484  def apply(valid: Bool, addr: UInt, data: UInt, src_description: String) = {
485    when(valid){
486      w.bits.addr := addr
487      w.bits.data := data
488    }
489    println("Distributed CSR update req registered for " + src_description)
490  }
491}
492
493class L1CacheErrorInfo(implicit p: Parameters) extends XSBundle {
494  // L1CacheErrorInfo is also used to encode customized CACHE_ERROR CSR
495  val source = Output(new Bundle() {
496    val tag = Bool() // l1 tag array
497    val data = Bool() // l1 data array
498    val l2 = Bool()
499  })
500  val opType = Output(new Bundle() {
501    val fetch = Bool()
502    val load = Bool()
503    val store = Bool()
504    val probe = Bool()
505    val release = Bool()
506    val atom = Bool()
507  })
508  val paddr = Output(UInt(PAddrBits.W))
509
510  // report error and paddr to beu
511  // bus error unit will receive error info iff ecc_error.valid
512  val report_to_beu = Output(Bool())
513
514  // there is an valid error
515  // l1 cache error will always be report to CACHE_ERROR csr
516  val valid = Output(Bool())
517
518  def toL1BusErrorUnitInfo(): L1BusErrorUnitInfo = {
519    val beu_info = Wire(new L1BusErrorUnitInfo)
520    beu_info.ecc_error.valid := report_to_beu
521    beu_info.ecc_error.bits := paddr
522    beu_info
523  }
524}
525
526/* TODO how to trigger on next inst?
5271. If hit is determined at frontend, then set a "next instr" trap at dispatch like singlestep
5282. If it is determined at Load(meaning it must be "hit after", then it must not be a jump. So we can let it commit and set
529xret csr to pc + 4/ + 2
5302.5 The problem is to let it commit. This is the real TODO
5313. If it is load and hit before just treat it as regular load exception
532 */
533
534// This bundle carries trigger hit info along the pipeline
535// Now there are 10 triggers divided into 5 groups of 2
536// These groups are
537// (if if) (store store) (load loid) (if store) (if load)
538
539// Triggers in the same group can chain, meaning that they only
540// fire is both triggers in the group matches (the triggerHitVec bit is asserted)
541// Chaining of trigger No. (2i) and (2i+1) is indicated by triggerChainVec(i)
542// Timing of 0 means trap at current inst, 1 means trap at next inst
543// Chaining and timing and the validness of a trigger is controlled by csr
544// In two chained triggers, if they have different timing, both won't fire
545//class TriggerCf (implicit p: Parameters) extends XSBundle {
546//  val triggerHitVec = Vec(10, Bool())
547//  val triggerTiming = Vec(10, Bool())
548//  val triggerChainVec = Vec(5, Bool())
549//}
550
551class TriggerCf(implicit p: Parameters) extends XSBundle {
552  // frontend
553  val frontendHit = Vec(4, Bool())
554//  val frontendTiming = Vec(4, Bool())
555//  val frontendHitNext = Vec(4, Bool())
556
557//  val frontendException = Bool()
558  // backend
559  val backendEn = Vec(2, Bool()) // Hit(6) && chain(4) , Hit(8) && chain(4)
560  val backendHit = Vec(6, Bool())
561//  val backendTiming = Vec(6, Bool()) // trigger enable fro chain
562
563  // Two situations not allowed:
564  // 1. load data comparison
565  // 2. store chaining with store
566  def getHitFrontend = frontendHit.reduce(_ || _)
567  def getHitBackend = backendHit.reduce(_ || _)
568  def hit = getHitFrontend || getHitBackend
569  def clear(): Unit = {
570    frontendHit.foreach(_ := false.B)
571    backendEn.foreach(_ := false.B)
572    backendHit.foreach(_ := false.B)
573  }
574}
575
576// these 3 bundles help distribute trigger control signals from CSR
577// to Frontend, Load and Store.
578class FrontendTdataDistributeIO(implicit p: Parameters)  extends XSBundle {
579    val t = Valid(new Bundle {
580      val addr = Output(UInt(2.W))
581      val tdata = new MatchTriggerIO
582    })
583  }
584
585class MemTdataDistributeIO(implicit p: Parameters)  extends XSBundle {
586  val t = Valid(new Bundle {
587    val addr = Output(UInt(3.W))
588    val tdata = new MatchTriggerIO
589  })
590}
591
592class MatchTriggerIO(implicit p: Parameters) extends XSBundle {
593  val matchType = Output(UInt(2.W))
594  val select = Output(Bool())
595  val timing = Output(Bool())
596  val action = Output(Bool())
597  val chain = Output(Bool())
598  val tdata2 = Output(UInt(64.W))
599}
600