\chapter{结构冲突、数据冲突}
\section{实验目的}
\label{sec:goal}
使用WINDLX模拟器,对程序中存在的结构冲突、数据冲突现象进行观察,并对使用专用通路、增加运算部件等技术对性能的影响进行考察,加深对流水线和RISC处理器的特点的理解。
\section{实验内容}
\label{sec:content}
% TODO:再把小节标题定义好
\subsection{第一部分}
用WinDLX运行程序structure\_d.s,找出存在结构冲突的指令对以及导致结构冲突的部件,并以图示证明:
1.记录由结构冲突引起的暂停时钟周期数,计算暂停时钟周期数占总执行周期数的百分比;
2.论述结构冲突对CPU性能的影响,讨论解决结构冲突的方法;
3.采用指令调度方法讨论解决结构冲突的方法,并通过实验验证;
\subsection{第二部分}
在不采用定向技术的情况下(去掉Configuration菜单中Enable Forwarding选项前的勾选符),用WinDLX运行程序data\_d.s。记录数据冲突引起的暂停时钟周期数以及程序执行的总时钟周期数,计算暂停时钟周期数占总执行周期数的百分比。采用指令调度方法讨论解决数据冲突的方法,并通过实验验证。
\subsection{第三部分}
在采用定向技术的情况下(勾选Enable Forwarding),用WinDLX再次运行程序data\_d.s。重复上述【二】中的工作,并计算采用定向技术后性能提高的倍数。采用指令调度方法讨论解决数据冲突的方法,并通过实验验证。
\section{实验过程和具体步骤}
\label{sec:process}
% TODO 列出本次实验的源程序、具体过程步骤以及重点阐述自己的思路及遇到的问题等
\subsection{structure\_d.s源程序}
LHI R2, (A>>16)\&0xFFFF
ADDUI R2, R2, A\&0xFFFF
LHI R3, (B>>16)\&0xFFFF
ADDUI R3, R3, B\&0xFFFF
ADDU R4, R0, R3
loop:
LD F0, 0(R2)
LD F4, 0(R3)
ADDD F0, F0, F4
ADDD F2, F0, F2
ADDI R2, R2, \#8
ADDI R3, R3, \#8
SUB R5, R4, R2
BNEZ R5, loop
TRAP \#0
A: .double 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
B: .double 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
\subsection{改良之后的structure\_d.s源程序}
LHI R2, (A>>16)\&0xFFFF
ADDUI R2, R2, A\&0xFFFF
LHI R3, (B>>16)\&0xFFFF
ADDUI R3, R3, B\&0xFFFF
ADDU R4, R0, R3
loop:
LD F0, 0(R2)
ADDI R2, R2, \#8
LD F4, 0(R3)
ADDI R3, R3, \#8
ADDD F0, F0, F4
ADDD F2, F0, F2
SUB R5, R4, R2
BNEZ R5, loop
TRAP \#0
A: .double 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
B: .double 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
\subsection{data\_d.s源程序}
LHI R2, (A>>16)\&0xFFFF
ADDUI R2, R2, A\&0xFFFF
LHI R3, (B>>16)\&0xFFFF
ADDUI R3, R3, B\&0xFFFF
loop:
LW R1, 0(R2)
ADD R1, R1, R3
SW 0(R2), R1
LW R5, 0(R1)
ADDI R5, R5, \#10
ADDI R2, R2, \#4
SUB R4, R3, R2
BNEZ R4, loop
TRAP \#0
A: .word 0, 4, 8, 12, 16, 20, 24, 28, 32, 36
B: .word 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
\subsection{改良后的data\_d.s源程序}
LHI R2, (A>>16)\&0xFFFF\\
ADDUI R2, R2, A\&0xFFFF\\
LHI R3, (B>>16)\&0xFFFF\\
ADDUI R3, R3, B\&0xFFFF\\
loop: \\
LW R1, 0(R2) \\
ADDI R2, R2, \#4 \\
ADD R1, R1, R3 \\
SW 0(R2), R1 \\
SUB R4, R3, R2 \\
LW R5, 0(R1) \\
ADDI R5, R5, \#10 \\
BNEZ R4, loop \\
TRAP \#0\\
A: .word 0, 4, 8, 12, 16, 20, 24, 28, 32, 36\\
B: .word 9, 8, 7, 6, 5, 4, 3, 2, 1, 0\\
\subsection{实验具体步骤}
1、在winDLX simulator中运行structure\_d.s,如图\ref{fig:s}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/s}
\caption{structure\_d.s运行流水线图。}
\label{fig:s}
\end{figure}
2、找出structure\_d.s中所有存在结构相关的指令对以及导致结构相关的部件
(1)指令:ADDD F2, F0, F2
ADDI R2, R2, \#8
ADDI R3, R3, \#8
SUB R5, R4, R2
(2)部件:ALU。
3.计算由结构相关引起的暂停时钟周期数,计算暂停时钟周期数占总执行周期数的百分比
由结构相关引起的暂停时钟周期数=3*10=30;
总执行周期数=139
结构冲突占比=30/139=21.58\%
4.优化过后的structure\_d.s运行结果如图\ref{fig:s_pro}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/s_pro}
\caption{改良后的structure\_d.s运行流水线图。}
\label{fig:s_pro}
\end{figure}
5、计算由结构相关引起的暂停时钟周期数,计算暂停时钟周期数占总执行周期数的百分比
暂停周期数:20
总周期数:119
结构冲突占比:20/119=16.81\%
6、在不采用定向技术的情况下,记录data\_d.s中由数据相关引起的暂停时钟周期数以及程序执行的总时钟周期数,计算暂停时钟周期数占总执行周期数的百分比,运行结果如图\ref{fig:data_n}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/data_n}
\caption{不定向条件下data\_d.s运行流水线图。}
\label{fig:data_n}
\end{figure}
由数据相关引起的暂停时钟周期数=104
程序执行的总时钟周期数=202
104/202=51.48\%
7、不定向条件下改良之后的data\_d.s的数据相关占比及运行图\ref{fig:data_n_pro}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/data_n_pro}
\caption{不定向条件下改良data\_d.s运行流水线图。}
\label{fig:data_n_pro}
\end{figure}
由数据相关引起的暂停时钟周期数=54
程序执行的总时钟周期数=152
占比=54/152=35.53\%
8、在采用定向技术的情况下,记录data\_d.s中由数据相关引起的暂停时钟周期数以及程序执行的总时钟周期数,计算暂停时钟周期数占总执行周期数的百分比;如图\ref{fig:data}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/data}
\caption{定向条件下data\_d.s运行流水线图。}
\label{fig:data}
\end{figure}
由数据相关引起的暂停时钟周期数=30
程序执行的总时钟周期数=128
占比=30/128=23.44\%
9、定向条件下改良之后的data\_d.s的数据相关占比及运行图\ref{fig:data_pro}。
\begin{figure}[h]
\centering
\includegraphics[width=0.9\columnwidth]{figs/data_pro}
\caption{定向条件下改良的data\_d.s运行流水线图。}
\label{fig:data_pro}
\end{figure}
由数据相关引起的暂停时钟周期数=20
程序执行的总时钟周期数=108
占比=20/108=18.52\%
\subsection{实验思路及遇到的问题}
1. 结构冲突分析
(1)目标:使用 WinDLX 模拟器运行structure\_d.s,观察结构冲突,记录暂停周期并分析解决方案。
(2)步骤:
运行程序:在 WinDLX 中加载structure\_d.s,启用模拟器的流水线监控功能。
识别冲突:
结构冲突通常由共享硬件资源竞争引起。
通过流水图标记冲突指令对(如连续两条指令同时使用 ALU 或内存),记录冲突发生的周期和对应的部件(如寄存器堆、算术逻辑单元 ALU 等)。
统计数据:
记录总执行周期数和因结构冲突导致的暂停周期数,计算暂停周期占比(暂停周期数 / 总周期数 ×100\%)。
分析与验证:
论述结构冲突对 CPU 性能的影响(如流水线停顿导致吞吐率下降)并尝试通过指令调度解决冲突,重新运行程序验证暂停周期是否减少。
2. 数据冲突分析
目标:在有无定向技术时运行data\_d.s,观察数据冲突并比较性能。
步骤:
无定向技术:
禁用 WinDLX 的 “Enable Forwarding” 选项,运行data\_d.s。
数据冲突(如写后读 RAW 冲突)会导致流水线停顿,通过流水图记录冲突指令对(如前一条指令写寄存器,后一条指令立即读该寄存器)。
统计总周期数和暂停周期数,计算占比,并尝试通过指令调度(如插入空指令或调整指令顺序)减少冲突。
有定向技术:
启用 “Enable Forwarding”,再次运行data\_d.s。
定向技术通过旁路通路直接传递数据,减少停顿。对比前后两次数据,计算性能提升倍数(无定向总周期数 / 有定向总周期数)。
\section{调试报告}
% TODO 包括遇到的问题、如何解决的、本次实验的经验、体会、改进设想等;
\section{测试数据及运行结果}为什么会报错Initial Win CP for (console input, console output, system): (CP936, CP936, CP936)
I changed them all to CP936
Rc files read:
NONE
Latexmk: This is Latexmk, John Collins, 27 Dec. 2024. Version 4.86a.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': Reasons for rerun
Category 'other':
Rerun of 'xelatex' forced or previously required:
Reason or flag: 'Initial setup'
------------
Run number 1 of rule 'xelatex'
------------
------------
Running 'xelatex -no-pdf -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:/Users/91643/Downloads/CS_structure/template/document.tex"'
------------
This is XeTeX, Version 3.141592653-2.6-0.999997 (TeX Live 2025) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(c:/Users/91643/Downloads/CS_structure/template/document.tex
LaTeX2e <2024-11-01> patch level 2
L3 programming layer <2025-01-18>
(./bistuthesis.cls
Document Class: bistuthesis 2024/01/01 BISTU Thesis Template
(c:/texlive/2025/texmf-dist/tex/latex/tools/array.sty) (c:/texlive/2025/texmf-dist/tex/latex/arydshln/arydshln.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjustbox.sty (c:/texlive/2025/texmf-dist/tex/latex/xkeyval/xkeyval.sty (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkeyval.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkvutils.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjcalc.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/trimclip.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/xetex.def))) (c:/texlive/2025/texmf-dist/tex/latex/collectbox/collectbox.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/tc-xetex.def)) (c:/texlive/2025/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty) (c:/texlive/2025/texmf-dist/tex/latex/varwidth/varwidth.sty)) (c:/texlive/2025/texmf-dist/tex/latex/tools/tabularx.sty) (c:/texlive/2025/texmf-dist/tex/latex/multirow/multirow.sty) (c:/texlive/2025/texmf-dist/tex/latex/tools/calc.sty) (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amssymb.sty (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (c:/texlive/2025/texmf-dist/tex/latex/ragged2e/ragged2e.sty) (c:/texlive/2025/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexbook.cls (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (c:/texlive/2025/texmf-dist/tex/latex/l3kernel/expl3.sty (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-xetex.def))
Document Class: ctexbook 2022/07/14 v2.5.10 Chinese adapter for class book (CTEX)
(c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexhook.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexpatch.sty) (c:/texlive/2025/texmf-dist/tex/latex/base/fix-cm.sty (c:/texlive/2025/texmf-dist/tex/latex/base/ts1enc.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (c:/texlive/2025/texmf-dist/tex/latex/base/book.cls
Document Class: book 2024/06/29 v1.4n Standard LaTeX document class
(c:/texlive/2025/texmf-dist/tex/latex/base/bk10.clo)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (c:/texlive/2025/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.sty (c:/texlive/2025/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (c:/texlive/2025/texmf-dist/tex/latex/base/fontenc.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))) (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber.sty (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctex-c5size.clo) (c:/texlive/2025/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex.cfg) (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty (c:/texlive/2025/texmf-dist/tex/generic/ulem/ulem.sty)) (c:/texlive/2025/texmf-dist/tex/latex/titlesec/titlesec.sty) (c:/texlive/2025/texmf-dist/tex/latex/titlesec/titletoc.sty)
Package ctexhook Warning: Package `CJKulem' can not be loaded with `xeCJK'.
(c:/texlive/2025/texmf-dist/tex/latex/geometry/geometry.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/ifvtex.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty)))
Class ctexbook Warning: Command `\CTEXsetup' is deprecated.
(ctexbook) \ctexset { section = { format=\zihao {4}\bfseries
(ctexbook) \flushleft } } is set.
Class ctexbook Warning: Command `\CTEXsetup' is deprecated.
(ctexbook) \ctexset { subsection = { format=\zihao {5}\bfseries
(ctexbook) \flushleft } } is set.
) (c:/texlive/2025/texmf-dist/tex/latex/gbt7714/gbt7714.sty (c:/texlive/2025/texmf-dist/tex/latex/natbib/natbib.sty) (c:/texlive/2025/texmf-dist/tex/latex/url/url.sty))
LaTeX Warning: Unused global option(s):
[AutoFakeBold].
(./document.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
(./data/title.tex
LaTeX Font Warning: Font shape `TU/SimSun(1)/b/n' undefined
(Font) using `TU/SimSun(1)/m/n' instead on input line 9.
LaTeX Font Warning: Font shape `TU/KaiTi(0)/b/n' undefined
(Font) using `TU/KaiTi(0)/m/n' instead on input line 9.
(c:/texlive/2025/texmf-dist/tex/latex/amsfonts/umsa.fd) (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/umsb.fd)
Overfull \hbox (5.6pt too wide) in alignment at lines 9--9
[][][][]
Overfull \hbox (4.5811pt too wide) in alignment at lines 9--9
[][]
)
[1]
No file document.toc.
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[1] (./exp/exp1.tex
第一章
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[1]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 130.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/it' undefined
(Font) using `TU/SimSun(1)/m/n' instead on input line 130.
[2]
Underfull \hbox (badness 10000) in paragraph at lines 138--154
LaTeX Warning: Reference `fig:s' on page 3 undefined on input line 156.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 179.
[3]
LaTeX Warning: Reference `fig:s_pro' on page 4 undefined on input line 185.
LaTeX Warning: Reference `fig:data_n' on page 4 undefined on input line 200.
LaTeX Warning: Reference `fig:data_n_pro' on page 4 undefined on input line 216.
LaTeX Warning: `h' float specifier changed to `ht'.
LaTeX Warning: Reference `fig:data' on page 4 undefined on input line 230.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 237.
[4]
LaTeX Warning: Reference `fig:data_pro' on page 5 undefined on input line 244.
LaTeX Warning: `h' float specifier changed to `ht'.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 275.
[5]) (./exp/exp2.tex
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[6]
第二章
LaTeX Warning: Reference `fig:example' on page 7 undefined on input line 13.
Package natbib Warning: Citation `XLXD20240305007' on page 7 undefined on input line 29.
Package natbib Warning: Citation `9429102' on page 7 undefined on input line 31.
Package natbib Warning: Citation `SYZT20240304003' on page 7 undefined on input line 33.
) (./exp/exp3.tex
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[7]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[8]
第三章
LaTeX Warning: Reference `fig:example' on page 9 undefined on input line 13.
Package natbib Warning: Citation `XLXD20240305007' on page 9 undefined on input line 29.
Package natbib Warning: Citation `9429102' on page 9 undefined on input line 31.
Package natbib Warning: Citation `SYZT20240304003' on page 9 undefined on input line 33.
) (./exp/exp4.tex
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[9]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[10]
第四章
LaTeX Warning: Reference `fig:example' on page 11 undefined on input line 13.
Package natbib Warning: Citation `XLXD20240305007' on page 11 undefined on input line 29.
Package natbib Warning: Citation `9429102' on page 11 undefined on input line 31.
Package natbib Warning: Citation `SYZT20240304003' on page 11 undefined on input line 33.
)
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[11]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 35.
[12] (./document.bbl)
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[13]
Package natbib Warning: There were undefined citations.
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[14] (./document.aux
Package natbib Warning: Citation(s) may have changed.
(natbib) Rerun to get citations correct.
)
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
LaTeX Warning: There were undefined references.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
)
(see the transcript file for additional information)
Output written on document.xdv (16 pages, 76756 bytes).
SyncTeX written on document.synctex.gz.
Transcript written on document.log.
Latexmk: Getting log file 'document.log'
Latexmk: Examining 'document.fls'
Latexmk: Examining 'document.log'
Latexmk: Missing input file 'document.toc' (or dependence on it) from following:
No file document.toc.
Latexmk: Found input bbl file 'document.bbl'
Latexmk: References changed.
Latexmk: References changed.
Latexmk: Log file says output to 'document.xdv'
Latexmk: Found bibliography file(s):
./ref/refs.bib
Latexmk: applying rule 'bibtex document'...
Rule 'bibtex document': Reasons for rerun
Category 'other':
Rerun of 'bibtex document' forced or previously required:
Reason or flag: 'Initial set up of rule'
------------
Run number 1 of rule 'bibtex document'
------------
------------
Running 'bibtex "document.aux"'
------------
This is BibTeX, Version 0.99d (TeX Live 2025)
The top-level auxiliary file: document.aux
The style file: gbt7714-numerical.bst
Database file #1: ref/refs.bib
Warning--empty year in XLXD20240305007
Warning--empty year in XLXD20240305007
Warning--empty year in SYZT20240304003
Warning--empty year in SYZT20240304003
Warning--empty year in XLXD20240305007
Warning--empty year in SYZT20240304003
(There were 6 warnings)
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': Reasons for rerun
Changed files or newly in use/created:
document.aux
document.toc
------------
Run number 2 of rule 'xelatex'
------------
------------
Running 'xelatex -no-pdf -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:/Users/91643/Downloads/CS_structure/template/document.tex"'
------------
This is XeTeX, Version 3.141592653-2.6-0.999997 (TeX Live 2025) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(c:/Users/91643/Downloads/CS_structure/template/document.tex
LaTeX2e <2024-11-01> patch level 2
L3 programming layer <2025-01-18>
(./bistuthesis.cls
Document Class: bistuthesis 2024/01/01 BISTU Thesis Template
(c:/texlive/2025/texmf-dist/tex/latex/tools/array.sty) (c:/texlive/2025/texmf-dist/tex/latex/arydshln/arydshln.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjustbox.sty (c:/texlive/2025/texmf-dist/tex/latex/xkeyval/xkeyval.sty (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkeyval.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkvutils.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjcalc.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/trimclip.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/xetex.def))) (c:/texlive/2025/texmf-dist/tex/latex/collectbox/collectbox.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/tc-xetex.def)) (c:/texlive/2025/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty) (c:/texlive/2025/texmf-dist/tex/latex/varwidth/varwidth.sty)) (c:/texlive/2025/texmf-dist/tex/latex/tools/tabularx.sty) (c:/texlive/2025/texmf-dist/tex/latex/multirow/multirow.sty) (c:/texlive/2025/texmf-dist/tex/latex/tools/calc.sty) (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amssymb.sty (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (c:/texlive/2025/texmf-dist/tex/latex/ragged2e/ragged2e.sty) (c:/texlive/2025/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexbook.cls (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (c:/texlive/2025/texmf-dist/tex/latex/l3kernel/expl3.sty (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-xetex.def))
Document Class: ctexbook 2022/07/14 v2.5.10 Chinese adapter for class book (CTEX)
(c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexhook.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexpatch.sty) (c:/texlive/2025/texmf-dist/tex/latex/base/fix-cm.sty (c:/texlive/2025/texmf-dist/tex/latex/base/ts1enc.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (c:/texlive/2025/texmf-dist/tex/latex/base/book.cls
Document Class: book 2024/06/29 v1.4n Standard LaTeX document class
(c:/texlive/2025/texmf-dist/tex/latex/base/bk10.clo)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (c:/texlive/2025/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.sty (c:/texlive/2025/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (c:/texlive/2025/texmf-dist/tex/latex/base/fontenc.sty) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))) (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber.sty (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctex-c5size.clo) (c:/texlive/2025/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex.cfg) (c:/texlive/2025/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty (c:/texlive/2025/texmf-dist/tex/generic/ulem/ulem.sty)) (c:/texlive/2025/texmf-dist/tex/latex/titlesec/titlesec.sty) (c:/texlive/2025/texmf-dist/tex/latex/titlesec/titletoc.sty)
Package ctexhook Warning: Package `CJKulem' can not be loaded with `xeCJK'.
(c:/texlive/2025/texmf-dist/tex/latex/geometry/geometry.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/ifvtex.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty)))
Class ctexbook Warning: Command `\CTEXsetup' is deprecated.
(ctexbook) \ctexset { section = { format=\zihao {4}\bfseries
(ctexbook) \flushleft } } is set.
Class ctexbook Warning: Command `\CTEXsetup' is deprecated.
(ctexbook) \ctexset { subsection = { format=\zihao {5}\bfseries
(ctexbook) \flushleft } } is set.
) (c:/texlive/2025/texmf-dist/tex/latex/gbt7714/gbt7714.sty (c:/texlive/2025/texmf-dist/tex/latex/natbib/natbib.sty) (c:/texlive/2025/texmf-dist/tex/latex/url/url.sty))
LaTeX Warning: Unused global option(s):
[AutoFakeBold].
(./document.aux
LaTeX Warning: Label `sec:goal' multiply defined.
LaTeX Warning: Label `sec:content' multiply defined.
LaTeX Warning: Label `sec:process' multiply defined.
LaTeX Warning: Label `sec:goal' multiply defined.
LaTeX Warning: Label `sec:content' multiply defined.
LaTeX Warning: Label `sec:process' multiply defined.
LaTeX Warning: Label `fig:example' multiply defined.
LaTeX Warning: Label `sec:goal' multiply defined.
LaTeX Warning: Label `sec:content' multiply defined.
LaTeX Warning: Label `sec:process' multiply defined.
LaTeX Warning: Label `fig:example' multiply defined.
)
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
(./data/title.tex
LaTeX Font Warning: Font shape `TU/SimSun(1)/b/n' undefined
(Font) using `TU/SimSun(1)/m/n' instead on input line 9.
LaTeX Font Warning: Font shape `TU/KaiTi(0)/b/n' undefined
(Font) using `TU/KaiTi(0)/m/n' instead on input line 9.
(c:/texlive/2025/texmf-dist/tex/latex/amsfonts/umsa.fd) (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/umsb.fd)
Overfull \hbox (5.6pt too wide) in alignment at lines 9--9
[][][][]
Overfull \hbox (4.5811pt too wide) in alignment at lines 9--9
[][]
)
[1] (./document.toc)
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[1] (./exp/exp1.tex
第一章
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[1]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 130.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/it' undefined
(Font) using `TU/SimSun(1)/m/n' instead on input line 130.
[2]
Underfull \hbox (badness 10000) in paragraph at lines 138--154
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 179.
[3]
LaTeX Warning: `h' float specifier changed to `ht'.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 237.
[4]
LaTeX Warning: `h' float specifier changed to `ht'.
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 275.
[5]) (./exp/exp2.tex
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[6]
第二章
) (./exp/exp3.tex
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[7]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[8]
第三章
) (./exp/exp4.tex
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[9]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 1.
[10]
第四章
)
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[11]
LaTeX Font Warning: Font shape `TU/SimSun(1)/m/sl' undefined
(Font) using `TU/SimSun(1)/m/it' instead on input line 35.
[12] (./document.bbl)
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[13]
Package fancyhdr Warning: \headheight is too small (12.0pt):
(fancyhdr) Make it at least 12.64723pt, for example:
(fancyhdr) \setlength{\headheight}{12.64723pt}.
(fancyhdr) You might also make \topmargin smaller:
(fancyhdr) \addtolength{\topmargin}{-0.64723pt}.
[14] (./document.aux)
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
LaTeX Warning: There were multiply-defined labels.
)
(see the transcript file for additional information)
Output written on document.xdv (16 pages, 101760 bytes).
SyncTeX written on document.synctex.gz.
Transcript written on document.log.
Latexmk: Getting log file 'document.log'
Latexmk: Examining 'document.fls'
Latexmk: Examining 'document.log'
Latexmk: Found input bbl file 'document.bbl'
Latexmk: Log file says output to 'document.xdv'
Latexmk: Found bibliography file(s):
./ref/refs.bib
Latexmk: applying rule 'xdvipdfmx'...
Rule 'xdvipdfmx': Reasons for rerun
Changed files or newly in use/created:
document.xdv
Category 'changed_source_rules':
xelatex
------------
Run number 1 of rule 'xdvipdfmx'
------------
------------
Running 'xdvipdfmx -E -o "document.pdf" "document.xdv"'
------------
document.xdv -> document.pdf
xdvipdfmx:fatal: Unable to open "document.pdf".
No output PDF file written.
Latexmk: Summary of warnings from last run of *latex:
Latex found 11 multiply defined reference(s)
Latexmk: Errors, so I did not complete making targets
Latexmk: ====Undefined refs and citations with line #s in .tex file:
Label `sec:goal' multiply defined
Label `sec:content' multiply defined
Label `sec:process' multiply defined
Label `sec:goal' multiply defined
Label `sec:content' multiply defined
Label `sec:process' multiply defined
Label `fig:example' multiply defined
And 4 more --- see log file 'document.log'
Latexmk: Sometimes, the -f option can be used to get latexmk
to try to force complete processing.
But normally, you will need to correct the file(s) that caused the
error, and then rerun latexmk.
In some cases, it is best to clean out generated files before rerunning
latexmk after you've corrected the files.
Collected error summary (may duplicate other messages):
xdvipdfmx: Command for 'xdvipdfmx' gave return code 256
C:\texlive\2025\bin\windows\runscript.tlu:922: command failed with exit code 12:
perl.exe c:\texlive\2025\texmf-dist\scripts\latexmk\latexmk.pl -synctex=1 -interaction=nonstopmode -file-line-error -xelatex -outdir=c:/Users/91643/Downloads/CS_structure/template c:/Users/91643/Downloads/CS_structure/template/document