@@ -54,10 +54,10 @@ class EyerissTop(val param: EyerissTopParam) extends Module with ClusterConfig w
54
54
cGroupIO.ctrlPath.cscSwitcherCtrlPath <> decoderIO.cscSwitcherCtrlIO
55
55
/** cGroupIO data path*/
56
56
cGroupIO.dataPath.pSumIO.foreach(x => x.inIOs <> DontCare )
57
- private def sourceInputDataMux (offChip : DecoupledIO [SimpleTLDIO ], onChip : Seq [DecoupledIO [UInt ]]) : Unit = {
57
+ private def sourceInputDataMux (offChip : DecoupledIO [SimpleTLDIO ], onChip : Seq [DecoupledIO [UInt ]], enable : Bool ) : Unit = {
58
58
onChip.zipWithIndex.foreach({ case (value, i) =>
59
59
value.bits := offChip.bits.data
60
- value.valid := offChip.bits.source === i.U && offChip.valid
60
+ value.valid := offChip.bits.source === i.U && offChip.valid && enable
61
61
})
62
62
offChip.ready := MuxLookup (offChip.bits.source, false .B , onChip.zipWithIndex.map({ case (value, i) =>
63
63
i.U -> value.ready
@@ -81,11 +81,20 @@ class EyerissTop(val param: EyerissTopParam) extends Module with ClusterConfig w
81
81
memCtrlIO.pSumIO.sourceAlloc.valid && decoderIO.pSumIO.pSumLoadEn)
82
82
}
83
83
protected val inActInIOs : IndexedSeq [DecoupledIO [UInt ]] = cGroupIO.dataPath.inActIO.map(x => x.data)
84
- sourceInputDataMux(offChip = io.ctrlPath.bundles.memInActBundles.d, onChip = inActInIOs)
84
+ sourceInputDataMux(offChip = io.ctrlPath.bundles.memInActBundles.d, onChip = inActInIOs, enable = cgCtrlPath.glbInActLoadEn )
85
85
protected val weightInIOs : IndexedSeq [DecoupledIO [UInt ]] = cGroupIO.dataPath.weightIO.map(x => x.data)
86
- sourceInputDataMux(offChip = io.ctrlPath.bundles.memWeightBundles.d, onChip = weightInIOs)
86
+ sourceInputDataMux(offChip = io.ctrlPath.bundles.memWeightBundles.d, onChip = weightInIOs, enable = cgCtrlPath.peWeightLoadEn )
87
87
protected val pSumOutIOs : IndexedSeq [DecoupledIO [UInt ]] = cGroupIO.dataPath.pSumIO.map(x => x.outIOs)
88
88
pSumBundleMux(offChip = io.ctrlPath.bundles.memPSumBundles.a, onChip = pSumOutIOs)
89
+ protected val inActReqFirstReg : Bool = RegInit (false .B )
90
+ inActReqFirstReg := Mux (memCtrlIO.inActIO.sourceAlloc.fire(), false .B ,
91
+ Mux (io.ctrlPath.bundles.memInActBundles.reqFirst, true .B , inActReqFirstReg))
92
+ protected val weightReqFirstReg : Bool = RegInit (false .B )
93
+ weightReqFirstReg := Mux (memCtrlIO.weightIO.sourceAlloc.fire(), false .B ,
94
+ Mux (io.ctrlPath.bundles.memWeightBundles.reqFirst, true .B , weightReqFirstReg))
95
+ protected val pSumReqFirstReg : Bool = RegInit (false .B )
96
+ pSumReqFirstReg := Mux (memCtrlIO.pSumIO.sourceAlloc.fire(), false .B ,
97
+ Mux (io.ctrlPath.bundles.memPSumBundles.reqFirst, true .B , pSumReqFirstReg))
89
98
/** memory module address and size */
90
99
memCtrlIO.inActIO.startAdr := decoderIO.inActIO.starAdr
91
100
memCtrlIO.inActIO.reqSize := decoderIO.inActIO.reqSize
@@ -95,21 +104,21 @@ class EyerissTop(val param: EyerissTopParam) extends Module with ClusterConfig w
95
104
memCtrlIO.pSumIO.reqSize := decoderIO.pSumIO.reqSize
96
105
/** only glbLoadEn, then generate source id*/
97
106
memCtrlIO.inActIO.sourceAlloc.ready := io.ctrlPath.bundles.memInActBundles.legal &&
98
- io.ctrlPath.bundles.memInActBundles.reqFirst &&
107
+ ( io.ctrlPath.bundles.memInActBundles.reqFirst || inActReqFirstReg) &&
99
108
io.ctrlPath.bundles.memInActBundles.a.ready && cgCtrlPath.glbInActLoadEn
100
109
memCtrlIO.inActIO.sourceFree.valid := io.ctrlPath.bundles.memInActBundles.respFirst &&
101
110
io.ctrlPath.bundles.memInActBundles.d.fire()
102
111
memCtrlIO.inActIO.sourceFree.bits := io.ctrlPath.bundles.memInActBundles.d.bits.source
103
112
/** only peLoadEn and haven't finish read (sourceAlloc.valid), then generate source id*/
104
113
memCtrlIO.weightIO.sourceAlloc.ready := io.ctrlPath.bundles.memWeightBundles.legal &&
105
- io.ctrlPath.bundles.memWeightBundles.reqFirst &&
114
+ ( io.ctrlPath.bundles.memWeightBundles.reqFirst || weightReqFirstReg) &&
106
115
io.ctrlPath.bundles.memWeightBundles.a.ready && cgCtrlPath.peWeightLoadEn
107
116
memCtrlIO.weightIO.sourceFree.valid := io.ctrlPath.bundles.memWeightBundles.respFirst &&
108
117
io.ctrlPath.bundles.memWeightBundles.d.fire()
109
118
memCtrlIO.weightIO.sourceFree.bits := io.ctrlPath.bundles.memWeightBundles.d.bits.source
110
119
/** only pSumLoadEn, then generate source id*/
111
120
memCtrlIO.pSumIO.sourceAlloc.ready := io.ctrlPath.bundles.memPSumBundles.legal &&
112
- io.ctrlPath.bundles.memPSumBundles.reqFirst &&
121
+ ( io.ctrlPath.bundles.memPSumBundles.reqFirst || pSumReqFirstReg) &&
113
122
io.ctrlPath.bundles.memPSumBundles.a.ready && decoderIO.pSumIO.pSumLoadEn
114
123
memCtrlIO.pSumIO.sourceFree.valid := io.ctrlPath.bundles.memPSumBundles.respFirst &&
115
124
io.ctrlPath.bundles.memPSumBundles.d.fire()
@@ -121,15 +130,15 @@ class EyerissTop(val param: EyerissTopParam) extends Module with ClusterConfig w
121
130
io.ctrlPath.interrupts := decoderIO.valid
122
131
/** only glbLoadEn then a.valid is true then can Get data */
123
132
io.ctrlPath.bundles.memInActBundles.a.valid := io.ctrlPath.bundles.memInActBundles.legal &&
124
- (! io.ctrlPath.bundles.memInActBundles.reqFirst || memCtrlIO.inActIO.sourceAlloc.valid && cgCtrlPath.glbInActLoadEn)
133
+ (! io.ctrlPath.bundles.memInActBundles.reqFirst || memCtrlIO.inActIO.sourceAlloc.valid) && cgCtrlPath.glbInActLoadEn
125
134
io.ctrlPath.bundles.memInActBundles.a.bits.source := memCtrlIO.inActIO.sourceAlloc.bits
126
135
/** Don't care memInActBundles.a.bits.data as memInActBundle.a.bits.data will be assigned in LazyImp*/
127
136
io.ctrlPath.bundles.memInActBundles.a.bits.data := DontCare
128
137
io.ctrlPath.bundles.memInActBundles.address := memCtrlIO.inActIO.address
129
138
io.ctrlPath.bundles.memInActBundles.reqSize := decoderIO.inActIO.reqSize
130
139
/** weight */
131
140
io.ctrlPath.bundles.memWeightBundles.a.valid := io.ctrlPath.bundles.memWeightBundles.legal &&
132
- (! io.ctrlPath.bundles.memWeightBundles.reqFirst || ( memCtrlIO.weightIO.sourceAlloc.valid && cgCtrlPath.peWeightLoadEn))
141
+ (! io.ctrlPath.bundles.memWeightBundles.reqFirst || memCtrlIO.weightIO.sourceAlloc.valid) && cgCtrlPath.peWeightLoadEn
133
142
io.ctrlPath.bundles.memWeightBundles.a.bits.source := memCtrlIO.weightIO.sourceAlloc.bits
134
143
/** Don't care memWeightBundles.a.bits.data as memWeightBundle.a.bits.data will be assigned in LazyImp*/
135
144
io.ctrlPath.bundles.memWeightBundles.a.bits.data := DontCare
0 commit comments