A72: nocross model: start writeup

This commit is contained in:
Théophile Bastian 2023-09-21 17:48:47 +02:00
parent 54403c6ce6
commit 175cb8cef3
4 changed files with 504 additions and 0 deletions

View file

@ -180,3 +180,47 @@ model mapping each supported instruction of the ISA to its \uop{} count.
which is consistent. We conclude that $\mucount i = 3\cyc{\kerK_3} = 4-2 =
2$.
\end{example}
\subsection{Bubbles in the pipeline}
The frontend, however, does not always exhibit a purely linear behaviour. We
consider for instance the kernel $\kerK =$ \lstarmasm{ADDV_FD_H_VN_V_8H} $+
3\times\basic{Int01}$; for the rest of this chapter, we refer to
\lstarmasm{ADDV_FD_H_VN_V_8H} as simply \lstarmasm{ADDV} when not stated
otherwise.
Backend-wise, \texttt{ADDV} fully loads \texttt{FP1} and \texttt{FP01}, while
$\basic{Int01}$ half-loads \texttt{Int01}. The port most loaded by $\kerK$ is
thus \texttt{Int01}, with a load of $1\,\sfrac{1}{2}$. We then expect
$\cycB{\kerK} = 1\,\sfrac{1}{2}$.
Frontend-wise, \texttt{ADDV} decomposes into two \uops{}, while $\basic{Int01}$
decomposes into a single \uops{}; thus, $\mucount{}\kerK = 5$. We then expect
$\cycF{\kerK} = 1\,\sfrac{2}{3}$.
As the frontend dominates the backend, we expect $\cyc{\kerK} = \cycF{\kerK} =
1\,\sfrac{2}{3}$. However, in reality, we measure $\cyc{\kerK} = 2.01 \simeq 2$
cycles.
\medskip{}
From then on, we strive to find a model that could reliably predict, given a
kernel, how many cycles it requires to execute, frontend-wise, in a
steady-state.
\subsubsection{No-cross model}
\begin{figure}
\centering
\includegraphics[width=0.7\linewidth]{timeline_front_nocross.svg}
\end{figure}
On the x86-64 architectures they analyzed, \uica{}'s authors find that the
CPU's predecoder might cause an instruction's \uops{} to be postponed to the
next cycle if it is pre-decoded across a cycle boundary~\cite{uica} (§4.1).
We hypothesize that the same kind of effect could postpone an instruction's
\uops{} until the next cycle if its \uops{} would cross a cycle boundary
otherwise, as illustrated in \qtodo{ref}.

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="timeline_front_cross-uncrossed.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="6.9771605"
inkscape:cx="60.913032"
inkscape:cy="72.020702"
inkscape:window-width="1916"
inkscape:window-height="1161"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showguides="true" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-2.1772709)">
<g
id="g4"
transform="translate(0,2.1772709)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect4"
width="9"
height="9"
x="0.5"
y="10.5" />
<rect
style="fill:#e788e7;stroke-width:8"
id="rect1"
width="8"
height="8"
x="1"
y="11" />
</g>
<g
id="g9"
transform="translate(0,2.1772709)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect5"
width="9"
height="9"
x="10.5"
y="10.5" />
<rect
style="fill:#6d7fe8;fill-opacity:1;stroke-width:8"
id="rect6"
width="8"
height="8"
x="11"
y="11" />
</g>
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1.45297"
id="rect7"
width="19"
height="9"
x="0.5"
y="22.677271" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:12"
id="rect8"
width="18"
height="8"
x="1"
y="23.177271" />
<text
xml:space="preserve"
style="font-size:7.05556px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
x="0.96519858"
y="9.5445681"
id="text9"><tspan
sodipodi:role="line"
id="tspan9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0.264583"
x="0.96519858"
y="9.5445681">Frontend</tspan></text>
<path
id="path1"
style="fill:#6c6c6c;fill-opacity:1;stroke-width:1.10683"
d="m 29.108771,12.677271 -1.182269,1.181697 a 4.427344,4.4273434 0 0 0 -2.926216,-1.109056 4.427344,4.4273434 0 0 0 -4.427645,4.427073 4.427344,4.4273434 0 0 0 1.109056,2.926787 L 20.5,21.286041 l 0.39123,0.39123 1.181697,-1.182269 a 4.427344,4.4273434 0 0 0 2.927359,1.109628 4.427344,4.4273434 0 0 0 4.427073,-4.427645 4.427344,4.4273434 0 0 0 -1.109628,-2.926787 L 29.5,13.068501 Z m -4.108485,0.625738 a 3.873926,3.8739255 0 0 1 2.535558,0.947189 l -5.45491,5.454908 a 3.873926,3.8739255 0 0 1 -0.954623,-2.528121 3.873926,3.8739255 0 0 1 3.873975,-3.873976 z m 2.926787,1.338419 a 3.873926,3.8739255 0 0 1 0.947189,2.535557 3.873926,3.8739255 0 0 1 -3.873976,3.873975 3.873926,3.8739255 0 0 1 -2.528122,-0.954624 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="timeline_front_cross.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="4.9335975"
inkscape:cx="31.011853"
inkscape:cy="51.585076"
inkscape:window-width="1916"
inkscape:window-height="1161"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-2.1772709)">
<g
id="g4"
transform="translate(0,2.1772709)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect4"
width="9"
height="9"
x="0.5"
y="10.5" />
<rect
style="fill:#e788e7;stroke-width:8"
id="rect1"
width="8"
height="8"
x="1"
y="11" />
</g>
<g
id="g9"
transform="translate(0,2.1772709)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect5"
width="9"
height="9"
x="10.5"
y="10.5" />
<rect
style="fill:#6d7fe8;fill-opacity:1;stroke-width:8"
id="rect6"
width="8"
height="8"
x="11"
y="11" />
</g>
<g
id="g2"
transform="translate(0,0.50000001)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect7"
width="9"
height="9"
x="20.5"
y="12.177271" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:8.24621"
id="rect8"
width="8.5"
height="8"
x="21"
y="12.677271" />
</g>
<text
xml:space="preserve"
style="font-size:7.05556px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
x="0.96519858"
y="9.5445681"
id="text9"><tspan
sodipodi:role="line"
id="tspan9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0.264583"
x="0.96519858"
y="9.5445681">Frontend</tspan></text>
<g
id="g3"
transform="matrix(-1,0,0,1,30,10.5)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect2"
width="9"
height="9"
x="20.5"
y="12.177271" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:8.24621"
id="rect3"
width="8.5"
height="8"
x="21"
y="12.677271" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="80mm"
height="30mm"
viewBox="0 0 80 30"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="timeline_front_nocross.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showguides="true"
inkscape:zoom="3.4868259"
inkscape:cx="135.65346"
inkscape:cy="113.42694"
inkscape:window-width="1916"
inkscape:window-height="1161"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1">
<marker
style="overflow:visible"
id="ArrowWideRounded"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="Wide, rounded arrow"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
style="fill:none;stroke:context-stroke;stroke-width:1;stroke-linecap:round"
d="M 3,-3 0,0 3,3"
transform="rotate(180,0.125,0)"
sodipodi:nodetypes="ccc"
id="path2" />
</marker>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g4"
transform="translate(50)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect4"
width="9"
height="9"
x="0.5"
y="10.5" />
<rect
style="fill:#e788e7;stroke-width:8"
id="rect1"
width="8"
height="8"
x="1"
y="11" />
</g>
<g
id="g9"
transform="translate(50)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect5"
width="9"
height="9"
x="10.5"
y="10.5" />
<rect
style="fill:#6d7fe8;fill-opacity:1;stroke-width:8"
id="rect6"
width="8"
height="8"
x="11"
y="11" />
</g>
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1.45297"
id="rect7"
width="19"
height="9"
x="50.5"
y="20.5" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:12"
id="rect8"
width="18"
height="8"
x="51"
y="21" />
<text
xml:space="preserve"
style="font-size:7.05556px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
x="50.965202"
y="7.3672943"
id="text9"><tspan
sodipodi:role="line"
id="tspan9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0.264583"
x="50.965202"
y="7.3672943">Frontend</tspan></text>
<path
id="path1"
style="fill:#6c6c6c;fill-opacity:1;stroke-width:1.10683"
d="m 79.108776,10.499997 -1.18227,1.181697 a 4.427344,4.4273434 0 0 0 -2.92622,-1.109056 4.427344,4.4273434 0 0 0 -4.42764,4.427073 4.427344,4.4273434 0 0 0 1.10905,2.926787 l -1.18169,1.182269 0.39123,0.39123 1.18169,-1.182269 a 4.427344,4.4273434 0 0 0 2.92736,1.109628 4.427344,4.4273434 0 0 0 4.42708,-4.427645 4.427344,4.4273434 0 0 0 -1.10963,-2.926787 l 1.18227,-1.181697 z m -4.10849,0.625738 a 3.873926,3.8739255 0 0 1 2.53556,0.947189 l -5.45491,5.454908 a 3.873926,3.8739255 0 0 1 -0.95462,-2.528121 3.873926,3.8739255 0 0 1 3.87397,-3.873976 z m 2.92679,1.338419 a 3.873926,3.8739255 0 0 1 0.94719,2.535557 3.873926,3.8739255 0 0 1 -3.87398,3.873975 3.873926,3.8739255 0 0 1 -2.52812,-0.954624 z" />
<g
id="g4-4">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect4-4"
width="9"
height="9"
x="0.5"
y="10.5" />
<rect
style="fill:#e788e7;stroke-width:8"
id="rect1-9"
width="8"
height="8"
x="1"
y="11" />
</g>
<g
id="g9-9">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect5-3"
width="9"
height="9"
x="10.5"
y="10.5" />
<rect
style="fill:#6d7fe8;fill-opacity:1;stroke-width:8"
id="rect6-6"
width="8"
height="8"
x="11"
y="11" />
</g>
<g
id="g2"
transform="translate(0,-1.6772709)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect7-0"
width="9"
height="9"
x="20.5"
y="12.177271" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:8.24621"
id="rect8-5"
width="8.5"
height="8"
x="21"
y="12.677271" />
</g>
<text
xml:space="preserve"
style="font-size:7.05556px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
x="0.96519858"
y="7.3672972"
id="text9-0"><tspan
sodipodi:role="line"
id="tspan9-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0.264583"
x="0.96519858"
y="7.3672972">Frontend</tspan></text>
<g
id="g3"
transform="matrix(-1,0,0,1,30,8.3227291)">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:1"
id="rect2-9"
width="9"
height="9"
x="20.5"
y="12.177271" />
<rect
style="fill:#bf5e6c;fill-opacity:1;stroke-width:8.24621"
id="rect3"
width="8.5"
height="8"
x="21"
y="12.677271" />
</g>
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#ArrowWideRounded)"
d="m 31.521447,15 h 16"
id="path10" />
<text
xml:space="preserve"
style="font-size:7.05556px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;stroke-width:0.264583"
x="34.557175"
y="5.4227886"
id="text11"><tspan
sodipodi:role="line"
id="tspan11"
style="stroke-width:0.264583"
x="34.557175"
y="5.4227886" /></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB