?? mainpage.html
字號:
<!--
---- Opening help page for PathSim
---->
<html>
<head>
<LINK HREF="../pathsim.css" REL="stylesheet" type="text/css">
<title>About PathSim - Main page</title>
</head>
<body>
<div class="pageHead">
<a name="Welcome">Welcome to PathSim</a>
</div>
<div class="normalText centeredText">
PathSim is a simulator for the simple data path discussed in sections 5.1 - 5.4 of<br>
Computer Organization and Design, 3rd ed.,<br>
by David A. Patterson and John L. Hennessy<br>
Morgan Kaufmann Publishers, 2005<br><br>
The simulator consists of html with embedded javascript and java and, therefore,<br>
is executed from a web page browser (it has been verified for Internet Explorer 6.0, Netscape 7.2 and
Firefox 1.0.4).<br>
The simulator was constructed by<br>
Dr. Dalton R. Hunkins<br>
<a href="mailto:hunkins@cs.sbu.edu?subject=PathSim">hunkins@cs.sbu.edu</a><br>
Computer Science Department<br>
St. Bonaventure University<br><br>
</div>
<center>
<img src="pathsim.jpg">
</center>
<div class="normalText">
As seen in the above image, PathSim is composed basically of four areas:
the architecture schematic shown in the upper-lefthand panel, Instruction Input and Memory,
Data Input and Memory, and Register Input and listing. Each of these is discussed
in the following sections.
</div>
<div class="sectionHead">
<a name="Architecture">The Architecture Schematic</a>
</div>
<div class="normalText noPadding">
The diagram of the architecture is basically that shown in Computer Organization and Design, 3rd ed., figure 5.24, page 314.
The diagram given here is interactive. You can single-step through execution of mips instructions by left-clicking on the
cyan rectangle labeled PC -- one instruction per click. The instructions being executed are those written in the Instruction
Input box and successfully assembled. Also, the assembled instruction appearing in Instruction Memory area that was just
executed is highlighted in cyan. You can see the effect of an instruction on the data path by placing the mouse over a
data line and left-clicking. In doing so, a white box pops up displaying the current value on that data line.
</div>
<div class="sectionHead">
<a name="Instruction">Instruction Input and Memory</a>
</div>
<div class="normalText noPadding">
The assembly code you plan to execute is written into the Instruction Input box. Text-editing can be done within this text-area but
you might find it more convenient to create your code in a plain-text editing tool apart from the simulator and copy-paste the code
into the text-area. In this way, you can save your code to a file (the Instruction Input box does not provide for opening nor
saving a file). There are two buttons appearing in the panel, namely, "Assemble" and "Reset Machine."<br><br>
Pressing the Assemble button invokes the PathSim assembler, which, in turn, assembles the code appearing in the text-area. If the
assembler should find an error according to its syntax, an alert box appears showing the "offending" line
of code and the error. The PathSim assembler is a "first-error-and-out" assembler. This means you must fix an error and
assemble the edited code before proceeding to the next error, if any. When your assembly code is error free, an alert box
appears stating in essence that the code assembled and loaded successfully. The machine instructions that are assembled from
your code are displayed in the Instruction Memory area.<br><br>
Pressing the Reset Machine button resets the program counter (PC) to 0 and resets the particular data addresses and registers to what
was last loaded; all others are reset to zero. This means that it is not necessary to re-load these using their respective load buttons.
If no values were previously loaded, then all data addresses and registers are reset to 0.
</div>
<div class="sectionHead">
<a name="Syntax">Syntax of Assembly Code</a>
</div>
<div class="normalText noPadding">
Assembly code for PathSim does not contain any labels for branch points (e.g. loop:). Instead of labels, we use strings of hexadecimal
digits for the offset of a branch instruction and the absolute address for a jump instruction. Since these and numeric constants
for offsets in memory references (e.g., F8($t0)) can only be hexadecimal, you do not write the usual prefix "0x" before the hexadecimal
value.<br><br>
Also, do not use directives such as .text, .data, etc. In turn, storing values in data memory is done through Data Input.<br><br>
Except for these differences, the rest of the syntax for the PathSim assembler is the same as for a mips assembler (e.g. pcSpim). Last,
each line of code must be terminated with an end-of-line marker.
</div>
<div class="sectionHead">
<a name="Data">Data Input and Memory</a>
</div>
<div class="normalText noPadding">
As with the Instruction Input box, the Data Input box contains a text-area. Therefore, you can type your data values here.
But you may also want to consider using a separate plain-text editing tool and copy-paste into the text-area.<br><br>
The format for a line that is entered into the input box is memoryAddress:value. Both the memoryAddress and the value are strings
of hexadecimal digits. The string for the value must contain exactly 8 hex digits. There cannot be any spaces surrounding the
colon (:) nor any other place in the line. Also, there cannot be any empty lines (i.e., null strings terminated by an end-of-line
marker). Last, each data input line must be terminated with an end-of-line marker.<br><br>
The Data Memory area is for displaying your data values that are loaded into data memory when you press the "Load" button.<br><br>
When you step through the execution of your instructions, whenever a reference is made to a word in data memory, the word is highlighted
within the display area. If the reference is for reading, the highlight is cyan; if it is a write-reference, then the highlight is
yellow.
</div>
<div class="sectionHead">
<a name="Register">Register Input and Registers</a>
</div>
<div class="normalText noPadding">
As with the other input boxes, the Register Input box contains a text-area. Therefore, you can type your register values here. Of course,
we only need to do this when we want to initialize a register with a value other than zero (0 is the default initial value).<br><br>
The format for a line that is entered into the input box is registerNumber:value. Similar to data values, a register value is a string
of exactly 8 hexadecimal digits. On the other hand, the registerNumber must be written as a decimal (base 10) number, 0 through 31.
Also, there cannot be any spaces surrounding the colon (:) nor any other place in the line. Last, each input line must be terminated with
an end-of-line marker and there cannot be any empty lines.<br><br>
The Register list shows the register values either as initialized with zero or as loaded from the Register Input box when you press
the "Load" button.<br><br>
When you step through the execution of your instructions, whenever a reference is made to a register, the register-value is highlighted
within the display area. If the reference is for reading, the highlight is cyan; if it is a write-reference, then the highlight is
yellow.
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -