⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.h

📁 计算机系统结构的讲义,浓缩了一本一千多页的书.真的是好东西.
💻 H
📖 第 1 页 / 共 5 页
字号:
* The file loader of dlxview is completely inherited from DLXsim, and this\n\help session is directly copied from the DLXsim user's manual.\n\}\n\}\n\   ";char HelpInitFormat_tcl[] = "\proc HelpInitFormat {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpInitFormat]\n\  $t delete 1.0 end\n\HelpIn help_black {\n\Two types of register initialization commands exist.  The first type\n\is used to initialize integer registers, and the second type is used to \n\initialize floating point registers. \n\} \n\HelpIn help_black {\n\For register designators, any of\n\the names \"r0\" through \"r31\" and \"f0\" through \"f31\" may be used.  The names \n\\"$0\" through \"$31\"  may also be used (instead of \"r0\" through \"r31\"), \n\however, it is safer to use \"r\" instead of \"$\" to avoid the confusion with\n\Tcl variables.  The name \"pc\" may be used to refer to the program counter.\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_italic {put }\n\HelpIn help_black {reg number\n\           Store number in the register given by reg.  To store floating\n\           point numbers (single or double precision), use the }\n\HelpIn help_italic {fput }\n\HelpIn help_black {command.\n\}\n\HelpIn help_italic {fput } \n\HelpIn help_black {reg number [precision]\n\           Store number in the register given by reg.  If precision is }\n\HelpIn help_italic {d, }\n\HelpIn help_black {\n\           the number is stored a double precision floating point number (in\n\           two words).  If precision is }\n\ \n\HelpIn help_italic {f, }\n\HelpIn help_black { or no precision is given, \n\           the number is stored as a single precision floating point number.\n\}\n\}\n\   ";char HelpInputSample_tcl[] = "\proc HelpInputSample {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpInputSample]\n\  $t delete 1.0 end\n\HelpIn help_black {\n\f347.s }\n\HelpIn help_green {\n\LL:ld      f2, 0(r1)\n\   multd   f4, f2, f0\n\   ld      f6, 0(r2)\n\   addd    f6, f4, f6\n\   sd      0(r2), f6\n\   addi    r1, r1, 8\n\   addi    r2, r2, 8\n\   sgti    r3, r1, done\n\   beqz    r3, LL\n\   nop\n\   trap    #0\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_black {\n\f347.i }\n\HelpIn help_green {\n\   put     r1      0x1000\n\   put     r2      0x2000\n\   fput    f0      3.14    d\n\}\n\HelpIn help_black {\n\f347.d }\n\HelpIn help_green {\n\   .data   0x1000\n\   .double 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09 \n\   .double 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 \n\   .double 1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27, 1.28, 1.29 \n\   .double 1.30, 1.31, 1.32, 1.33, 1.34, 1.35, 1.36, 1.37, 1.38, 1.39 \n\   .double 1.40, 1.41, 1.42, 1.43, 1.44, 1.45, 1.46, 1.47, 1.48, 1.49 \n\   .double 1.50, 1.51, 1.52, 1.53, 1.54, 1.55, 1.56, 1.57, 1.58, 1.59 \n\   .double 1.60, 1.61, 1.62, 1.63, 1.64, 1.65, 1.66, 1.67, 1.68, 1.69 \n\   .double 1.70, 1.71, 1.72, 1.73, 1.74, 1.75, 1.76, 1.77, 1.78, 1.79 \n\   .double 1.80, 1.81, 1.82, 1.83, 1.84, 1.85, 1.86, 1.87, 1.88, 1.89 \n\   .double 1.90, 1.91, 1.92, 1.93, 1.94, 1.95, 1.96, 1.97, 1.98, 1.99 \n\   .global done\n\   done:    .double 0\n\}\n\HelpIn help_black {\n\}\n\HelpIn help_green {\n\   .data   0x2000\n\   .double 2.00, 2.01, 2.02, 2.03, 2.04, 2.05, 2.06, 2.07, 2.08, 2.09 \n\   .double 2.10, 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18, 2.19 \n\   .double 2.20, 2.21, 2.22, 2.23, 2.24, 2.25, 2.26, 2.27, 2.28, 2.29 \n\   .double 2.30, 2.31, 2.32, 2.33, 2.34, 2.35, 2.36, 2.37, 2.38, 2.39 \n\   .double 2.40, 2.41, 2.42, 2.43, 2.44, 2.45, 2.46, 2.47, 2.48, 2.49 \n\   .double 2.50, 2.51, 2.52, 2.53, 2.54, 2.55, 2.56, 2.57, 2.58, 2.59 \n\   .double 2.60, 2.61, 2.62, 2.63, 2.64, 2.65, 2.66, 2.67, 2.68, 2.69 \n\   .double 2.70, 2.71, 2.72, 2.73, 2.74, 2.75, 2.76, 2.77, 2.78, 2.79 \n\   .double 2.80, 2.81, 2.82, 2.83, 2.84, 2.85, 2.86, 2.87, 2.88, 2.89 \n\   .double 2.90, 2.91, 2.92, 2.93, 2.94, 2.95, 2.96, 2.97, 2.98, 2.99 \n\}\n\}\n\   ";char HelpMode_tcl[] = "\proc HelpMode {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpMode]\n\  $t delete 1.0 end\n\HelpIn HelpBasicPipe {\n\1. Basic Pipelie.\n\}\n\HelpIn HelpTomasulo {\n\2. Tomasulo Algorithm.\n\}\n\HelpIn HelpScoreBoard {\n\3. Scoreboarding.\n\}\n\}\n\   ";char HelpBasicPipe_tcl[] = "\proc HelpBasicPipe {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpBasicPipe]\n\  $t delete 1.0 end\n\HelpIn help_black { \n\In the visualization window for the basic\n\pipeline, the top half is a instruction and clock cycle table, and the\n\bottom half can be switched between the block diagram of the DLX\n\pipeline (see Figure 3.44 in the textbook) and the datapath of the }\n\HelpIn help_italic {\n\integer }\n\HelpIn help_black {unit (see Figure 3.22 in the textbook).  Each instruction \n\entering the pipeline is assigned a unique color, which matches\n\between the top half and bottom half of the visualization window.  The\n\window exhibits the pipeline state for one particular clock cycle. This \n\clock cycle number is displayed at the lower-right conner of the \n\visualization window, and is also highlighted by a gray strip in the clock \n\cycle table.\n\}\n\HelpIn help_black { \n\The instruction and clock cycle table is capable to display the latest\n\five instruction simulated by dlxview, with the last row showing the\n\newest instruction entering the pipeline.  From the highlighted gray\n\strip, you can determine which instruction is in which pipeline stage.\n\There might be more than five instructions staying in the pipeline at\n\a time, however, the earlier instructions are wrapped off in this\n\table.  If you want to find exactly how many instructions are in the\n\pipeline at present, check the number of colored boxes in the bottom\n\pipeline block diagram.\n\}\n\HelpIn help_black {\n\In the pipeline block diagram, if a floating point functional unit is\n\fully pipelined, the EX pipe stages for this functional unit will be\n\drawn as separated boxes.  On the other hand, the multicycle EX stage\n\of a unpipelined floating point unit is shown as a long box with\n\internal lines.  The block diagram as a whole is also convenient in\n\figuring out which instruction is at which pipeline stage.  For a\n\pipeline that supports multiple outstanding FP operations, there might\n\be multiple instructions entering the MEM or WB stage simultaneously.\n\(It can be proved that for the particular DLX machine described in the\n\section 3.7 of the Hennessy and Patterson textbook, at most two\n\instructions will go to MEM or WB stage at the same time.  Exercise\n\for you?)  In this case, multiple colors will occupy MEM and WB boxes\n\(they should be split in a real implementation).\n\}\n\HelpIn help_black {\n\As said by its name, the integer datapath is only responsible for\n\showing you what is happening in the integer datapath.  Nevertheless,\n\floating point operations are exhibited here also when they are in the\n\IF and ID stages.  At a particular clock cycle, there might be some\n\floating point instruction in execution or writing their results back\n\to the register file, don't be surprise if you can not find them in\n\the integer datapath!\n\}  \n\HelpIn help_black {\n\When a mux is used in operand selecting, the line connecting the\n\output and the selected input will tell you where does the operand come\n\from.  For example, by examining the muxes before ALU, you can\n\determine whether operands come from the register file, the forwarding\n\path, or the immediate number stored in the ID/EX stage-register.  If\n\an operand is forwarded, it is also easy to trace back to the source\n\of forwarding from the highlighted wires.\n\}\n\HelpIn help_black {\n\The following is a brief description of the features of the DLX\n\pipeline defined in the textbook that are supported by dlxview.\n\1. Instructions are fetched and decoded sequentially. \n\2. Multiple floating point functional units, either fully pipelined or not,\n\   can be configured to your processor. However, only one integer unit\n\   is allowed.  \n\3. Branches are solved at the ID stage. There is one branch delay slot\n\   after the branch instruciton, and branch penalties are reduced by the \n\   delayed-branch scheme.   It is up to the compiler or user, whoever \n\   provides the DLX code, to make sure the successor instruction of a branch \n\   is valid and useful.  If no useful instructions can be found, a \"nop\" \n\   instruction should be inserted after the branch in your assembly code. \n\4. There is only one write port to the FP register file.\n\5. Four kinds of checking are accomplished by the ID stage:\n\   a) Structural hazard checking:\n\   b) WAR hazard checking.\n\   c) WAW hazard checking.\n\   d) FP register file write port conflict checking. \n\}\n\HelpIn help_black {\n\The moving of branch handling logic from MEM stage to ID stage might\n\cause some additional stalls in the pipeline due to data dependence.\n\In other words, \"load stall\" is not the only type of data hazard\n\leading to a  stall for DLX pipeline, as stated by the textbook.  Since this\n\hazard is not discussed in the textbook, the implementation used in\n\dlxview is briefly listed here. You can view the hazard by writing a\n\proper sequence of code and testing it with dlxview.  \n\1. If the operand of a branch is generated by the immediate previous\n\   integer ALU instruction, the pipeline will stall for one cycle. After\n\   that, the operand is forwarded from the EX/MEM stage-register. The stall \n\   might last longer for FP branches in this case, depending on the latency \n\   of FP instruction.  Same arguments applies to the following discussion.\n\2. If the  operand of a branch is generated by the immediate previous\n\   load instruction,  the pipeline will stall for two cycle. After\n\   that, the operand is forwarded from the MEM/WB stage-register.\n\3. If the  operand of a branch is generated by the second immediate previous\n\   load instruction,  the pipeline will stall for one cycle. After\n\   that, the operand is forwarded from the MEM/WB stage-register.\n\}\n\}\n\   ";char HelpTomasulo_tcl[] = "\proc HelpTomasulo {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpTomasulo]\n\  HelpPackCanvas \n\  $t delete 1.0 end\n\  $t insert 0.0 {\n\To be added ...\n\  }\n\}\n\   ";char HelpScoreBoard_tcl[] = "\proc HelpScoreBoard {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpScoreboard]\n\  HelpPackCanvas \n\  $t delete 1.0 end\n\  $t insert 0.0 {\n\To be added ...\n\  }\n\}\n\   ";char HelpMisc_tcl[] = "\proc HelpMisc {{t .help.text.t}} {\n\  global help_cmd_stack\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  set help_cmd_stack [linsert $help_cmd_stack 0 HelpScoreMisc]\n\  $t delete 1.0 end\n\  $t insert 0.0 {\n\To be added ...\n\  }\n\}\n\   ";char HelpOk_tcl[] = "\proc HelpOk {{w .help}} {\n\  global help_cmd_stack\n\  if {[llength $help_cmd_stack] > \"1\"} {\n\    set last_command [lindex $help_cmd_stack 1]\n\    set help_cmd_stack [lrange $help_cmd_stack 2 end]\n\    pack forget $w.c\n\    $w.text.t configure -height 40\n\    $last_command\n\  }\n\}\n\   ";char HelpPackCanvas_tcl[] = "\proc HelpPackCanvas {{w .help}} {\n\  pack forget $w.text \n\  pack forget $w.button\n\  pack $w.c $w.text $w.button \\\n\    -side top \\\n\    -fill x \\\n\    -expand yes\n\  $w.text.t configure -height 23\n\}\n\   ";char HelpIn_tcl[] = "\proc HelpIn {newtags text} {\n\  global help_magenta help_magenta help_blue help_green help_black help_italic\n\  global help_section help_title\n\set help_title\n\  set w .help.text.t\n\  set start [$w index insert]\n\  $w insert insert $text\n\  foreach tag [$w tag names $start] {\n\    $w tag remove $tag $start insert\n\  }\n\  foreach i $newtags {\n\    $w tag add $i $start insert\n\    if {[string compare [string range $i 0 4] \"help_\"] == \"0\"} {\n\      eval $w tag configure $i [set $i]\n\    } else {\n\      eval $w tag configure $i $help_blue\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -