Compare commits

...

14 Commits

Author SHA1 Message Date
Jiuyue Ma 70f302d74c
Merge fe05f87286 into f9ed852fb2 2025-04-22 10:01:49 +08:00
NewPaulWalker f9ed852fb2
fix(xiselect): set the minimum range for xiselect (#4594)
The miselect register implements at least enough bits to support all
implemented miselect values.
The siselect register will support the value range 0..0xFFF at a
minimum.
The vsiselect register will support the value range 0..0xFFF at a
minimum.
2025-04-22 09:52:44 +08:00
cz4e 99a48a761c
timing(LoadQueueUncache): adjust s1 enq and s2 enq valid generate logic (#4603)
EMU Test / Changes Detection (push) Waiting to run Details
EMU Test / Generate Verilog (push) Blocked by required conditions Details
EMU Test / EMU - Basics (push) Blocked by required conditions Details
EMU Test / EMU - CHI (push) Blocked by required conditions Details
EMU Test / EMU - Performance (push) Blocked by required conditions Details
EMU Test / EMU - MC (push) Blocked by required conditions Details
EMU Test / SIMV - Basics (push) Blocked by required conditions Details
EMU Test / Upload Artifacts (push) Blocked by required conditions Details
EMU Test / Check Submodules (push) Blocked by required conditions Details
EMU Test / Check Format (push) Blocked by required conditions Details
2025-04-22 00:42:41 +08:00
Anzo cd450e3243
submodule(ready-to-run): bump nemu and spike ref in ready-to-run (#4604) 2025-04-22 00:42:07 +08:00
Zhaoyang You 51ad03b0f6
fix(rename): fix Csrr format (#4605) 2025-04-22 00:40:40 +08:00
zhaohong1988 d7dd2491d4
submodule(ChiselAIA): bump ChiselAIA (#4595) 2025-04-22 00:37:45 +08:00
xu_zh be3685ffd1
chore(scalastyle): disable space-around-operator checks (#4567) 2025-04-22 00:37:04 +08:00
Guanghui Cheng b5c820f608
fix(top): enable cpuclock when debug halt req (#4583) 2025-04-22 00:36:20 +08:00
Anzo 3aa632ec4e
fix(StoreUnit): cbo violation check should check cacheline (#4592)
EMU Test / Changes Detection (push) Waiting to run Details
EMU Test / Generate Verilog (push) Blocked by required conditions Details
EMU Test / EMU - Basics (push) Blocked by required conditions Details
EMU Test / EMU - CHI (push) Blocked by required conditions Details
EMU Test / EMU - Performance (push) Blocked by required conditions Details
EMU Test / EMU - MC (push) Blocked by required conditions Details
EMU Test / SIMV - Basics (push) Blocked by required conditions Details
EMU Test / Upload Artifacts (push) Blocked by required conditions Details
EMU Test / Check Submodules (push) Blocked by required conditions Details
EMU Test / Check Format (push) Blocked by required conditions Details
The cbo instruction should check for violations at the granularity of
cacheline.

Theoretically modifying the condition of this variable would allow
checking at cacheline granularity in RAW and should not introduce any
other side effects.
2025-04-21 18:55:13 +08:00
Anzo ce78e60ca4
fix(StoreQueue): remove `cboZeroUop` saved `sqptr` (#4591) 2025-04-21 18:53:08 +08:00
cz4e dccbba583f
fix(MainPipe): fix error report valid when Atomics and SBuffer request miss (#4572)
* Sbuffer write and Atomics should not report errors, but refill from L2
should report ecc error, but requests in MissQueue carry `isAmo` or
`isStore` and `req.miss` in a request, hence `(s2_req.isAMO ||
s2_req.isStore)` includes the refill, so the missing request of `isAmo`
or `isStore` will not report an error
2025-04-21 18:35:02 +08:00
cz4e d69a82861a
fix(MainPipe): fix `s1_way_en` logic when pseudo tag error inject (#4573)
* `s1_way_en` should use `io.pseudo_error.valid` on the same stage, not
`RegNext(io.pseudo_error.valid)`. Otherwise, `MainPipe` may use wrong
way enable to write DCache, it will result in two identical tags.
2025-04-21 18:33:20 +08:00
Jiuyue Ma fe05f87286 WIP: download firtool 2025-04-10 19:26:32 +08:00
Jiuyue Ma 8a8b560f26 feat(build): Support generating XiangShan in docker envrionment
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-04-10 19:26:31 +08:00
16 changed files with 154 additions and 43 deletions

3
.gitignore vendored
View File

@ -321,6 +321,9 @@ src_managed/
project/boot/
project/plugins/project/
# mill specific
.mill-jvm-opts
# Scala-IDE specific
.scala_dependencies
.worksheet

@ -1 +1 @@
Subproject commit 6608dc16ec944800d39200e2fad5924d0968b42b
Subproject commit eacee874c515eadfe197cd6b66a52799c30332c1

57
Dockerfile Normal file
View File

@ -0,0 +1,57 @@
#***************************************************************************************
# Copyright (c) 2025 Beijing Institute of Open Source Chip (BOSC)
#
# XiangShan is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#
# See the Mulan PSL v2 for more details.
#***************************************************************************************
FROM verilator/verilator:latest
# override ENTRYPOINT in verilator image
ENTRYPOINT [ "/bin/bash" ]
#
# Prepare envrionments for chisel/mill
#
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get install --no-install-recommends -y \
default-jdk \
python3 \
curl \
make \
time \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#
# Mill
#
RUN curl -L https://github.com/com-lihaoyi/mill/releases/download/0.12.3/0.12.3 -o /usr/bin/mill \
&& chmod +x /usr/bin/mill \
&& mill --version
#
# XiangShan workspace
#
WORKDIR /work
VOLUME /work/out
VOLUME /work/build
#
# download IvyDeps
#
RUN --mount=type=bind,source=.,target=/work,readonly \
--mount=type=tmpfs,destination=/work/out,rw <<EOF
mill -i _.resolvedIvyDeps
mill -i utility.compile
EOF

View File

@ -316,3 +316,51 @@ include Makefile.test
include src/main/scala/device/standalone/standalone_device.mk
.PHONY: verilog sim-verilog emu clean help init bump bsp $(REF_SO)
#
# Docker Support
#
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
XSDEV_IMAGE := OpenXiangShan/xsdev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
HAVE_XSDEV_IMAGE := $(shell docker image inspect --format '{{.ID}}' $(XSDEV_IMAGE) 2> /dev/null)
DOCKER_RUN = docker run -it --rm -e IN_XSDEV_DOCKER=y -e NOOP_HOME=/work \
-v .:/work:ro \
-v ./out:/work/out:rw \
-v ./build:/work/build:rw \
$(XSDEV_IMAGE) $(1) || exit 1
# run all targets in docker
check_docker_env:
@mkdir -p out build;
@if [ -z "$(IN_XSDEV_DOCKER)" ]; then \
echo "Switching to Docker environment..."; \
$(call DOCKER_RUN, -c "make $(MAKECMDGOALS)"); \
exit 0; \
else \
echo; \
fi
$(filter-out image sh,$(MAKECMDGOALS)): $(if $(HAVE_XSDEV_IMAGE),check_docker_env)
@$(MAKE) $(MAKECMDGOALS)
# build docker image
HTTP_PROXY ?= http://172.28.9.101:1091
PROXY_HOST := $(shell echo $(HTTP_PROXY) | sed -e 's|http://\(.*\):\(.*\)|\1|')
PROXY_PORT := $(shell echo $(HTTP_PROXY) | sed -e 's|http://\(.*\):\(.*\)|\2|')
.mill-jvm-opts:
@{ echo -Dhttp.proxyHost=$(PROXY_HOST); \
echo -Dhttp.proxyPort=$(PROXY_PORT); \
echo -Dhttps.proxyHost=$(PROXY_HOST); \
echo -Dhttps.proxyPort=$(PROXY_PORT); } > $@
__prep_proxy: .mill-jvm-opts
image: $(if $(HTTP_PROXY),__prep_proxy) init
@mkdir -p out
docker build -t $(XSDEV_IMAGE) \
$(if $(HTTP_PROXY),--build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg HTTPS_PROXY=$(HTTP_PROXY)) .
# run interactive shell
sh:
$(if $(HAVE_XSDEV_IMAGE),,\
$(error Docker unavailable or "$(XSDEV_IMAGE)" image not exist))
@$(call DOCKER_RUN)
.PHONY: image __prep_proxy sh

View File

@ -100,7 +100,7 @@ make idea
* Set environment variable `NEMU_HOME` to the **absolute path** of the [NEMU project](https://github.com/OpenXiangShan/NEMU).
* Set environment variable `NOOP_HOME` to the **absolute path** of the XiangShan project.
* Set environment variable `AM_HOME` to the **absolute path** of the [AM project](https://github.com/OpenXiangShan/nexus-am).
* Install `mill`. Refer to [the Manual section in this guide](https://mill-build.org/mill/0.11.11/Scala_Installation_IDE_Support.html#_bootstrap_scripts).
* Install `mill`. Refer to [the Manual section in this guide](https://mill-build.org/mill/cli/installation-ide.html#_bootstrap_scripts).
* Clone this project and run `make init` to initialize submodules.
### Run with simulator

View File

@ -58,7 +58,7 @@ trait HasChisel extends SbtModule {
override def scalacOptions = super.scalacOptions() ++
Agg("-language:reflectiveCalls", "-Ymacro-annotations", "-Ytasty-reader")
override def ivyDeps = super.ivyDeps() ++ Agg(chiselIvy.get)
override def ivyDeps = super.ivyDeps() ++ Agg(chiselIvy.get) ++ Agg(ivy"org.chipsalliance:llvm-firtool:1.62.1")
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(chiselPluginIvy.get)
}

@ -1 +1 @@
Subproject commit c22a4b2e81d97680380c38cb1ccc7cc2028f01fa
Subproject commit 2b60fc5edf50f519a4310dc41620e9a204b4aacb

View File

@ -71,38 +71,38 @@
<!-- always add a space after `//` or `/*` before comments -->
<check enabled="true" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" level="warning"/>
<!-- check space around operators, ref: https://github.com/scala-ide/scalariform/blob/master/scalariform/src/main/scala/scalariform/lexer/Tokens.scala -->
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker" level="warning">
<parameters>
<!-- (, ~, ! -->
<parameter name="tokens">LPAREN, TILDE, EXCLAMATION</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" level="warning">
<parameters>
<!-- :, ,, ) -->
<parameter name="tokens">COLON, COMMA, RPAREN</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
<parameters>
<!-- if, match, case, for, while, =>, <-, {, <:, <%:, >:, +, -, *, |, = -->
<parameter name="tokens">IF, MATCH, CASE, FOR, WHILE, ARROW, LARROW, LBRACE, SUBTYPE, VIEWBOUND, SUPERTYPE, PLUS, MINUS, STAR, PIPE, EQUAL</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" level="warning">
<parameters>
<!-- =>, <-, }, <:, <%, >:, +, -, *, |, = -->
<parameter name="tokens">ARROW, LARROW, RBRACE, SUBTYPE, VIEWBOUND, SUPERTYPE, PLUS, MINUS, STAR, PIPE, EQUAL</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.file.RegexChecker" level="warning">
<check enabled="false" class="org.scalastyle.file.RegexChecker" level="warning">
<parameters>
<!-- :=, :<=, :>=, :<>=, :#=, <>, ===, =/=, <<, >>, <=, >= -->
<parameter name="regex"><![CDATA[[^ ](:<?#?>?=|<>|=[=/]=|<<|>>|[<>]=)]]></parameter>
</parameters>
<customMessage>No space before operators</customMessage>
</check>
<check enabled="true" class="org.scalastyle.file.RegexChecker" level="warning">
<check enabled="false" class="org.scalastyle.file.RegexChecker" level="warning">
<parameters>
<!-- :=, :<=, :>=, :<>=, :#=, <>, ===, =/=, <<, >>, <=, >= -->
<parameter name="regex"><![CDATA[(:<?#?>?=|<>|=[=/]=|<<|>>|[<>]=)[^ \n]]]></parameter>

View File

@ -71,43 +71,43 @@
<!-- always add a space after `//` or `/*` before comments -->
<check enabled="true" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" level="warning"/>
<!-- check space around operators, ref: https://github.com/scala-ide/scalariform/blob/master/scalariform/src/main/scala/scalariform/lexer/Tokens.scala -->
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker" level="warning">
<parameters>
<!-- (, ~, ! -->
<parameter name="tokens">LPAREN, TILDE, EXCLAMATION</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" level="warning">
<parameters>
<!-- :, ,, ) -->
<parameter name="tokens">COLON, COMMA, RPAREN</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
<parameters>
<!-- if, match, case, for, while, =>, <-, {, <:, <%:, >:, +, -, *, |, = -->
<parameter name="tokens">IF, MATCH, CASE, FOR, WHILE, ARROW, LARROW, LBRACE, SUBTYPE, VIEWBOUND, SUPERTYPE, PLUS, MINUS, STAR, PIPE, EQUAL</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" level="warning">
<check enabled="false" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" level="warning">
<parameters>
<!-- =>, <-, }, <:, <%, >:, +, -, *, |, = -->
<parameter name="tokens">ARROW, LARROW, RBRACE, SUBTYPE, VIEWBOUND, SUPERTYPE, PLUS, MINUS, STAR, PIPE, EQUAL</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.file.RegexChecker" level="warning">
<check enabled="false" class="org.scalastyle.file.RegexChecker" level="warning">
<parameters>
<!-- :=, :<=, :>=, :<>=, :#=, <>, ===, =/=, <<, >>, <=, >= -->
<parameter name="regex"><![CDATA[[^ ](:<?#?>?=|<>|=[=/]=|<<|>>|[<>]=)]]></parameter>
</parameters>
<customMessage>No space before operators</customMessage>
</check>
<check enabled="true" class="org.scalastyle.file.RegexChecker" level="warning">
<check enabled="false" class="org.scalastyle.file.RegexChecker" level="warning">
<parameters>
<!-- :=, :<=, :>=, :<>=, :#=, <>, ===, =/=, <<, >>, <=, >= -->
<parameter name="regex"><![CDATA[(:<?#?>?=|<>|=[=/]=|<<|>>|[<>]=)[^ ]]]></parameter>
<parameter name="regex"><![CDATA[(:<?#?>?=|<>|=[=/]=|<<|>>|[<>]=)[^ \n]]]></parameter>
</parameters>
<customMessage>No space after operators</customMessage>
<customMessage>No space or newline after operators</customMessage>
</check>
<!-- ===== imports ===== -->
@ -158,7 +158,7 @@
<!-- pure lower cases for package names -->
<check enabled="true" class="org.scalastyle.scalariform.PackageNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[a-z]*$</parameter>
<parameter name="regex">^[a-z0-9]*$</parameter>
</parameters>
</check>

View File

@ -222,8 +222,9 @@ class XSNoCTop()(implicit p: Parameters) extends BaseXSSoc with HasSoCParameter
val seip = plic.last(0)
val nmi_31 = nmi.head(0)
val nmi_43 = nmi.head(1)
val debugIntr = debug.head(0)
val msi_info_vld = core_with_l2.module.io.msiInfo.valid
val intSrc = Cat(msip, mtip, meip, seip, nmi_31, nmi_43, msi_info_vld)
val intSrc = Cat(msip, mtip, meip, seip, nmi_31, nmi_43, debugIntr, msi_info_vld)
/*
* CPU Low Power State:

View File

@ -204,11 +204,11 @@ class ISelectField(final val maxValue: Int, reserved: Seq[Range]) extends CSREnu
}
object VSISelectField extends ISelectField(
0x1FF,
0xFFF,
reserved = Seq(
Range.inclusive(0x000, 0x02F),
Range.inclusive(0x040, 0x06F),
Range.inclusive(0x100, 0x1FF),
Range.inclusive(0x100, 0xFFF),
),
)
@ -221,15 +221,16 @@ object MISelectField extends ISelectField(
)
object SISelectField extends ISelectField(
maxValue = 0xFF,
maxValue = 0xFFF,
reserved = Seq(
Range.inclusive(0x00, 0x2F),
Range.inclusive(0x40, 0x6F),
Range.inclusive(0x000, 0x02F),
Range.inclusive(0x040, 0x06F),
Range.inclusive(0x100, 0xFFF),
),
)
class VSISelectBundle extends CSRBundle {
val ALL = VSISelectField(log2Up(0x1FF), 0, null).withReset(0.U)
val ALL = VSISelectField(log2Up(0xFFF), 0, null).withReset(0.U)
}
class MISelectBundle extends CSRBundle {
@ -237,7 +238,7 @@ class MISelectBundle extends CSRBundle {
}
class SISelectBundle extends CSRBundle {
val ALL = SISelectField(log2Up(0xFF), 0, null).withReset(0.U)
val ALL = SISelectField(log2Up(0xFFF), 0, null).withReset(0.U)
}
class TopIBundle extends CSRBundle {

View File

@ -206,8 +206,8 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
private val inst = Wire(Vec(RenameWidth, new XSInstBitFields))
private val isCsr = Wire(Vec(RenameWidth, Bool()))
private val isCsrr = Wire(Vec(RenameWidth, Bool()))
private val isWaitForwardCsrr = Wire(Vec(RenameWidth, Bool()))
private val isBlockBackwardCsrr = Wire(Vec(RenameWidth, Bool()))
private val isNotWaitForwardCsrr = Wire(Vec(RenameWidth, Bool()))
private val isNotBlockBackwardCsrr = Wire(Vec(RenameWidth, Bool()))
private val fuType = uops.map(_.fuType)
private val fuOpType = uops.map(_.fuOpType)
private val vtype = uops.map(_.vpu.vtype)
@ -291,9 +291,9 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
inst(i) := uops(i).instr.asTypeOf(new XSInstBitFields)
isCsr(i) := inst(i).OPCODE5Bit === OPCODE5Bit.SYSTEM && inst(i).FUNCT3(1, 0) =/= 0.U
isCsrr(i) := isCsr(i) && inst(i).FUNCT3 === BitPat("b?1?") && inst(i).RS1 === 0.U
isWaitForwardCsrr(i) := isCsrr(i) && LookupTreeDefault(
isNotWaitForwardCsrr(i) := isCsrr(i) && LookupTreeDefault(
inst(i).CSRIDX, true.B, CSROoORead.waitForwardInOrderCsrReadList.map(_.U -> false.B))
isBlockBackwardCsrr(i) := isCsrr(i) && LookupTreeDefault(
isNotBlockBackwardCsrr(i) := isCsrr(i) && LookupTreeDefault(
inst(i).CSRIDX, true.B, CSROoORead.blockBackwardInOrderCsrReadList.map(_.U -> false.B))
/*
@ -303,8 +303,8 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
*
* Signal "isCsrr" contains not only "CSRR", but also other CSR instructions that do not require writing to CSR.
*/
uops(i).waitForward := io.in(i).bits.waitForward && !isWaitForwardCsrr(i)
uops(i).blockBackward := io.in(i).bits.blockBackward && !isBlockBackwardCsrr(i)
uops(i).waitForward := io.in(i).bits.waitForward && !isNotWaitForwardCsrr(i)
uops(i).blockBackward := io.in(i).bits.blockBackward && !isNotBlockBackwardCsrr(i)
// update cf according to ssit result
uops(i).storeSetHit := io.ssit(i).valid

View File

@ -378,11 +378,9 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
val s1_need_replacement = s1_req.miss && !s1_tag_match
val s1_need_eviction = s1_req.miss && !s1_tag_match && s1_repl_coh.state =/= ClientStates.Nothing
val s1_way_en = Mux(
RegEnable(io.pseudo_error.valid, false.B, s0_fire),
Mux(ParallelORR(s1_real_tag_match_way), s1_real_tag_match_way, s1_repl_way_en),
Mux(s1_need_replacement, s1_repl_way_en, s1_real_tag_match_way)
)
val s1_no_error_way_en = Mux(s1_need_replacement, s1_repl_way_en, s1_real_tag_match_way)
val s1_error_way_en = Mux(ParallelORR(s1_real_tag_match_way), s1_real_tag_match_way, s1_repl_way_en)
val s1_way_en = Mux(io.pseudo_error.valid, s1_error_way_en, s1_no_error_way_en)
assert(!RegNext(s1_fire && PopCount(s1_way_en) > 1.U))
val s1_tag = s1_hit_tag
@ -413,7 +411,6 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
val s2_need_tag = RegEnable(s1_need_tag, s1_fire)
val s2_idx = get_idx(s2_req.vaddr)
val s2_way_en = RegEnable(s1_way_en, s1_fire)
val s2_tag = Mux(s2_need_replacement, s2_repl_tag, RegEnable(s1_tag, s1_fire))
val s2_coh = Mux(s2_need_replacement, s2_repl_coh, RegEnable(s1_coh, s1_fire))
@ -427,8 +424,10 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
val s2_hit = s2_tag_match && s2_has_permission
val s2_sc = s2_req.cmd === M_XSC
val s2_lr = s2_req.cmd === M_XLR
val s2_amo_hit = s2_hit && !s2_req.probe && !s2_req.miss && s2_req.isAMO
val s2_store_hit = s2_hit && !s2_req.probe && !s2_req.miss && s2_req.isStore
val s2_should_not_report_ecc_error = !s2_req.miss && (s2_req.isAMO && !s2_lr || s2_req.isStore)
if(EnableTagEcc) {
s2_tag_error := s2_tag_errors.orR && s2_need_tag
@ -978,7 +977,7 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
s.s1.bits.way_en := s1_way_en
s.s2.valid := s2_valid && !RegEnable(s1_req.replace, s1_fire)
s.s2.bits.set := RegEnable(get_idx(s1_req.vaddr), s1_fire)
s.s2.bits.way_en := RegEnable(s1_way_en, s1_fire)
s.s2.bits.way_en := s2_way_en
s.s3.valid := s3_valid && !RegEnable(s2_req.replace, s2_fire_to_s3)
s.s3.bits.set := RegEnable(get_idx(s2_req.vaddr), s2_fire_to_s3)
s.s3.bits.way_en := RegEnable(s2_way_en, s2_fire_to_s3)
@ -995,7 +994,7 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
// report error to beu and csr, 1 cycle after read data resp
io.error := 0.U.asTypeOf(ValidIO(new L1CacheErrorInfo))
// report error, update error csr
io.error.valid := s3_error && GatedValidRegNext(s2_fire && !(s2_req.isAMO || s2_req.isStore))
io.error.valid := s3_error && GatedValidRegNext(s2_fire && !s2_should_not_report_ecc_error)
// only tag_error and data_error will be reported to beu
// l2_error should not be reported (l2 will report that)
io.error.bits.report_to_beu := (s3_tag_error || s3_data_error) && RegNext(s2_fire)

View File

@ -300,7 +300,7 @@ class LoadQueue(implicit p: Parameters) extends XSModule
for ((buff, w) <- uncacheBuffer.io.req.zipWithIndex) {
// from load_s3
val ldinBits = io.ldu.ldin(w).bits
buff.valid := io.ldu.ldin(w).valid && (ldinBits.nc || ldinBits.mmio) && !ldinBits.rep_info.need_rep && !ldinBits.nc_with_data
buff.valid := io.ldu.ldin(w).valid && !ldinBits.nc_with_data
buff.bits := ldinBits
}

View File

@ -939,6 +939,7 @@ class StoreQueue(implicit p: Parameters) extends XSModule
val cboZeroFlushSb = GatedRegNext(cboZeroToSb)
val cboZeroUop = RegEnable(PriorityMux(isCboZeroToSbVec, deqPtrExt.map(x=>uop(x.value))), cboZeroToSb)
val cboZeroSqIdx = RegEnable(PriorityMux(isCboZeroToSbVec, deqPtrExt), cboZeroToSb)
val cboZeroValid = RegInit(false.B)
val cboZeroWaitFlushSb = RegInit(false.B)
@ -1014,6 +1015,7 @@ class StoreQueue(implicit p: Parameters) extends XSModule
// cbo Zero writeback to ROB
io.cboZeroStout.valid := cboZeroValid && !cboZeroWaitFlushSb
io.cboZeroStout.bits.uop := cboZeroUop
io.cboZeroStout.bits.uop.sqIdx := cboZeroSqIdx
io.cboZeroStout.bits.data := DontCare
io.cboZeroStout.bits.isFromLoadUnit := DontCare
io.cboZeroStout.bits.debug.isMMIO := false.B

View File

@ -114,7 +114,7 @@ class StoreUnit(implicit p: Parameters) extends XSModule
val s0_rob_idx = Mux(s0_use_non_prf_flow, s0_uop.robIdx, 0.U.asTypeOf(s0_uop.robIdx))
val s0_pc = Mux(s0_use_non_prf_flow, s0_uop.pc, 0.U)
val s0_instr_type = Mux(s0_use_non_prf_flow, STORE_SOURCE.U, DCACHE_PREFETCH_SOURCE.U)
val s0_wlineflag = Mux(s0_use_flow_rs, s0_uop.fuOpType === LSUOpType.cbo_zero, false.B)
val s0_wlineflag = Mux(s0_use_flow_rs, LSUOpType.isCboAll(s0_uop.fuOpType), false.B)
val s0_out = Wire(new LsPipelineBundle)
val s0_kill = s0_uop.robIdx.needFlush(io.redirect)
val s0_can_go = s1_ready