Skip to content

Commit b1b17d2

Browse files
committed
Merge branch 'master' into feat-l1hint
2 parents af49a22 + 2ef376c commit b1b17d2

File tree

6 files changed

+32
-24
lines changed

6 files changed

+32
-24
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,11 @@ jobs:
6767
- name: Compile
6868
run: make compile
6969

70-
# Clean artifacts folder (./tl-test-new/run) after successful run
71-
- name: Unit Test for TileLink version
72-
run: |
73-
git clone https://github.com/OpenXiangShan/tl-test-new
74-
cd ./tl-test-new
75-
sed -i 's/ari.target.*/ari.target = 240/g' ./configs/user.tltest.ini
76-
rm -rf ./dut/CoupledL2 && ln -s ../.. ./dut/CoupledL2
77-
make coupledL2-test-l2l3l2 run THREADS_BUILD=4 CXX_COMPILER=clang++-17
78-
rm -rf run/*.vcd run/*.fst run/*.log run/*.db
79-
80-
- name: Tar up artifacts of Unit Test for TileLink version
81-
if: always()
82-
run: |
83-
test -d ./tl-test-new/run || mkdir -p ./tl-test-new/run
84-
tar -zcf ${{ env.RUN_ARCHIVE_TL }} ./tl-test-new/run
85-
8670
# Clean artifacts folder (./tl-test-new/run) after successful run
8771
- name: Unit test for CHI version
8872
run: |
73+
rm -rf tl-test-new
74+
git clone https://github.com/OpenXiangShan/tl-test-new
8975
cd ./tl-test-new
9076
sed -i 's/ari.target.*/ari.target = 240/g' ./configs/user.tltest.ini
9177
sed -i 's/cmo.enable .*=.*/cmo.enable = 1/g' ./configs/user.tltest.ini
@@ -105,6 +91,23 @@ jobs:
10591
run: |
10692
test -d ./tl-test-new/run || mkdir -p ./tl-test-new/run
10793
tar -zcf ${{ env.RUN_ARCHIVE_CHI }} ./tl-test-new/run
94+
95+
# Clean artifacts folder (./tl-test-new/run) after successful run
96+
- name: Unit Test for TileLink version
97+
run: |
98+
rm -rf tl-test-new
99+
git clone https://github.com/OpenXiangShan/tl-test-new
100+
cd ./tl-test-new
101+
sed -i 's/ari.target.*/ari.target = 240/g' ./configs/user.tltest.ini
102+
rm -rf ./dut/CoupledL2 && ln -s ../.. ./dut/CoupledL2
103+
make coupledL2-test-l2l3l2 run THREADS_BUILD=4 CXX_COMPILER=clang++-17
104+
rm -rf run/*.vcd run/*.fst run/*.log run/*.db
105+
106+
- name: Tar up artifacts of Unit Test for TileLink version
107+
if: always()
108+
run: |
109+
test -d ./tl-test-new/run || mkdir -p ./tl-test-new/run
110+
tar -zcf ${{ env.RUN_ARCHIVE_TL }} ./tl-test-new/run
108111
109112
- name: Upload artifacts of Unit Test
110113
if: always()

src/main/scala/coupledL2/CustomL1Hint.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ class CustomL1Hint(implicit p: Parameters) extends L2Module {
123123
hint_s1Queue.io.enq.bits.source := enqSource_s1
124124
hint_s1Queue.io.enq.bits.isKeyword := enqKeyWord_s1
125125
hint_s1Queue.io.deq.ready := hintQueue.io.enq.ready && !enqValid_s3
126-
// WARNING:TODO: ensure queue will never overflow
127-
// assert(hint_s1Queue.io.enq.ready, "hint_s1Queue should never be full")
128-
// assert(hintQueue.io.enq.ready, "hintQueue should never be full")
126+
127+
assert(hint_s1Queue.io.enq.ready, "hint_s1Queue should never be full")
128+
// *NOTICE: 'hintQueue' is now possible to be full and backpressing 'hint_s1Queue'.
129+
// Hence, this assertion here was currently unnecessary and overkilled.
130+
//assert(hintQueue.io.enq.ready, "hintQueue should never be full")
129131

130132
val hintDropValid = hintQueue.io.deq.valid && hintDropQueue.io.deq.valid && hintQueue.io.deq.bits.source === hintDropQueue.io.deq.bits.source
131133

src/main/scala/coupledL2/L2Param.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ case class L2Param(
119119
enableTagECC: Boolean = false,
120120
enableDataECC: Boolean = false,
121121
// DataCheck
122-
dataCheck: Option[String] = None,
123-
enablePoison: Boolean = false,
122+
dataCheck: Option[String] = Some("oddparity"),
123+
enablePoison: Boolean = true,
124124

125125
// Network layer SAM
126126
sam: Seq[(AddressSet, Int)] = Seq(AddressSet.everything -> 0)

src/main/scala/coupledL2/tl2chi/MMIOBridge.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,18 @@ class MMIOBridgeEntry(edge: TLEdgeIn)(implicit p: Parameters) extends TL2CHIL2Mo
160160
val dataCheck = if (enableDataCheck) {
161161
dataCheckMethod match {
162162
case 1 => (0 until DATACHECK_WIDTH).map(i =>
163-
rxdat.bits.dataCheck.get(i) ^ rdata(8 * (i + 1) - 1, 8 * i).xorR ^ true.B).reduce(_ | _)
163+
rxdat.bits.dataCheck.get(i) ^ rxdat.bits.data(8 * (i + 1) - 1, 8 * i).xorR ^ true.B).reduce(_ | _)
164164
case 2 =>
165165
val code = new SECDEDCode
166166
(0 until DATACHECK_WIDTH).map(i =>
167-
code.decode(Cat(rxdat.bits.dataCheck.get(i) ^ rdata(8 * (i + 1) - 1, 8 * i))).error).reduce(_ | _)
167+
code.decode(Cat(rxdat.bits.dataCheck.get(i) ^ rxdat.bits.data(8 * (i + 1) - 1, 8 * i))).error).reduce(_ | _)
168168
case _ => false.B
169169
}
170170
} else {
171171
false.B
172172
}
173173
val poison = rxdat.bits.poison.getOrElse(false.B).orR
174+
assert(!(dataCheck || poison), "UC should not have DataCheck/Poison error")
174175
denied := denied || nderr
175176
corrupt := corrupt || derr || nderr || dataCheck || poison
176177
}

src/main/scala/coupledL2/tl2chi/MSHR.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,7 @@ class MSHR(implicit p: Parameters) extends TL2CHIL2Module with HasCHIOpcodes {
11031103
when (rxdat.valid) {
11041104
val nderr = rxdat.bits.respErr.getOrElse(OK) === NDERR
11051105
val derr = rxdat.bits.respErr.getOrElse(OK) === DERR
1106+
val rxdatCorrupt = rxdat.bits.corrupt
11061107
ifAfterIssueC {
11071108
when (rxdat.bits.chiOpcode.get === DataSepResp) {
11081109
require(beatSize == 2) // TODO: This is ugly
@@ -1113,7 +1114,7 @@ class MSHR(implicit p: Parameters) extends TL2CHIL2Module with HasCHIOpcodes {
11131114
gotDirty := gotDirty || rxdatIsU_PD
11141115
gotGrantData := true.B
11151116
denied := denied || nderr
1116-
corrupt := corrupt || derr || nderr
1117+
corrupt := corrupt || derr || nderr || rxdatCorrupt
11171118
}
11181119
}
11191120

src/main/scala/coupledL2/tl2chi/RXDAT.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class RXDAT(implicit p: Parameters) extends TL2CHIL2Module {
5252
false.B
5353
}
5454
val poison = io.out.bits.poison.getOrElse(false.B).orR
55+
assert(!((dataCheck || poison) && io.out.valid), "RXDAT(cached) should not have DataCheck/Poison error")
5556

5657
/* Write Refill Buffer*/
5758
io.refillBufWrite.valid := io.out.valid

0 commit comments

Comments
 (0)