Final
This commit is contained in:
BIN
CourseDesignReport.docx
Normal file
BIN
CourseDesignReport.docx
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
<!--The data in this file is primarily intended for consumption by Xilinx tools.
|
<!--The data in this file is primarily intended for consumption by Xilinx tools.
|
||||||
The structure and the elements are likely to change over the next few releases.
|
The structure and the elements are likely to change over the next few releases.
|
||||||
This means code written to parse this file will need to be revisited each subsequent release.-->
|
This means code written to parse this file will need to be revisited each subsequent release.-->
|
||||||
<application name="pa" timeStamp="Wed Jun 18 12:07:36 2025">
|
<application name="pa" timeStamp="Fri Jun 20 17:48:38 2025">
|
||||||
<section name="Project Information" visible="false">
|
<section name="Project Information" visible="false">
|
||||||
<property name="ProjectID" value="bf8c3145fb1f463a9279744865a6650a" type="ProjectID"/>
|
<property name="ProjectID" value="bf8c3145fb1f463a9279744865a6650a" type="ProjectID"/>
|
||||||
<property name="ProjectIteration" value="1" type="ProjectIteration"/>
|
<property name="ProjectIteration" value="1" type="ProjectIteration"/>
|
||||||
@@ -17,81 +17,93 @@ This means code written to parse this file will need to be revisited each subseq
|
|||||||
<property name="ImplStrategy" value="Vivado Implementation Defaults" type="ImplStrategy"/>
|
<property name="ImplStrategy" value="Vivado Implementation Defaults" type="ImplStrategy"/>
|
||||||
</item>
|
</item>
|
||||||
<item name="Java Command Handlers">
|
<item name="Java Command Handlers">
|
||||||
<property name="AddSources" value="2" type="JavaHandler"/>
|
<property name="AddSources" value="4" type="JavaHandler"/>
|
||||||
|
<property name="EditDelete" value="1" type="JavaHandler"/>
|
||||||
<property name="NewProject" value="1" type="JavaHandler"/>
|
<property name="NewProject" value="1" type="JavaHandler"/>
|
||||||
<property name="OpenProject" value="2" type="JavaHandler"/>
|
<property name="OpenProject" value="2" type="JavaHandler"/>
|
||||||
<property name="RunSchematic" value="6" type="JavaHandler"/>
|
<property name="RunSchematic" value="29" type="JavaHandler"/>
|
||||||
<property name="SetTopNode" value="1" type="JavaHandler"/>
|
<property name="SetTopNode" value="3" type="JavaHandler"/>
|
||||||
<property name="ShowSource" value="1" type="JavaHandler"/>
|
<property name="ShowSource" value="4" type="JavaHandler"/>
|
||||||
<property name="SimulationRun" value="7" type="JavaHandler"/>
|
<property name="SimulationRun" value="8" type="JavaHandler"/>
|
||||||
<property name="ToolsSettings" value="1" type="JavaHandler"/>
|
<property name="ToolsSettings" value="1" type="JavaHandler"/>
|
||||||
<property name="ViewTaskRTLAnalysis" value="2" type="JavaHandler"/>
|
<property name="ViewTaskRTLAnalysis" value="3" type="JavaHandler"/>
|
||||||
<property name="ZoomFit" value="7" type="JavaHandler"/>
|
<property name="ZoomFit" value="21" type="JavaHandler"/>
|
||||||
<property name="ZoomIn" value="13" type="JavaHandler"/>
|
<property name="ZoomIn" value="16" type="JavaHandler"/>
|
||||||
<property name="ZoomOut" value="24" type="JavaHandler"/>
|
<property name="ZoomOut" value="26" type="JavaHandler"/>
|
||||||
</item>
|
</item>
|
||||||
<item name="Gui Handlers">
|
<item name="Gui Handlers">
|
||||||
<property name="AbstractCombinedPanel_REMOVE_SELECTED_ELEMENTS" value="1" type="GuiHandlerData"/>
|
<property name="AbstractCombinedPanel_REMOVE_SELECTED_ELEMENTS" value="1" type="GuiHandlerData"/>
|
||||||
<property name="AbstractFileView_RELOAD" value="2" type="GuiHandlerData"/>
|
<property name="AbstractFileView_RELOAD" value="2" type="GuiHandlerData"/>
|
||||||
<property name="AddSrcWizard_SPECIFY_SIMULATION_SPECIFIC_HDL_FILES" value="1" type="GuiHandlerData"/>
|
<property name="AddSrcWizard_SPECIFY_SIMULATION_SPECIFIC_HDL_FILES" value="1" type="GuiHandlerData"/>
|
||||||
<property name="BaseDialog_CANCEL" value="4" type="GuiHandlerData"/>
|
<property name="BaseDialog_CANCEL" value="6" type="GuiHandlerData"/>
|
||||||
<property name="BaseDialog_OK" value="16" type="GuiHandlerData"/>
|
<property name="BaseDialog_OK" value="34" type="GuiHandlerData"/>
|
||||||
<property name="CmdMsgDialog_MESSAGES" value="1" type="GuiHandlerData"/>
|
<property name="CmdMsgDialog_MESSAGES" value="1" type="GuiHandlerData"/>
|
||||||
<property name="CmdMsgDialog_OK" value="2" type="GuiHandlerData"/>
|
<property name="CmdMsgDialog_OK" value="5" type="GuiHandlerData"/>
|
||||||
<property name="ConfirmSaveTextEditsDialog_NO" value="1" type="GuiHandlerData"/>
|
<property name="ConfirmSaveTextEditsDialog_NO" value="1" type="GuiHandlerData"/>
|
||||||
<property name="CreateSrcFileDialog_FILE_NAME" value="10" type="GuiHandlerData"/>
|
<property name="CreateSrcFileDialog_FILE_NAME" value="10" type="GuiHandlerData"/>
|
||||||
|
<property name="DefaultOptionPane_CLOSE" value="1" type="GuiHandlerData"/>
|
||||||
<property name="FPGAChooser_FPGA_TABLE" value="1" type="GuiHandlerData"/>
|
<property name="FPGAChooser_FPGA_TABLE" value="1" type="GuiHandlerData"/>
|
||||||
<property name="FileSetPanel_FILE_SET_PANEL_TREE" value="17" type="GuiHandlerData"/>
|
<property name="FileSetPanel_FILE_SET_PANEL_TREE" value="48" type="GuiHandlerData"/>
|
||||||
<property name="FlowNavigatorTreePanel_FLOW_NAVIGATOR_TREE" value="16" type="GuiHandlerData"/>
|
<property name="FlowNavigatorTreePanel_FLOW_NAVIGATOR_TREE" value="28" type="GuiHandlerData"/>
|
||||||
<property name="GettingStartedView_CREATE_NEW_PROJECT" value="1" type="GuiHandlerData"/>
|
<property name="GettingStartedView_CREATE_NEW_PROJECT" value="1" type="GuiHandlerData"/>
|
||||||
<property name="GettingStartedView_OPEN_PROJECT" value="2" type="GuiHandlerData"/>
|
<property name="GettingStartedView_OPEN_PROJECT" value="2" type="GuiHandlerData"/>
|
||||||
<property name="GraphicalView_ZOOM_FIT" value="1" type="GuiHandlerData"/>
|
<property name="GraphicalView_ZOOM_FIT" value="3" type="GuiHandlerData"/>
|
||||||
<property name="InstanceMenu_FLOORPLANNING" value="5" type="GuiHandlerData"/>
|
<property name="InstanceMenu_FLOORPLANNING" value="27" type="GuiHandlerData"/>
|
||||||
<property name="MainMenuMgr_FLOORPLANNING" value="1" type="GuiHandlerData"/>
|
<property name="MainMenuMgr_FLOORPLANNING" value="1" type="GuiHandlerData"/>
|
||||||
<property name="MainMenuMgr_IO_PLANNING" value="1" type="GuiHandlerData"/>
|
<property name="MainMenuMgr_IO_PLANNING" value="1" type="GuiHandlerData"/>
|
||||||
<property name="MainMenuMgr_REPORTS" value="2" type="GuiHandlerData"/>
|
<property name="MainMenuMgr_REPORTS" value="2" type="GuiHandlerData"/>
|
||||||
<property name="MainMenuMgr_TOOLS" value="2" type="GuiHandlerData"/>
|
<property name="MainMenuMgr_TOOLS" value="2" type="GuiHandlerData"/>
|
||||||
<property name="MainMenuMgr_WINDOW" value="4" type="GuiHandlerData"/>
|
<property name="MainMenuMgr_WINDOW" value="4" type="GuiHandlerData"/>
|
||||||
<property name="MainWinMenuMgr_LAYOUT" value="2" type="GuiHandlerData"/>
|
<property name="MainWinMenuMgr_LAYOUT" value="2" type="GuiHandlerData"/>
|
||||||
<property name="NetlistSchMenuAndMouse_VIEW" value="5" type="GuiHandlerData"/>
|
<property name="NetlistSchMenuAndMouse_EXPAND_COLLAPSE" value="4" type="GuiHandlerData"/>
|
||||||
|
<property name="NetlistSchMenuAndMouse_VIEW" value="26" type="GuiHandlerData"/>
|
||||||
<property name="NetlistSchematicView_SHOW_CELLS_IN_THIS_SCHEMATIC" value="1" type="GuiHandlerData"/>
|
<property name="NetlistSchematicView_SHOW_CELLS_IN_THIS_SCHEMATIC" value="1" type="GuiHandlerData"/>
|
||||||
<property name="NetlistTreeView_NETLIST_TREE" value="14" type="GuiHandlerData"/>
|
<property name="NetlistTreeView_FLOORPLANNING" value="1" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_AUTO_UPDATE_HIER" value="5" type="GuiHandlerData"/>
|
<property name="NetlistTreeView_NETLIST_TREE" value="64" type="GuiHandlerData"/>
|
||||||
|
<property name="PACommandNames_ADD_SOURCES" value="2" type="GuiHandlerData"/>
|
||||||
|
<property name="PACommandNames_AUTO_UPDATE_HIER" value="16" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_EXPORT_SCHEMATIC" value="1" type="GuiHandlerData"/>
|
<property name="PACommandNames_EXPORT_SCHEMATIC" value="1" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_SCHEMATIC" value="5" type="GuiHandlerData"/>
|
<property name="PACommandNames_SCHEMATIC" value="22" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_SET_AS_TOP" value="4" type="GuiHandlerData"/>
|
<property name="PACommandNames_SET_AS_TOP" value="6" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_SIMULATION_RUN_BEHAVIORAL" value="7" type="GuiHandlerData"/>
|
<property name="PACommandNames_SIMULATION_RUN_BEHAVIORAL" value="8" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_ZOOM_FIT" value="7" type="GuiHandlerData"/>
|
<property name="PACommandNames_ZOOM_FIT" value="21" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_ZOOM_IN" value="4" type="GuiHandlerData"/>
|
<property name="PACommandNames_ZOOM_IN" value="5" type="GuiHandlerData"/>
|
||||||
<property name="PACommandNames_ZOOM_OUT" value="11" type="GuiHandlerData"/>
|
<property name="PACommandNames_ZOOM_OUT" value="13" type="GuiHandlerData"/>
|
||||||
<property name="PAViews_CODE" value="2" type="GuiHandlerData"/>
|
<property name="PAViews_CODE" value="2" type="GuiHandlerData"/>
|
||||||
<property name="PAViews_SCHEMATIC" value="2" type="GuiHandlerData"/>
|
<property name="PAViews_SCHEMATIC" value="10" type="GuiHandlerData"/>
|
||||||
<property name="PrimitivesMenu_HIGHLIGHT_LEAF_CELLS" value="10" type="GuiHandlerData"/>
|
<property name="PrimitivesMenu_HIGHLIGHT_LEAF_CELLS" value="34" type="GuiHandlerData"/>
|
||||||
<property name="ProjectNameChooser_CREATE_PROJECT_SUBDIRECTORY" value="1" type="GuiHandlerData"/>
|
<property name="ProjectNameChooser_CREATE_PROJECT_SUBDIRECTORY" value="1" type="GuiHandlerData"/>
|
||||||
<property name="ProjectNameChooser_PROJECT_NAME" value="1" type="GuiHandlerData"/>
|
<property name="ProjectNameChooser_PROJECT_NAME" value="1" type="GuiHandlerData"/>
|
||||||
|
<property name="ProjectTab_RELOAD" value="4" type="GuiHandlerData"/>
|
||||||
<property name="RDICommands_CUSTOM_COMMANDS" value="1" type="GuiHandlerData"/>
|
<property name="RDICommands_CUSTOM_COMMANDS" value="1" type="GuiHandlerData"/>
|
||||||
|
<property name="RDICommands_DELETE" value="2" type="GuiHandlerData"/>
|
||||||
<property name="RDICommands_SETTINGS" value="1" type="GuiHandlerData"/>
|
<property name="RDICommands_SETTINGS" value="1" type="GuiHandlerData"/>
|
||||||
<property name="SaveSchematicDialog_ORIENTATION" value="2" type="GuiHandlerData"/>
|
<property name="RemoveSourcesDialog_ALSO_DELETE" value="1" type="GuiHandlerData"/>
|
||||||
<property name="SchMenuAndMouse_SAVE_AS_PDF_FILE" value="2" type="GuiHandlerData"/>
|
<property name="SaveSchematicDialog_ORIENTATION" value="10" type="GuiHandlerData"/>
|
||||||
<property name="SelectMenu_HIGHLIGHT" value="6" type="GuiHandlerData"/>
|
<property name="SaveSchematicDialog_SPECIFY_OUTPUT_PDF_FILE" value="16" type="GuiHandlerData"/>
|
||||||
<property name="SelectMenu_MARK" value="5" type="GuiHandlerData"/>
|
<property name="SchMenuAndMouse_EXPAND_CONE" value="5" type="GuiHandlerData"/>
|
||||||
|
<property name="SchMenuAndMouse_SAVE_AS_PDF_FILE" value="19" type="GuiHandlerData"/>
|
||||||
|
<property name="SchOptionsView_ATTRIBUTES_TABLE" value="4" type="GuiHandlerData"/>
|
||||||
|
<property name="SchematicView_REMOVE" value="1" type="GuiHandlerData"/>
|
||||||
|
<property name="SelectMenu_HIGHLIGHT" value="30" type="GuiHandlerData"/>
|
||||||
|
<property name="SelectMenu_MARK" value="35" type="GuiHandlerData"/>
|
||||||
<property name="SettingsDialog_OPTIONS_TREE" value="1" type="GuiHandlerData"/>
|
<property name="SettingsDialog_OPTIONS_TREE" value="1" type="GuiHandlerData"/>
|
||||||
<property name="SettingsEditorPage_CUSTOM_EDITOR" value="1" type="GuiHandlerData"/>
|
<property name="SettingsEditorPage_CUSTOM_EDITOR" value="1" type="GuiHandlerData"/>
|
||||||
<property name="SettingsEditorPage_ENTER_COMMAND_LINE_FOR_CUSTOM" value="1" type="GuiHandlerData"/>
|
<property name="SettingsEditorPage_ENTER_COMMAND_LINE_FOR_CUSTOM" value="1" type="GuiHandlerData"/>
|
||||||
<property name="SimulationObjectsPanel_SIMULATION_OBJECTS_TREE_TABLE" value="2" type="GuiHandlerData"/>
|
<property name="SimulationObjectsPanel_SIMULATION_OBJECTS_TREE_TABLE" value="2" type="GuiHandlerData"/>
|
||||||
<property name="SrcChooserPanel_ADD_HDL_AND_NETLIST_FILES_TO_YOUR_PROJECT" value="1" type="GuiHandlerData"/>
|
<property name="SrcChooserPanel_ADD_HDL_AND_NETLIST_FILES_TO_YOUR_PROJECT" value="3" type="GuiHandlerData"/>
|
||||||
<property name="SrcChooserPanel_CREATE_FILE" value="10" type="GuiHandlerData"/>
|
<property name="SrcChooserPanel_CREATE_FILE" value="10" type="GuiHandlerData"/>
|
||||||
<property name="SrcChooserTable_SRC_CHOOSER_TABLE" value="3" type="GuiHandlerData"/>
|
<property name="SrcChooserTable_SRC_CHOOSER_TABLE" value="3" type="GuiHandlerData"/>
|
||||||
<property name="SrcMenu_IP_HIERARCHY" value="3" type="GuiHandlerData"/>
|
<property name="SrcMenu_IP_HIERARCHY" value="15" type="GuiHandlerData"/>
|
||||||
<property name="SyntheticaGettingStartedView_RECENT_PROJECTS" value="1" type="GuiHandlerData"/>
|
<property name="SyntheticaGettingStartedView_RECENT_PROJECTS" value="4" type="GuiHandlerData"/>
|
||||||
<property name="TclConsoleView_COPY" value="2" type="GuiHandlerData"/>
|
<property name="TclConsoleView_COPY" value="2" type="GuiHandlerData"/>
|
||||||
<property name="TclConsoleView_TCL_CONSOLE_CODE_EDITOR" value="35" type="GuiHandlerData"/>
|
<property name="TclConsoleView_TCL_CONSOLE_CODE_EDITOR" value="35" type="GuiHandlerData"/>
|
||||||
<property name="WaveformNameTree_WAVEFORM_NAME_TREE" value="4" type="GuiHandlerData"/>
|
<property name="WaveformNameTree_WAVEFORM_NAME_TREE" value="4" type="GuiHandlerData"/>
|
||||||
</item>
|
</item>
|
||||||
<item name="Other">
|
<item name="Other">
|
||||||
<property name="GuiMode" value="7" type="GuiMode"/>
|
<property name="GuiMode" value="11" type="GuiMode"/>
|
||||||
<property name="BatchMode" value="0" type="BatchMode"/>
|
<property name="BatchMode" value="0" type="BatchMode"/>
|
||||||
<property name="TclMode" value="4" type="TclMode"/>
|
<property name="TclMode" value="7" type="TclMode"/>
|
||||||
</item>
|
</item>
|
||||||
</section>
|
</section>
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
# Webtalk v2018.1 (64-bit)
|
# Webtalk v2018.1 (64-bit)
|
||||||
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
||||||
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
||||||
# Start of session at: Wed Jun 18 20:13:54 2025
|
# Start of session at: Fri Jun 20 18:50:01 2025
|
||||||
# Process ID: 21412
|
# Process ID: 32760
|
||||||
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
||||||
# Command line: wbtcv.exe -mode batch -source D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/xsim.dir/cpu_tb_snapshot/webtalk/xsim_webtalk.tcl -notrace
|
# Command line: wbtcv.exe -mode batch -source D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/xsim.dir/cpu_tb_snapshot/webtalk/xsim_webtalk.tcl -notrace
|
||||||
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/webtalk.log
|
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/webtalk.log
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
# Webtalk v2018.1 (64-bit)
|
# Webtalk v2018.1 (64-bit)
|
||||||
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
||||||
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
||||||
# Start of session at: Wed Jun 18 20:13:51 2025
|
# Start of session at: Fri Jun 20 18:49:58 2025
|
||||||
# Process ID: 30320
|
# Process ID: 28472
|
||||||
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
||||||
# Command line: wbtcv.exe -mode batch -source D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/xsim.dir/cpu_tb_snapshot/webtalk/xsim_webtalk.tcl -notrace
|
# Command line: wbtcv.exe -mode batch -source D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/xsim.dir/cpu_tb_snapshot/webtalk/xsim_webtalk.tcl -notrace
|
||||||
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/webtalk.log
|
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/webtalk.log
|
||||||
Binary file not shown.
@@ -2,8 +2,8 @@
|
|||||||
# xsim v2018.1 (64-bit)
|
# xsim v2018.1 (64-bit)
|
||||||
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
# SW Build 2188600 on Wed Apr 4 18:40:38 MDT 2018
|
||||||
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
# IP Build 2185939 on Wed Apr 4 20:55:05 MDT 2018
|
||||||
# Start of session at: Wed Jun 18 20:13:51 2025
|
# Start of session at: Fri Jun 20 18:49:58 2025
|
||||||
# Process ID: 20256
|
# Process ID: 27168
|
||||||
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
# Current directory: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim
|
||||||
# Command line: xsim.exe -log ..\..\..\..\..\simulation.log -mode tcl -source {xsim.dir/cpu_tb_snapshot/xsim_script.tcl}
|
# Command line: xsim.exe -log ..\..\..\..\..\simulation.log -mode tcl -source {xsim.dir/cpu_tb_snapshot/xsim_script.tcl}
|
||||||
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/../../../../../simulation.log
|
# Log file: D:/Schoolwork/ComputerComposition/LA32R/Hardware/LA32R.sim/sim_1/behav/xsim/../../../../../simulation.log
|
||||||
|
|||||||
@@ -31,8 +31,6 @@
|
|||||||
** - "program.hex" 的路径在 `instruction_memory.v` 模块中指定。
|
** - "program.hex" 的路径在 `instruction_memory.v` 模块中指定。
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
`timescale 1ns / 1ps
|
|
||||||
|
|
||||||
module cpu_tb;
|
module cpu_tb;
|
||||||
|
|
||||||
// --- 信号声明 ---
|
// --- 信号声明 ---
|
||||||
@@ -66,7 +64,7 @@ module cpu_tb;
|
|||||||
|
|
||||||
// 2. 设定仿真运行时间后停止
|
// 2. 设定仿真运行时间后停止
|
||||||
// 由于测试程序末尾通常是无限循环,因此需要手动设置仿真停止时间。
|
// 由于测试程序末尾通常是无限循环,因此需要手动设置仿真停止时间。
|
||||||
#500; // 仿真运行500纳秒
|
#5000; // 仿真运行5000纳秒
|
||||||
|
|
||||||
// 3. 仿真结束前,打印寄存器堆的最终状态
|
// 3. 仿真结束前,打印寄存器堆的最终状态
|
||||||
$display("\n------------------------------------------------------------");
|
$display("\n------------------------------------------------------------");
|
||||||
@@ -89,13 +87,10 @@ module cpu_tb;
|
|||||||
// 在每个时钟周期的下降沿采样并显示信息,以确保在该时刻所有待显示的信号值均已稳定。
|
// 在每个时钟周期的下降沿采样并显示信息,以确保在该时刻所有待显示的信号值均已稳定。
|
||||||
always @(negedge clk) begin
|
always @(negedge clk) begin
|
||||||
if (!rst) begin //仅在非复位状态下显示
|
if (!rst) begin //仅在非复位状态下显示
|
||||||
$display("时间: %0t ns | PC: 0x%08h | 指令: 0x%08h | R4=0x%h R5=0x%h R6=0x%h",
|
$display("时间: %0t ns | PC: 0x%08h | 指令: 0x%08h",
|
||||||
$time, // 当前仿真时间
|
$time, // 当前仿真时间
|
||||||
uut.pc_out, // PC的当前值
|
uut.pc_out, // PC的当前值
|
||||||
uut.instr, // 当前PC指向的指令
|
uut.instr // 当前PC指向的指令
|
||||||
uut.u_reg_file.registers[4], // R4寄存器的值
|
|
||||||
uut.u_reg_file.registers[5], // R5寄存器的值
|
|
||||||
uut.u_reg_file.registers[6] // R6寄存器的值
|
|
||||||
);
|
);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<Option Name="EnableBDX" Val="FALSE"/>
|
<Option Name="EnableBDX" Val="FALSE"/>
|
||||||
<Option Name="DSAVendor" Val="xilinx"/>
|
<Option Name="DSAVendor" Val="xilinx"/>
|
||||||
<Option Name="DSANumComputeUnits" Val="60"/>
|
<Option Name="DSANumComputeUnits" Val="60"/>
|
||||||
<Option Name="WTXSimLaunchSim" Val="6"/>
|
<Option Name="WTXSimLaunchSim" Val="7"/>
|
||||||
<Option Name="WTModelSimLaunchSim" Val="0"/>
|
<Option Name="WTModelSimLaunchSim" Val="0"/>
|
||||||
<Option Name="WTQuestaLaunchSim" Val="0"/>
|
<Option Name="WTQuestaLaunchSim" Val="0"/>
|
||||||
<Option Name="WTIesLaunchSim" Val="0"/>
|
<Option Name="WTIesLaunchSim" Val="0"/>
|
||||||
|
|||||||
BIN
Reference/寄存器状态.xlsx
Normal file
BIN
Reference/寄存器状态.xlsx
Normal file
Binary file not shown.
0
Reference/设计方案_修正版.md
Normal file
0
Reference/设计方案_修正版.md
Normal file
0
Reference/设计方案检查报告.md
Normal file
0
Reference/设计方案检查报告.md
Normal file
BIN
Report/Report.docx
Normal file
BIN
Report/Report.docx
Normal file
Binary file not shown.
3772
Schematic/alu.pdf
Normal file
3772
Schematic/alu.pdf
Normal file
File diff suppressed because one or more lines are too long
5711
Schematic/control_unit.pdf
Normal file
5711
Schematic/control_unit.pdf
Normal file
File diff suppressed because one or more lines are too long
4669
Schematic/cpu_top.pdf
Normal file
4669
Schematic/cpu_top.pdf
Normal file
File diff suppressed because one or more lines are too long
BIN
Schematic/data_memory.pdf
Normal file
BIN
Schematic/data_memory.pdf
Normal file
Binary file not shown.
1355
Schematic/imm_extender.pdf
Normal file
1355
Schematic/imm_extender.pdf
Normal file
File diff suppressed because one or more lines are too long
26087
Schematic/instruction_memory.pdf
Normal file
26087
Schematic/instruction_memory.pdf
Normal file
File diff suppressed because one or more lines are too long
2084
Schematic/pc.pdf
Normal file
2084
Schematic/pc.pdf
Normal file
File diff suppressed because one or more lines are too long
22280
Schematic/register_file.pdf
Normal file
22280
Schematic/register_file.pdf
Normal file
File diff suppressed because one or more lines are too long
@@ -143,7 +143,7 @@ def main():
|
|||||||
# 实际应用中,可以修改为接收命令行参数来指定输入输出文件
|
# 实际应用中,可以修改为接收命令行参数来指定输入输出文件
|
||||||
# 例如: python assembler.py input.asm output.hex
|
# 例如: python assembler.py input.asm output.hex
|
||||||
try:
|
try:
|
||||||
with open("../program.asm", "r", encoding="utf-8") as asm_file:
|
with open("../sortnum.asm", "r", encoding="utf-8") as asm_file:
|
||||||
assembly_code = asm_file.read()
|
assembly_code = asm_file.read()
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print("错误:汇编文件 '../program.asm' 未找到。请确保文件路径正确。")
|
print("错误:汇编文件 '../program.asm' 未找到。请确保文件路径正确。")
|
||||||
|
|||||||
@@ -1,21 +1,55 @@
|
|||||||
14246004
|
02816021
|
||||||
02915884
|
0280b042
|
||||||
15110005
|
02800463
|
||||||
02bffca5
|
02805884
|
||||||
00101486
|
0280dca5
|
||||||
00111487
|
0012082a
|
||||||
00121488
|
58001140
|
||||||
00129489
|
0280002b
|
||||||
0014948a
|
02800041
|
||||||
0015148b
|
02800162
|
||||||
00142d4c
|
00120c2a
|
||||||
02819001
|
58001140
|
||||||
29800024
|
0280002b
|
||||||
29801025
|
02800061
|
||||||
2880002d
|
02800163
|
||||||
2880102e
|
0012102a
|
||||||
580009a4
|
58001140
|
||||||
0280040f
|
0280002b
|
||||||
600008e6
|
02800081
|
||||||
02800410
|
02800164
|
||||||
53ffffff
|
0012142a
|
||||||
|
58001140
|
||||||
|
0280002b
|
||||||
|
028000a1
|
||||||
|
02800165
|
||||||
|
00120c4a
|
||||||
|
58001140
|
||||||
|
0280004b
|
||||||
|
02800062
|
||||||
|
02800163
|
||||||
|
0012104a
|
||||||
|
58001140
|
||||||
|
0280004b
|
||||||
|
02800082
|
||||||
|
02800164
|
||||||
|
0012144a
|
||||||
|
58001140
|
||||||
|
0280004b
|
||||||
|
028000a2
|
||||||
|
02800165
|
||||||
|
0012106a
|
||||||
|
58001140
|
||||||
|
0280006b
|
||||||
|
02800083
|
||||||
|
02800164
|
||||||
|
0012146a
|
||||||
|
58001140
|
||||||
|
0280006b
|
||||||
|
028000a3
|
||||||
|
02800165
|
||||||
|
0012148a
|
||||||
|
58001140
|
||||||
|
0280008b
|
||||||
|
028000a4
|
||||||
|
02800165
|
||||||
|
|||||||
17
numadd.asm
Normal file
17
numadd.asm
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// Add from 1 to 50
|
||||||
|
// R1 stores the result
|
||||||
|
// R2 is a counter
|
||||||
|
// By default, R1, R2 is 0
|
||||||
|
// If R2 is 50, the program ends
|
||||||
|
// If R2 is not 50, the program adds R2 to R1 and increments R2 by 1
|
||||||
|
|
||||||
|
lu12i.w $r1, 0x00000 // r1 = 0x00000000 (result)
|
||||||
|
lu12i.w $r2, 0x00000 // r2 = 0x00000000 (counter)
|
||||||
|
lu12i.w $r3, 0x00000
|
||||||
|
addi.w $r3, $r3, 0x032 // r3 = 0x00000032 (50 in decimal)
|
||||||
|
addi.w $r2, $r2, 1 // r2 = r2 + 1 (increment counter)
|
||||||
|
add.w $r1, $r1, $r2 // r1 = r1 + r2 (add counter to result)
|
||||||
|
beq $r3, $r2, 12 // If r2 = 50, branch to 'end' label
|
||||||
|
b -12 // Jump back to the beginning of the loop
|
||||||
|
// 'end:' label is here
|
||||||
|
b -4 // Infinite loop: jump to itself
|
||||||
5
program.hex
Normal file
5
program.hex
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
14000001
|
||||||
|
14000002
|
||||||
|
14000643
|
||||||
|
60000c43
|
||||||
|
02800442
|
||||||
69
sortnum.asm
Normal file
69
sortnum.asm
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
// Sort number from biggest to smallest
|
||||||
|
// 88 66 44 22 1 11 33 55 77 99
|
||||||
|
|
||||||
|
addi.w $r1, $r1, 88
|
||||||
|
addi.w $r2, $r2, 44
|
||||||
|
addi.w $r3, $r3, 1
|
||||||
|
addi.w $r4, $r4, 22
|
||||||
|
addi.w $r5, $r5, 55
|
||||||
|
|
||||||
|
slt $r10, $r1, $r2 // Compare r1 and r2
|
||||||
|
beq $r10, $r0, 16 // If r1 >= r2, branch to next
|
||||||
|
addi.w $r11, $r1, 0 // r11 = r1 (temp storage)
|
||||||
|
addi.w $r1, $r2, 0 // r1 = r2 (swap)
|
||||||
|
addi.w $r2, $r11, 0 // r2 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r1, $r3 // Compare r1 and r3
|
||||||
|
beq $r10, $r0, 16 // If r1 >= r3, branch to next
|
||||||
|
addi.w $r11, $r1, 0 // r11 = r1 (temp storage)
|
||||||
|
addi.w $r1, $r3, 0 // r1 = r3 (swap)
|
||||||
|
addi.w $r3, $r11, 0 // r3 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r1, $r4 // Compare r1 and r4
|
||||||
|
beq $r10, $r0, 16 // If r1 >= r4, branch to next
|
||||||
|
addi.w $r11, $r1, 0 // r11 = r1 (temp storage)
|
||||||
|
addi.w $r1, $r4, 0 // r1 = r4 (swap)
|
||||||
|
addi.w $r4, $r11, 0 // r4 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r1, $r5 // Compare r1 and r5
|
||||||
|
beq $r10, $r0, 16 // If r1 >= r5, branch to next
|
||||||
|
addi.w $r11, $r1, 0 // r11 = r1 (temp storage)
|
||||||
|
addi.w $r1, $r5, 0 // r1 = r5 (swap)
|
||||||
|
addi.w $r5, $r11, 0 // r5 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r2, $r3 // Compare r2 and r3
|
||||||
|
beq $r10, $r0, 16 // If r2 >= r3, branch to next
|
||||||
|
addi.w $r11, $r2, 0 // r11 = r2 (temp storage)
|
||||||
|
addi.w $r2, $r3, 0 // r2 = r3 (swap)
|
||||||
|
addi.w $r3, $r11, 0 // r3 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r2, $r4 // Compare r2 and r4
|
||||||
|
beq $r10, $r0, 16 // If r2 >= r4, branch to next
|
||||||
|
addi.w $r11, $r2, 0 // r11 = r2 (temp storage)
|
||||||
|
addi.w $r2, $r4, 0 // r2 = r4 (swap)
|
||||||
|
addi.w $r4, $r11, 0 // r4 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r2, $r5 // Compare r2 and r5
|
||||||
|
beq $r10, $r0, 16 // If r2 >= r5, branch to next
|
||||||
|
addi.w $r11, $r2, 0 // r11 = r2 (temp storage)
|
||||||
|
addi.w $r2, $r5, 0 // r2 = r5 (swap)
|
||||||
|
addi.w $r5, $r11, 0 // r5 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r3, $r4 // Compare r3 and r4
|
||||||
|
beq $r10, $r0, 16 // If r3 >= r4, branch to next
|
||||||
|
addi.w $r11, $r3, 0 // r11 = r3 (temp storage)
|
||||||
|
addi.w $r3, $r4, 0 // r3 = r4 (swap)
|
||||||
|
addi.w $r4, $r11, 0 // r4 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r3, $r5 // Compare r3 and r5
|
||||||
|
beq $r10, $r0, 16 // If r3 >= r5, branch to next
|
||||||
|
addi.w $r11, $r3, 0 // r11 = r3 (temp storage)
|
||||||
|
addi.w $r3, $r5, 0 // r3 = r5 (swap)
|
||||||
|
addi.w $r5, $r11, 0 // r5 = r11 (swap)
|
||||||
|
|
||||||
|
slt $r10, $r4, $r5 // Compare r4 and r5
|
||||||
|
beq $r10, $r0, 16 // If r4 >= r5, branch to next
|
||||||
|
addi.w $r11, $r4, 0 // r11 = r4 (temp storage)
|
||||||
|
addi.w $r4, $r5, 0 // r4 = r5 (swap)
|
||||||
|
addi.w $r5, $r11, 0 // r5 = r11 (swap)
|
||||||
|
|
||||||
Reference in New Issue
Block a user