Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
name1e5s committed Jun 3, 2020
1 parent 98fd027 commit 9b8e763
Show file tree
Hide file tree
Showing 283 changed files with 3,060 additions and 3 deletions.
Binary file modified CAWithFuckingBUPTCharacteristics/Lab5/Lab5.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions CAWithFuckingBUPTCharacteristics/Lab5/Lab5.tex
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ \section{实验内容和步骤}
\item 自陷停顿:1
\item 发生冲突的指令组合:
\begin{itemize}[leftmargin=3em]
\item ADDIU \$1, \$0, 56 和 LW \$r2,0(\$r1)
\item LW \$r2,0(\$r1) 和 ADD \$r4,\$r0,\$r2
\item ADD \$r4,\$r0,\$r2 和 SW \$r4,0(\$r1)
\item SW \$r4,0(\$r1) 和 LW \$r6,4(\$r1)
\item ADD \$r8,\$r6,\$r1 和 MUL \$r12,\$r10,\$r1
\item LW \$r6,4(\$r1) 和 ADD \$r8,\$r6,\$r1
\item MUL \$r12,\$r10,\$r1 和 ADD \$r16,\$r12,\$r1
\item ADD \$r16,\$r12,\$r1 和 ADD \$r18,\$r16,\$r1
\item ADD \$r18,\$r16,\$r1 和 SW \$r18,16(\$r1)
\item SW \$r18,16(\$r1) 和 LW \$r20 8(\$r1)
\item MUL \$r22,\$r20,\$r14 和 MUL \$r24,\$r26,\$r14
\end{itemize}
\end{itemize}
Expand Down
Binary file added CAWithFuckingBUPTCharacteristics/Lab5/slide.pdf
Binary file not shown.
255 changes: 255 additions & 0 deletions CAWithFuckingBUPTCharacteristics/Lab5/slide.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
\documentclass[UTF8]{ctexbeamer}

\usetheme{Boadilla}

\usecolortheme{rose}

\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{listings}
\usepackage{amsmath}

\definecolor{light-gray}{gray}{0.95}
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}

\pgfplotsset{width=7cm,compat=1.6}
\usefonttheme[onlymath]{serif}

\newfontfamily\courier{Courier New}
\lstset{linewidth=1.1\textwidth,
numbers=left,
basicstyle=\small\courier,
numberstyle=\tiny\courier,
keywordstyle=\color{blue}\courier,
commentstyle=\it\color[cmyk]{1,0,1,0}\courier,
stringstyle=\it\color[RGB]{128,0,0}\courier,
breaklines,
extendedchars=false,
xleftmargin=2em,xrightmargin=2em, aboveskip=1em,
tabsize=4,
basicstyle=\small\courier
}

\tikzstyle{myBlock}=[draw, fill=blue!30!white, minimum size=0.5in, node distance=2.25in]
\usetikzlibrary{arrows.meta}
\tikzstyle{myPath} = [-{Latex[length=2mm,width=2mm]}, line width=0.4mm]


\begin{document}

\title{计算机系统结构实验五}
\author{\songti 于海鑫}
\institute{2017211240}

\date{\today}

\frame{\titlepage}

\section{指令调度}
\begin{frame}
\frametitle{执行程序:步骤}
\begin{itemize}
\item 启动 MIPSsim。
\item 用 MIPSsim 的 ``文件'' $\rightarrow$ ``载入程序'' 选项来加载 \code{schedule.s}(在模拟器所在文件夹下的“样例程序”文件夹中)。
\item 关闭定向功能,这是通过 ``配置'' $\rightarrow$ ``定向'' 选项来实现的。
\item 执行所载入的程序,通过查看统计数据和时钟周期图,找出并记录程序执行过程中各种冲突发生的次数,发生冲突的指令组合以及程序执行的总时钟周期数。
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\begin{itemize}
\item 总执行周期:33
\item RAW停顿:16 占周期总数的百分比:48.48485\%
\\ 其中:load停顿:6 占所有RAW停顿的百分比:37.5\%
\item WAW停顿:0 占周期总数的百分比:0\%
\item 结构停顿:0 占周期总数的百分比:0\%
\item 控制停顿:0 占周期总数的百分比:0\%
\item 自陷停顿:1 占周期总数的百分比:3.030303\%
\item 停顿周期总数:17 占周期总数的百分比:51.51515\%
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{fig/schedule.png}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\begin{itemize}
\item ADDIU \$1, \$0, 56 和 LW \$r2,0(\$r1)
\item LW \$r2,0(\$r1) 和 ADD \$r4,\$r0,\$r2
\item ADD \$r4,\$r0,\$r2 和 SW \$r4,0(\$r1)
\item LW \$r6,4(\$r1) 和 ADD \$r8,\$r6,\$r1
\item MUL \$r12,\$r10,\$r1 和 ADD \$r16,\$r12,\$r1
\item ADD \$r16,\$r12,\$r1 和 ADD \$r18,\$r16,\$r1
\item ADD \$r18,\$r16,\$r1 和 SW \$r18,16(\$r1)
\item MUL \$r22,\$r20,\$r14 和 MUL \$r24,\$r26,\$r14
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{静态调度}
\centering 核心思路:在不改变程序运行结果的情况下,尽可能将不相关的指令安插在由冲突的指令中间
\end{frame}

\begin{frame}[fragile]
\frametitle{静态调度:原始程序}
\begin{lstlisting}
.text
main:
ADDIU $r1,$r0,A
LW $r2,0($r1)
ADD $r4,$r0,$r2
SW $r4,0($r1)
LW $r6,4($r1)
ADD $r8,$r6,$r1
MUL $r12,$r10,$r1
ADD $r16,$r12,$r1
ADD $r18,$r16,$r1
SW $r18,16($r1)
LW $r20,8($r1)
MUL $r22,$r20,$r14
MUL $r24,$r26,$r14
TEQ $r0,$r0
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{静态调度:调度结果}
\begin{lstlisting}
.text
main:
ADDIU $r1,$r0,A
MUL $r24,$r26,$r14
LW $r2,0($r1)
MUL $r12,$r10,$r1
LW $r6,4($r1)
ADD $r4,$r0,$r2
ADD $r16,$r12,$r1
LW $r20,8($r1)
SW $r4,0($r1)
ADD $r18,$r16,$r1
ADD $r8,$r6,$r1
MUL $r22,$r20,$r14
SW $r18,16($r1)
TEQ $r0,$r0
\end{lstlisting}
\end{frame}

\begin{frame}
\frametitle{静态调度:统计数据}
\begin{itemize}
\item 总执行周期:18
\item RAW停顿:1 占周期总数的百分比:5.555555\%
\\ 其中:load停顿:0 占所有RAW停顿的百分比:0\%
\item WAW停顿:0 占周期总数的百分比:0\%
\item 结构停顿:0 占周期总数的百分比:0\%
\item 控制停顿:0 占周期总数的百分比:0\%
\item 自陷停顿:1 占周期总数的百分比:5.555555\%
\item 停顿周期总数:2 占周期总数的百分比:11.11111\%
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{静态调度:统计数据}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{fig/after-schedule.png}
\end{figure}
\end{frame}

\section{延迟分支}
\begin{frame}
\frametitle{执行程序:步骤}
\begin{itemize}
\item 在 MIPSsim 中载入 \code{branch.s} 样例程序(在本模拟器目录的“样例程序”文件夹中。
\item 关闭延迟分支功能。这是通过在“配置” $\rightarrow$ “延迟槽”选项来实现的。
\item 执行该程序,观察并记录发生分支延迟的时刻,记录该程序执行的总时钟周期数。
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\centering 总执行周期:38

\centering 第 14,29 周期发生了分支延迟
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{fig/branch.png}
\end{figure}
\end{frame}

\begin{frame}[fragile]
\frametitle{指令调度:原始程序}
\begin{lstlisting}
.text
main:
ADDI $r2,$r0,1024
ADD $r3,$r0,$r0
ADDI $r4,$r0,8
loop:
LW $r1,0($r2)
ADDI $r1,$r1,1
SW $r1,0($r2)
ADDI $r3,$r3,4
SUB $r5,$r4,$r3
BGTZ $r5,loop
ADD $r7,$r0,$r6
TEQ $r0,$r0
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{指令调度:调度结果}
\begin{lstlisting}
.text
main:
ADDI $r2,$r0,1024
ADD $r3,$r0,$r0
ADDI $r4,$r0,8
LW $r1,0($r2)
loop:
ADDI $r1,$r1,1
ADDI $r3,$r3,4
SUB $r5,$r4,$r3
SW $r1,0($r2)
BGTZ $r5,loop
LW $r1,0($r2)

ADD $r7,$r0,$r6
TEQ $r0,$r0
\end{lstlisting}
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\centering 总执行周期:31
\end{frame}

\begin{frame}
\frametitle{执行程序:统计数据}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{fig/delayed-branch.png}
\end{figure}
\end{frame}

\begin{frame}
\begin{center}
\Huge Thank You
\end{center}
\end{frame}

\end{document}
19 changes: 19 additions & 0 deletions CAWithFuckingBUPTCharacteristics/Lab5/slide.vrb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\frametitle{指令调度:调度结果}
\begin{lstlisting}
.text
main:
ADDI $r2,$r0,1024
ADD $r3,$r0,$r0
ADDI $r4,$r0,8
LW $r1,0($r2)
loop:
ADDI $r1,$r1,1
ADDI $r3,$r3,4
SUB $r5,$r4,$r3
SW $r1,0($r2)
BGTZ $r5,loop
LW $r1,0($r2)

ADD $r7,$r0,$r6
TEQ $r0,$r0
\end{lstlisting}
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
9 changes: 9 additions & 0 deletions InfoKnow/Homework2/src/data/001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Man Utd stroll to Cup win

Wayne Rooney made a winning return to Everton as Manchester United cruised into the FA Cup quarter-finals.

Rooney received a hostile reception, but goals in each half from Quinton Fortune and Cristiano Ronaldo silenced the jeers at Goodison Park. Fortune headed home after 23 minutes before Ronaldo scored when Nigel Martyn parried Paul Scholes' free-kick. Marcus Bent missed Everton's best chance when Roy Carroll, who was later struck by a missile, saved at his feet.

Rooney's return was always going to be a potential flashpoint, and he was involved in an angry exchange with a spectator even before kick-off. And Rooney's every touch was met with a deafening chorus of jeers from the crowd that once idolised the 19-year-old. Everton started brightly and Fortune needed to be alert to scramble away a header from Bent near the goal-line. But that was the cue for United to take complete control with a supreme passing display on a Goodison Park pitch that was cutting up. Fortune gave United the lead after 23 minutes, rising to meet Ronaldo's cross from eight yards after the Portuguese youngster had been allowed too much time and space by the hapless Gary Naysmith. United dominated without creating too many clear-cut chances, and they almost paid the price for not making the most of their domination two minutes before half-time. Mikel Arteta played a superb ball into the area but Bent, played onside by Gabriel Heintze, hesitated and Carroll plunged at his fee to save. United almost doubled their lead after 48 minutes when Ronaldo's low drive from 25 yards took a deflection off Tony Hibbert, but Martyn dived to save brilliantly. And Martyn came to Everton's rescue three minutes later when Rooney's big moment almost arrived as he raced clean through, but once again the veteran keeper was in outstanding form. But there was nothing Martyn could do when United doubled their lead after 57 minutes as they doubled their advantage. Scholes' free-kick took a deflection, and Martyn could only parry the ball out for Ronaldo, who reacted first to score easily. Everton's problems worsened when James McFadden limped off with an injury. And there may be further trouble ahead for Everton after goalkeeper Carroll required treatment after he was struck on the head by a missile thrown from behind the goal. Rooney's desperate search for a goal on his return to Everton was halted again by Martyn in injury-time when he outpaced Stubbs, but once again Martyn denied the England striker.

- Manchester United coach Sir Alex Ferguson: "It was a fantastic performance by us. In fairness I think Everton have missed a couple of players and got some young players out. "The boy Ronaldo is a fantastic player. He's persistent and never gives in. "I don't know how many fouls he had He gets up and wants the ball again, he's truly a fabulous player." Everton: Martyn, Hibbert, Yobo, Stubbs, Naysmith, Osman, Carsley, Arteta, Kilbane, McFadden, Bent. Subs: Wright, Pistone, Weir, Plessis, Vaughan. Manchester United: Carroll, Gary Neville, Brown, Ferdinand, Heinze, Ronaldo, Phil Neville, Keane, Scholes, Fortune, Rooney. Subs: Howard, Giggs, Smith, Miller, Spector. Referee: R Styles (Hampshire)
5 changes: 5 additions & 0 deletions InfoKnow/Homework2/src/data/002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Van Nistelrooy set to return

Manchester United striker Ruud van Nistelrooy may make his comeback after an Achilles tendon injury in the FA Cup fifth round tie at Everton on Saturday.

He has been out of action for nearly three months and had targeted a return in the Champions League tie with AC Milan on 23 February. But Manchester United manager Sir Alex Ferguson hinted he may be back early. He said: "There is a chance he could be involved at Everton but we'll just have to see how he comes through training." The 28-year-old has been training in Holland and Ferguson said: "Ruud comes back on Tuesday and we need to assess how far on he is. "The training he has been doing in Holland has been perfect and I am very satisfied with it." Even without Van Nistelrooy, United made it 13 wins in 15 league games with a 2-0 derby victory at Manchester City on Sunday. But they will be boosted by the return of the Dutch international, who is the club's top scorer this season with 12 goals. He has not played since aggravating the injury in the 3-0 win against West Brom on 27 November. Ferguson was unhappy with Van Nistelrooy for not revealing he was carrying an injury. United have also been hit by injuries to both Alan Smith and Louis Saha during Van Nistelrooy's absence, meaning Wayne Rooney has sometimes had to play in a lone role up front. The teenager has responded with six goals in nine games, including the first goal against City on Sunday.
9 changes: 9 additions & 0 deletions InfoKnow/Homework2/src/data/003.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Moyes U-turn on Beattie dismissal

Everton manager David Moyes will discipline striker James Beattie after all for his headbutt on Chelsea defender William Gallas.

The Scot initially defended Beattie, whose dismissal put Everton on the back foot in a game they ultimately lost 1-0, saying Gallas overreacted. But he has had a rethink after looking over the video evidence again. He said: "I believe that I should set the record straight by conceding that the dismissal was right and correct." Moyes added: "My comments on Saturday came immediately after the final whistle and at a point when I had only had the opportunity to see one, very quick re-run of the incident."

The club website also reported that Beattie, who seemed unrepentant after Saturday's match, insisting Gallas "would have stayed down a lot longer" if he had headbutted him, has now apologised. Moyes continued: "Although the incident was totally out of character - James has never even been suspended before in his career - his actions were unacceptable and had a detrimental effect on his team-mates. "James did issue a formal apology to myself, his team-mates and to the Everton supporters immediately after the game and that was the right thing to have done. He will now be subjected to the normal club discipline. "He is a competitive player but a fair player and I know how upset he is by what has happened. However, I must say that I do still believe the Chelsea player in question did go down too easily." Speaking immediately after the game, Moyes said: "I don't think it was a sending-off, I have been a centre-half in my time and I would have been ashamed to have gone down as easily as that.

"Not in a million years would John Terry have gone down in the same way. I have never heard of anybody butting somebody from behind while you are running after them. "What has happened to big, strong centre-halves? I thought it was a push initially and I still don't think it was a sending-off." An angry Beattie initially said: "He (Gallas) would have stayed down a lot longer if I had headbutted him. "I can tell you it wasn't an intentional headbutt. We were chasing a ball into the corner and William Gallas was looking over his shoulder and blocking me off. "He was stopping as we were running and I said to myself 'if you're going to stay in my way I'll go straight over you'. Our heads barely touched and it wasn't an intentional headbutt."
7 changes: 7 additions & 0 deletions InfoKnow/Homework2/src/data/004.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Ronaldo considering new contract

Manchester United winger Cristiano Ronaldo said he is close to agreeing to a new contract at Old Trafford.

The Portugal star, who joined in August 2003 on a five-year-deal, is a regular in the United first-team. "The United board have already made an offer to renew the contract but I'm trying not to think about it," he told the News of the World. "My agent has spoken with the club and it will be resolved soon. I think we'll reach a good agreement for both sides." Ronaldo refused to commit his long-term future to the club.

"Nobody knows what will come tomorrow. I like being here, but who knows," he added. "There aren't many bigger and better clubs than this one. It's my ambition to be at a big club. I'm happy but nobody knows the future."
5 changes: 5 additions & 0 deletions InfoKnow/Homework2/src/data/005.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Smith keen on Home series return

Scotland manager Walter Smith has given his backing to the reinstatement of the Home International series.

Such a plan is to be proposed by the new chief executive of the Northern Irish FA, Howard Wells, at the next meeting of the four home countries. The English FA has expressed doubt as to whether the fixtures could be accommodated at the end of each season. But Smith said: "Bringing it back would add meaning to friendly games and that's something that's needed." The Home International series was done away with in 1984, with the traditional Scotland-England fixture continuing until 1989. That game is one Smith would be delighted to see reinstated. "The Scotland v England match was a highlight of the end of the season," he added. "I was in Italy for their friendly with Russia last week and they made seven substitutions while only around 20,000 fans turned up to watch. "England were criticised for the 0-0 draw against Holland - the way Scotland were slammed in the past for poor results in friendlies. "You have to put a performance on in friendly games. If you don't, they can be de-motivating. "It can be a dangerous road to go down, if players don't apply themselves in the manner they should. "So I would support the return of the home internationals - the only problem would be fitting them in to the fixture schedule."
5 changes: 5 additions & 0 deletions InfoKnow/Homework2/src/data/006.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Mido makes third apology

Ahmed 'Mido' Hossam has made another apology to the Egyptian people in an attempt to rejoin the national team.

The 21-year-old told a news conference in Cairo on Sunday that he is sorry for the problems that have led to his exclusion from the Pharaohs since July last year. Mido said: "There isn't much I have to say today, all there is to say is that I came specially from England to Egypt to rejoin the national team and to apologise for all my mistakes." Mido was axed by former coach Marco Tardelli after failing to answer a national call-up, claiming he had a groin injury. But he then played in a friendly for his club AS Roma within 24 hours of a World Cup qualifying match at home to Cameroon last September. Mido added: "It's not my right to give orders and say when I want to play ... at the same time I will always make sure that I put the national's team's matches as my top priority. "I feel that the national players are playing with a new spirit as I saw them play against Belgium (Egypt won 4-0 on Wednesday) and I simply want to add to their success. "I do confess that I was rude to the Egyptian press at times but now I have gained more experience and know that I will never go anywhere without the press's support. "Many of the international stars like David Beckham and (Zinedine) Zidane had the press opposing them. "So I'm now used to the fact that the press can be against me at times and I don't have to overreact when this happens. Meanwhile, Egypt FA spokesman Methat Shalaby welcomed the apology and said no one had exerted pressure on Mido to apologise. "Mido's apology today does not negatively affect Mido in anyway, on the contrary it makes him a bigger star and a role model for all football players," Shalaby said. Shalaby earlier said that after an apology Mido would be available for the national side if coach Hassan Shehata chose him. Mido joined Tottenham in an 18-month loan deal near the end of the January transfer window, scoring twice on his debut against Portsmouth.
Loading

0 comments on commit 9b8e763

Please sign in to comment.