CN101261783A - A Simulation Experiment System of "Principles of Computer Composition" - Google Patents

A Simulation Experiment System of "Principles of Computer Composition" Download PDF

Info

Publication number
CN101261783A
CN101261783A CNA2008100609599A CN200810060959A CN101261783A CN 101261783 A CN101261783 A CN 101261783A CN A2008100609599 A CNA2008100609599 A CN A2008100609599A CN 200810060959 A CN200810060959 A CN 200810060959A CN 101261783 A CN101261783 A CN 101261783A
Authority
CN
China
Prior art keywords
module
simulation
value
micro
experiment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2008100609599A
Other languages
Chinese (zh)
Other versions
CN101261783B (en
Inventor
刘均
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN2008100609599A priority Critical patent/CN101261783B/en
Publication of CN101261783A publication Critical patent/CN101261783A/en
Application granted granted Critical
Publication of CN101261783B publication Critical patent/CN101261783B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A simulation experiment system of Principles of Computer Composition comprises a single module experiment simulation subsystem and a whole machine experiment simulation subsystem, wherein the single module experiment simulation subsystem includes a register group module simulation unit, an universal register module simulation unit, an arithmetic unit module simulation unit, a memory and bus module simulation unit, an instruction unit simulation unit, a microprogrammed controller module simulation unit and a sequence and start-stop module simulation unit; the single module experiment simulation subsystem includes an initial module, a switch button detection module and a switch motion operating module; the whole machine experiment simulation subsystem includes an initial module, an operational mode identification module, an instruction fetch module, an instruction analysis module and an instruction executing module. The invention provides a simulation experiment system of Principles of Computer Composition which is cost-cutting and can effectively meet the all requirements of assistant teaching experiments.

Description

一种《计算机组成原理》仿真实验系统 A Simulation Experiment System of "Principles of Computer Composition"

技术领域technical field

本发明涉及仿真实验系统。The invention relates to a simulation experiment system.

背景技术Background technique

现有的《计算机组成原理》课程配套的实验手段主要有:The existing experimental methods for the course "Computer Composition Principles" mainly include:

(1)、硬件实验仪形式:用电路组成的计算机模块。实验教学中对电路提供操作,得到实验效果。当前高校教学大多数采用此种方式。(1) The form of the hardware experiment instrument: a computer module composed of circuits. In the experimental teaching, the operation of the circuit is provided to obtain the experimental effect. Most of the current college teaching adopts this method.

问题和缺点:实验教学必须购买实验仪器,价格较贵,实验仪器维护费用高。实验仪器故障会影响教学效果。Problems and disadvantages: Experimental teaching must purchase experimental equipment, which is expensive, and the maintenance cost of experimental equipment is high. The failure of experimental equipment will affect the teaching effect.

(2)、硬件实验仪和软件程序结合形式:用电路组成的计算机模块,实验教学中对电路提供操作,得到实验效果,同时用配套的软件从硬件实验仪上获得数据,在软件界面上显示实验效果。这种方式界面直观。有些高校采用此种方式。(2) Combination form of hardware experiment instrument and software program: use computer module composed of circuit, provide operation to circuit in experimental teaching, obtain experimental effect, and use supporting software to obtain data from hardware experiment instrument at the same time, display on the software interface experimental effect. This way the interface is intuitive. Some colleges and universities use this method.

问题和缺点:软件必须依赖硬件实验仪使用,在实验仪故障时,无法使用。问题和缺点同第一种方式。Problems and disadvantages: The software must rely on the hardware tester to use, and cannot be used when the tester fails. The problems and shortcomings are the same as the first method.

(3)、纯软件仿真形式:用软件实现计算机硬件模块的功能,用户在软件界面上对虚拟的硬件操作,得到实验结果。这种方法没有硬件实验室投资费用和维护问题,操作简单,界面直观,可以保证实验教学效果。当前还没有此类完整产品。有些高校教师开发了仿真某一模块(如运算器硬件)的软件,但是没有仿真一台计算机的完整产品。(3) Pure software simulation form: use software to realize the functions of computer hardware modules, and users operate virtual hardware on the software interface to obtain experimental results. This method has no hardware laboratory investment costs and maintenance problems, simple operation, intuitive interface, and can ensure the effect of experimental teaching. There is currently no such complete product. Some university teachers have developed software that simulates a certain module (such as arithmetic unit hardware), but they do not have a complete product that simulates a computer.

问题和缺点:只有一部分模块的仿真,仍然需要借助实验仪,成本高、且不能辅助解决教学实验的全部要求。Problems and disadvantages: The simulation of only a part of the modules still requires the use of experimental equipment, which is costly and cannot assist in solving all the requirements of teaching experiments.

发明内容Contents of the invention

为了克服已有的《计算机组成原理》实验设备的成本高、不能辅助解决教学实验的全部要求的不足,本发明提供一种降低成本、有效辅助教学实验的全部要求的《计算机组成原理》仿真实验系统。In order to overcome the high cost of the existing "Principles of Computer Composition" experimental equipment and the inability to assist in solving all the requirements of the teaching experiment, the present invention provides a simulation experiment of "Principles of Computer Composition" that reduces costs and effectively assists all the requirements of the teaching experiment system.

本发明解决其技术问题所采用的技术方案是:The technical solution adopted by the present invention to solve its technical problems is:

一种《计算机组成原理》仿真实验系统,包括单模块实验仿真子系统和整机实验仿真子系统,所述单模块实验仿真子系统包括寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元,所述单模块实验仿真子系统包括:初始化模块,用于设置各个对象是否可见,设置变量初始值,所述对象包括硬件芯片、操作开关和模块间信息通道,所述变量包括硬件芯片值、操作开关的信号值、信息通路上信号值、操作开关代表的控制信号含义、信息传输的方向;开关按钮检测模块,用于在flash中按钮元件为自动检测,会激发动作,在该动作中编写代码,判断是数据开关还是控制信号开关;数据开关操作模块,用于显示数据输入到实验模块的信息流动动画,并将数据开关值赋值给模块硬件芯片值;A "Computer Composition Principles" simulation experiment system, including a single-module experiment simulation subsystem and a complete machine experiment simulation subsystem, the single-module experiment simulation subsystem includes a register group module simulation unit, a general-purpose register sending module simulation unit, and an arithmetic unit Module simulation unit, memory and bus module simulation unit, instruction component simulation unit, microprogram controller module simulation unit and timing and start-stop module simulation unit, the single module experiment simulation subsystem includes: initialization module, for setting each object Visible or not, set the initial value of the variable, the object includes the hardware chip, the operation switch and the information channel between modules, the variable includes the value of the hardware chip, the signal value of the operation switch, the signal value on the information path, and the meaning of the control signal represented by the operation switch , the direction of information transmission; the switch button detection module is used to automatically detect the button element in the flash, which will trigger an action, write code in this action, and judge whether it is a data switch or a control signal switch; the data switch operation module is used to display The data is input to the information flow animation of the experimental module, and the data switch value is assigned to the module hardware chip value;

开关动作操作模块,用于根据该模块信号的定义,判断控制信号对实验模块是否有效,如有效,则执行模块的功能代码,完成要求的功能。若不是,则模块不运行;所述整机实验仿真子系统包括:The switch action operation module is used to judge whether the control signal is valid for the experimental module according to the definition of the module signal, and if it is valid, execute the function code of the module to complete the required function. If not, the module does not run; the complete machine experiment simulation subsystem includes:

初始化模块,用于初始化整机界面上所有对象及变量;The initialization module is used to initialize all objects and variables on the whole machine interface;

运行模式识别模块,用于检测运行按钮,判断是按下微单步按钮还是全速按钮,设置运行模式标志变量;The running mode identification module is used to detect the running button, judge whether to press the micro single step button or the full speed button, and set the running mode flag variable;

取指令模块,用于将值赋值给内存当前地址值,根据内存当前地址值查内存数据数组,得到内存当前数据值,将此值传送到指令寄存器;内存当前地址值、内存当前数据值、指令寄存器值用显示灯显示;The instruction fetch module is used to assign the value to the current address value of the memory, check the memory data array according to the current address value of the memory, obtain the current data value of the memory, and transfer this value to the instruction register; the current address value of the memory, the current data value of the memory, the instruction The register value is displayed by the indicator light;

分析指令模块,用于根据指令寄存器的值查表得到该指令对应的微程序的微地址,把微地址作为微程序存储器数组的下标,查找到微程序的第1条微指令,微指令中的代码即为各模块的控制信号,根据微指令代码,给涉及到的模块送控制信号,模块根据控制信号完成相应的功能;显示灯显示微指令值、微地址值、各模块控制信号灯值;The analysis command module is used to obtain the micro-address of the micro-program corresponding to the command according to the value of the command register, and use the micro-address as the subscript of the micro-program memory array to find the first micro-command of the micro-program. The code of each module is the control signal of each module. According to the micro-command code, the control signal is sent to the modules involved, and the module completes the corresponding function according to the control signal; the display lamp displays the micro-command value, micro-address value, and the value of the control signal light of each module;

执行指令模块,用于根据取得的微指令,给各单模块剪辑传送控制信号,即各单模块剪辑得到控制信号组合,若控制信号有效,则该模块实现自身的功能,执行结果体现在硬件芯片的变量中。The execution command module is used to transmit control signals to each single module editing according to the obtained micro instructions, that is, each single module editing obtains a combination of control signals. If the control signal is valid, the module realizes its own function, and the execution result is reflected in the hardware chip. in the variable.

作为优选的一种方案:所述的寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元采用flash Actionscript_开发,发布为HTML形式,实验系统的组织采用HTML超链接形式连接。As a preferred scheme: described register group module simulation unit, general-purpose register module simulation unit, arithmetic unit module simulation unit, memory and bus module simulation unit, instruction component simulation unit, microprogram controller module simulation unit and timing And the simulation unit of the start-stop module is developed by flash Actionscript_, published in the form of HTML, and the organization of the experimental system is connected in the form of HTML hyperlinks.

本发明的技术构思为:系统单机版开发平台为Macromedia flash 8。用HTML超链接形式将各实验组织在一起。本系统不需在计算机上安装,可直接运行。运行环境为有flash player插件的浏览器(IE 6以上版本自带该插件)。本发明系统网络版开发平台为Macromedia flash 8,ASP。系统需要IIS环境才可运行。The technical idea of the present invention is: the development platform of the system stand-alone version is Macromedia flash 8. Experiments are organized together using HTML hyperlinks. This system does not need to be installed on the computer, it can be run directly. The operating environment is a browser with a flash player plug-in (the plug-in comes with IE 6 and above). The system network edition development platform of the present invention is Macromedia flash 8, ASP. The system needs IIS environment to run.

本发明软件通过HTML页面,提供完成实验选择的超链接列表。用户根据内容选择进行的实验。实验1到实验7是单模块实验操作,实验8是整机实验操作。每个实验都包括实验指导说明文档。The software of the present invention provides a list of hyperlinks for completing the experiment selection through the HTML page. Experiments performed by users based on content choices. Experiment 1 to Experiment 7 are single-module experimental operations, and Experiment 8 is the whole machine experimental operation. Each experiment includes an Experiment Instructions document.

实验一是寄存器组模块仿真Experiment 1 is the simulation of the register bank module

实验二是通用寄存器模块仿真The second experiment is the general register module simulation

实验三是运算器模块仿真The third experiment is the simulation of the arithmetic unit module

实验四是存储器和总线模块仿真Experiment 4 is memory and bus module simulation

实验五是指令部件模块仿真The fifth experiment is the simulation of the instruction component module

实验六是微程序控制器模块仿真Experiment 6 is the simulation of the microcontroller module

实验七是时序和启停模块仿真Experiment 7 is timing and start-stop module simulation

实验八是整机综合仿真Experiment 8 is the comprehensive simulation of the whole machine

用户从实验列表中选择要进行的实验项目,通过阅读实验指导文档,了解实验的基本操作原理和步骤,再进入仿真实验机界面完成操作。仿真实验机界面以真实实验仪照片为背景,这样可以给操作者强烈的真实感。实验涉及到的硬件模块及该模块的逻辑线路都标识和绘制出来,实现虚实结合。The user selects the experimental item to be carried out from the experimental list, reads the experimental guidance document, understands the basic operation principle and steps of the experiment, and then enters the simulation experiment machine interface to complete the operation. The interface of the simulation test machine is based on the photo of the real test machine, which can give the operator a strong sense of reality. The hardware modules involved in the experiment and the logic circuits of the modules are identified and drawn to realize the combination of virtual and real.

实验指导文档为HTML静态页面形式。The experimental guidance document is in the form of HTML static page.

仿真实验机分2类,单模块实验仿真和综合实验机仿真。There are two types of simulation test machines, single-module test simulation and comprehensive test machine simulation.

1、单模块实验仿真,包括有1. Single-module experimental simulation, including

1.1、单模块实验仿真功能1.1. Single module experiment simulation function

操作者连接实验要求的连线,即可操作输入开关,给实验模块提供数据、地址、控制信号。连线时用户通过鼠标点击指定连接的信号插孔和输入开关插孔,连接线路出现在界面上,若连接不正确,则不会有信号线出现。The operator can operate the input switch by connecting the wires required by the experiment to provide data, address and control signals to the experiment module. When connecting, the user clicks the designated signal jack and input switch jack with the mouse, and the connection line appears on the interface. If the connection is not correct, no signal line will appear.

在连线完成之后,用户可以操作该实验模块了。用鼠标点击开关,开关会有相应的变化,开关上的指示灯会亮灭表示数据“1”和“0”,同时代表信号传递的动画会演示,用户可以看到自己的操作提供的高低电平信号传递到具体哪块芯片上去了。实验过程中,可以将鼠标移至芯片上,该芯片内部的数据值会以二进制形式显示出来。模块的工作逻辑完全仿真硬件工作情况,芯片对控制信号不同组合作出不同操作。After the connection is completed, the user can operate the experimental module. Click the switch with the mouse, the switch will change accordingly, the indicator light on the switch will be on and off to indicate the data "1" and "0", and the animation representing the signal transmission will be demonstrated, and the user can see the high and low levels provided by their own operations The signal is transmitted to which specific chip. During the experiment, you can move the mouse to the chip, and the data value inside the chip will be displayed in binary form. The working logic of the module fully simulates the working condition of the hardware, and the chip performs different operations on different combinations of control signals.

黄色的信号流动动画表示数据信息传递路线,红色的信号流动表示控制信号开关提供了高电平送达连接的芯片引脚。数据开关显示灯、控制开关显示灯、总线显示灯上的值与实验仪显示形式一致。另外还可以直接点击模块中的芯片,查询芯片内的数据值。对于功能较多的芯片,还显示提示信息,提醒用户给出的控制信号选择了该芯片何种功能。The yellow signal flow animation represents the data information transmission route, and the red signal flow represents the chip pin that the control signal switch provides a high level delivery connection. The values on the data switch display lamp, control switch display lamp, and bus display lamp are consistent with the display form of the experimental instrument. In addition, you can directly click on the chip in the module to query the data value in the chip. For chips with many functions, prompt information is also displayed to remind the user which function of the chip is selected by the given control signal.

1.2、单模块仿真设计思路1.2. Single-module simulation design idea

单模块实验中,涉及到的对象及关系有:In the single-module experiment, the objects and relationships involved are:

1)对象:硬件芯片、操作开关、模块间信息通路。1) Objects: hardware chips, operation switches, and information pathways between modules.

2)属性:硬件芯片值、操作开关的信号值、信息通路上信号值、操作开关代表的控制信号含义、信息传输的方向(决定动画形式)、硬件芯片完成的功能。2) Attributes: hardware chip value, signal value of the operation switch, signal value on the information path, meaning of the control signal represented by the operation switch, direction of information transmission (determining the animation form), and functions completed by the hardware chip.

3)动作:操作开关的控制意义经信息传输通路到达硬件芯片,硬件芯片启动内部功能实现。3) Action: The control meaning of the operation switch reaches the hardware chip through the information transmission path, and the hardware chip starts the internal function to realize.

仿真实验机初始状态,在用户对操作开关做操作后,实验机转数据传递和硬件功能运行状态,将开关的控制作用随时体现出来。Simulate the initial state of the experimental machine. After the user operates the operation switch, the experimental machine will switch to the data transmission and hardware function running state, and the control function of the switch will be reflected at any time.

对应单模块仿真分析,我们在flash中建立各对象的实例。Flash中可操作的对象有图形元件、影片剪辑元件、按钮元件。硬件芯片用图形元件表示,属性值用图形元件关联的动态变量值表示,信息传递动作用影片剪辑元件动画表示,操作开关动作用按钮元件表示。Corresponding to single-module simulation analysis, we create instances of each object in flash. Operable objects in Flash include graphics components, movie clip components, and button components. The hardware chip is represented by graphic components, the attribute value is represented by the dynamic variable value associated with the graphic components, the information transfer action is represented by movie clip component animation, and the operation switch action is represented by button components.

Flash ActionScript编程思路:Flash ActionScript programming ideas:

(1)初始化操作在第一帧完成,包括各对象是否可见和变量初始值设置(1) The initialization operation is completed in the first frame, including whether each object is visible and the variable initial value setting

(2)开关按钮检测:在flash中按钮元件为自动检测,会激发on(press)动作。在该动作中编写代码,判断是数据开关还是控制信号开关(2) Switch button detection: In the flash, the button element is automatically detected, which will trigger the on (press) action. Write code in this action to determine whether it is a data switch or a control signal switch

(3)如果是数据开关操作,则显示数据输入到实验模块的信息流动动画。并将数据开关值赋值给模块硬件芯片值。(3) If it is a data switch operation, display the animation of the information flow of data input to the experimental module. And assign the data switch value to the module hardware chip value.

(4)如果是控制开关操作,则根据该模块信号的定义,判断这些控制信号对实验模块是否有效,有效,则执行模块的功能代码,完成要求的功能。若不是,则模块不运行。(4) If it is a control switch operation, according to the definition of the module signal, judge whether these control signals are valid for the experimental module, and if it is valid, execute the function code of the module to complete the required function. If not, the module does not run.

2、整机实验机仿真2. Simulation of the whole machine test machine

2.1整机实验机仿真实现功能2.1 The function of the simulation of the whole machine experimental machine

整机实验是将所有模块通过总线连接在一起,成为一台完整的计算机。实验任务是采用模型机的指令系统编制程序,在实验机上全速、单步或微单步运行程序,完成程序功能。程序结果可以从硬件芯片测得或读取到显示灯查看。The whole machine experiment is to connect all the modules together through the bus to become a complete computer. The experimental task is to use the command system of the model machine to compile the program, run the program at full speed, single step or micro single step on the experimental machine, and complete the program function. The program result can be measured or read from the hardware chip to the display lamp for viewing.

综合整机仿真内容包括2部分:The comprehensive machine simulation content includes 2 parts:

第1部分是用户输入自编的汇编级程序被转换为二进制代码存入内存的过程仿真。The first part is the simulation of the process that the user-input self-compiled assembly-level program is converted into binary code and stored in memory.

第2部分是内存的程序代码微单步或全速运行过程的仿真。Part 2 is the simulation of the program code micro-step or full-speed operation process in memory.

2.1.1汇编程序编译过程仿真2.1.1 Assembler compilation process simulation

本部分实现允许用户输入自编的汇编程序,编译生成二进制代码。功能模块包括用户程序文件操作模块,用户程序查错模块,用户程序编译生成二进制代码模块。This part of implementation allows the user to input self-compiled assembler, compile and generate binary code. The functional modules include a user program file operation module, a user program error checking module, and a user program compiling and generating binary code module.

用户程序文件操作模块提供程序文件的打开、编辑、保存操作。打开操作是将用户已经编辑好的程序文件读入到仿真界面中。我们开发的仿真程序只能读取txt文本文件,所以用户事先要将程序代码写在纯文本文件中。编辑操作是提供在输入文本框实现,可以完成程序输入、添加、删除基本操作。用户程序保存操作模块通过按钮触发,当用户按下保存按钮后,可以将输入文本框中的内容保存为文本文件,用户可以对代码保存和再利用。The user program file operation module provides the operations of opening, editing and saving program files. The opening operation is to read the program file edited by the user into the simulation interface. The simulation program we developed can only read txt text files, so the user must write the program code in a plain text file in advance. The editing operation is implemented in the input text box, which can complete the basic operations of program input, addition, and deletion. The user program save operation module is triggered by a button. When the user presses the save button, the content in the input text box can be saved as a text file, and the user can save and reuse the code.

用户程序查错模块,是根据实验仪指令系统,检查用户程序文件中的语法错误和指令错误。由于模型实验机的指令系统设计比较简单,一共34条指令,并且都是采用固定操作码形式,指令长度有1字节和2字节两种,只有立即数寻址方式的指令才翻译为2个字节。所以对指令的识别和排错判断就比较容易,利用字符串操作函数,从程序文件中提取一行,去掉首尾空格后,按照指令格式对字符串比较,若出现非指令系统中指令格式,则给出错误提示,返回编辑页面。The user program error checking module checks syntax errors and instruction errors in user program files according to the instruction system of the tester. Since the instruction system design of the model test machine is relatively simple, there are 34 instructions in total, and all of them are in the form of fixed operation codes. The instruction length is 1 byte and 2 bytes. bytes. Therefore, it is easier to identify and debug instructions. Use the string operation function to extract a line from the program file, remove the leading and trailing spaces, and compare the strings according to the instruction format. If there is an instruction format that is not in the instruction system, give An error message is displayed, and the edit page is returned.

若指令符合指令系统规定的指令格式,则用户程序编译生成二进制代码模块,通过查表得到该指令的十六进制代码,放在代表内存空间的数组中,同时根据指令长度,改变内存空间地址编号。If the instruction conforms to the instruction format specified by the instruction system, the user program is compiled to generate a binary code module, and the hexadecimal code of the instruction is obtained by looking up the table, and placed in the array representing the memory space. At the same time, the address of the memory space is changed according to the length of the instruction. serial number.

2.1.2程序运行仿真模块2.1.2 Program running simulation module

程序的运行实质上是硬件组成的各部分相继协调动作的过程。这部分仿真,涉及到各个模块的功能实现,各模块之间的数据传递,各模块的操作顺序。The operation of the program is essentially a process in which the various parts of the hardware are coordinated in succession. This part of the simulation involves the function realization of each module, the data transfer between each module, and the operation sequence of each module.

各模块的功能实现同单模块仿真部分,不过数据、地址和控制信号的来源则不再由手工操作,而是由总线得到。各模块之间的数据传递都是通过总线来进行的,包括数据总线、地址总线和控制总线。所以各模块之间数据传递时,有动画演示数据的流动方向。各模块的数据值则用变量实现保存。The function realization of each module is the same as the simulation part of a single module, but the source of data, address and control signal is no longer manually operated, but obtained by the bus. Data transfer between modules is carried out through the bus, including data bus, address bus and control bus. Therefore, when data is transferred between modules, there is an animation to demonstrate the flow direction of data. The data values of each module are saved with variables.

程序运行初始,各模块的初始变量值为0。用户按下运行按钮后,仿真计算机程序运行的基本顺序:取指令,分析指令,执行指令。At the beginning of program operation, the initial variable value of each module is 0. After the user presses the run button, the basic sequence of computer program operation is simulated: fetching instructions, analyzing instructions, and executing instructions.

仿真机上的程序运行提供了微单步运行和全速运行2种模式。根据用户按下的微单步按钮还是全速运行按钮,设置一个标志值,根据标志值,设定在每一步微指令动画后的停止语句是否执行。The program operation on the emulator provides two modes: micro-step operation and full-speed operation. Set a flag value according to the micro-step button or the full-speed operation button pressed by the user, and according to the flag value, set whether to execute the stop statement after each step of the micro-command animation.

Flash ActionScript编程思路:Flash ActionScript programming ideas:

(1)初始化整机界面上所有对象及变量(1) Initialize all objects and variables on the machine interface

(2)检测运行按钮,是按下微单步按钮还是全速按钮,设置运行模式标志变量(2) Detect the running button, whether to press the micro single step button or the full speed button, and set the running mode flag variable

(3)取指令:这个过程涉及到的硬件对象有程序计数器PC、内存、指令寄存器;这个过程涉及到的变量有PC值、内存当前地址值、内存当前数据值、指令寄存器值。此过程的信号传递是将pc值赋值给内存当前地址值,根据内存当前地址值查内存数据数组,得到内存当前数据值,将此值传送到指令寄存器。此过程除了动画流动外,还包括内存当前地址值、内存当前数据值、指令寄存器值用显示灯显示。(3) Instruction fetching: The hardware objects involved in this process include program counter PC, memory, and instruction register; the variables involved in this process include PC value, current address value of memory, current data value of memory, and instruction register value. The signal transmission of this process is to assign the pc value to the current address value of the memory, check the memory data array according to the current address value of the memory, obtain the current data value of the memory, and transfer this value to the instruction register. In addition to the animation flow, this process also includes displaying the current address value of the memory, the current data value of the memory, and the value of the instruction register with display lights.

(4)分析指令:控制器模块仿真的是微程序控制器,所以分析指令的过程即为根据指令寄存器中的值查找到微程序的过程。微程序采用水平型微指令格式,事先存储在微程序存储器中,我们设计一个数组保存微程序存储器中的值。本过程涉及到的硬件有指令寄存器、微程序控制存储器;这个过程涉及到的变量有指令寄存器值、微地址值、微指令值。此过程的信号传递是根据指令寄存器的值查表得到该指令对应的微程序的微地址,把微地址作为微程序存储器数组的下标,查找到微程序的第1条微指令。微指令中的代码即为各模块的控制信号,所以可以根据微指令代码,给涉及到的模块送控制信号,模块根据控制信号完成相应的功能。本过程的动画除了演示信号流动外,还要用显示灯显示微指令值、微地址值、各模块控制信号灯值。(4) Analyze instructions: the controller module emulates a microprogram controller, so the process of analyzing instructions is the process of finding the microprogram according to the value in the instruction register. The microprogram adopts the horizontal microinstruction format and is stored in the microprogram memory in advance. We design an array to save the values in the microprogram memory. The hardware involved in this process includes instruction registers and microprogram control memory; the variables involved in this process include instruction register values, microaddress values, and microinstruction values. The signal transmission of this process is to look up the micro-address of the micro-program corresponding to the instruction according to the value of the instruction register, and use the micro-address as the subscript of the micro-program memory array to find the first micro-instruction of the micro-program. The code in the microinstruction is the control signal of each module, so the control signal can be sent to the related modules according to the microinstruction code, and the module completes the corresponding function according to the control signal. In addition to demonstrating the flow of signals, the animation of this process also uses display lights to display micro-command values, micro-address values, and the value of each module's control signal lights.

实验仪指令系统中各指令的微周期时间不同,有2~4个。我们将所有指令微周期统一为4个,在微周期少于4个指令执行时,空余的微周期执行转移指令即可。The microcycle time of each instruction in the instruction system of the experimental instrument is different, and there are 2 to 4. We unify all instruction microcycles into 4. When the microcycles are less than 4 instructions are executed, the spare microcycles can execute the transfer instruction.

(4)执行指令:根据前一步取得的微指令,给各单模块剪辑传送控制信号,即各单模块剪辑得到控制信号组合,若控制信号有效,则该模块实现自身的功能,执行结果体现在硬件芯片的变量中。4个微指令执行完毕,则重新执行第(3)步。直到遇到停机指令,系统停止运行。(4) Executing instructions: According to the micro-instructions obtained in the previous step, send control signals to each single-module clip, that is, each single-module clip obtains a combination of control signals. If the control signal is valid, the module realizes its own function, and the execution result is reflected in Among the variables of the hardware chip. 4 microinstructions have been carried out, then re-execute the (3) step. The system stops running until a shutdown command is encountered.

本发明的有益效果主要表现在:降低成本、有效辅助教学实验的全部要求。The beneficial effects of the invention are mainly manifested in: reducing costs and effectively assisting all requirements of teaching experiments.

附图说明Description of drawings

图1是《计算机组成原理》仿真实验系统的总体结构图。Figure 1 is the overall structure diagram of the simulation experiment system of "Computer Composition Principles".

图2是单模块对象及其关系示意图。Fig. 2 is a schematic diagram of single module objects and their relationships.

图3是单模块仿真状态转换图。Figure 3 is a single-module simulation state transition diagram.

图4是单模块仿真流程图。Figure 4 is a flow chart of single module simulation.

图5是整机仿真流程图。Figure 5 is a flow chart of the whole machine simulation.

具体实施方式Detailed ways

下面结合附图对本发明作进一步描述。The present invention will be further described below in conjunction with the accompanying drawings.

参照图1~图5,一种《计算机组成原理》仿真实验系统,包括单模块实验仿真子系统和整机实验仿真子系统,所述单模块实验仿真子系统包括寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元,所述单模块实验仿真子系统包括:初始化模块,用于设置各个对象是否可见,设置变量初始值,所述对象包括硬件芯片、操作开关和模块间信息通道,所述变量包括硬件芯片值、操作开关的信号值、信息通路上信号值、操作开关代表的控制信号含义、信息传输的方向;开关按钮检测模块,用于在flash中按钮元件为自动检测,会激发动作,在该动作中编写代码,判断是数据开关还是控制信号开关;数据开关操作模块,用于显示数据输入到实验模块的信息流动动画,并将数据开关值赋值给模块硬件芯片值;开关动作操作模块,用于根据该模块信号的定义,判断控制信号对实验模块是否有效,如有效,则执行模块的功能代码,完成要求的功能。若不是,则模块不运行;所述整机实验仿真子系统包括:初始化模块,用于初始化整机界面上所有对象及变量;运行模式识别模块,用于检测运行按钮,判断是按下微单步按钮还是全速按钮,设置运行模式标志变量;取指令模块,用于将值赋值给内存当前地址值,根据内存当前地址值查内存数据数组,得到内存当前数据值,将此值传送到指令寄存器;内存当前地址值、内存当前数据值、指令寄存器值用显示灯显示;分析指令模块,用于根据指令寄存器的值查表得到该指令对应的微程序的微地址,把微地址作为微程序存储器数组的下标,查找到微程序的第1条微指令,微指令中的代码即为各模块的控制信号,根据微指令代码,给涉及到的模块送控制信号,模块根据控制信号完成相应的功能;显示灯显示微指令值、微地址值、各模块控制信号灯值;执行指令模块,用于根据取得的微指令,给各单模块剪辑传送控制信号,即各单模块剪辑得到控制信号组合,若控制信号有效,则该模块实现自身的功能,执行结果体现在硬件芯片的变量中。With reference to Fig. 1~Fig. 5, a kind of " computer composition principle " emulation experiment system, comprises single module experiment emulation subsystem and complete machine experiment emulation subsystem, described single module experiment emulation subsystem comprises register bank module emulation unit, general-purpose register Sending module simulation unit, arithmetic unit module simulation unit, memory and bus module simulation unit, instruction component simulation unit, microprogram controller module simulation unit and timing and start-stop module simulation unit, the single-module experimental simulation subsystem includes: initialization The module is used to set whether each object is visible, and to set the initial value of the variable. The object includes the hardware chip, the operation switch and the information channel between the modules. The variable includes the value of the hardware chip, the signal value of the operation switch, the signal value on the information path, The meaning of the control signal represented by the operation switch and the direction of information transmission; the switch button detection module is used for automatic detection of the button element in the flash, which will trigger an action, write code in this action, and judge whether it is a data switch or a control signal switch; data The switch operation module is used to display the information flow animation of data input to the experimental module, and assign the data switch value to the module hardware chip value; the switch action operation module is used to judge whether the control signal affects the experimental module according to the definition of the module signal. Valid, if valid, execute the function code of the module to complete the required function. If not, then the module does not run; the whole machine experiment simulation subsystem includes: an initialization module, which is used to initialize all objects and variables on the whole machine interface; an operation mode recognition module, which is used to detect the operation button, and judges whether to press the micro-single Step button or full speed button, set the running mode flag variable; instruction fetching module, used to assign the value to the current address value of the memory, check the memory data array according to the current address value of the memory, get the current data value of the memory, and transfer this value to the instruction register ; The current address value of the memory, the current data value of the memory, and the value of the instruction register are displayed with display lights; the analysis instruction module is used to look up the table according to the value of the instruction register to obtain the micro-address of the micro-program corresponding to the instruction, and use the micro-address as the micro-program memory The subscript of the array finds the first microinstruction of the microprogram. The code in the microinstruction is the control signal of each module. According to the microinstruction code, the control signal is sent to the modules involved, and the module completes the corresponding operation according to the control signal. Function; the display lamp displays the micro-instruction value, the micro-address value, and the control signal light value of each module; the execution command module is used to transmit control signals to each single-module clip according to the obtained micro-command, that is, each single-module clip obtains a combination of control signals, If the control signal is valid, the module realizes its own function, and the execution result is reflected in the variables of the hardware chip.

所述的寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元采用flashActionscript_开发,发布为HTML形式,实验系统的组织采用HTML超链接形式连接。Described register set module emulation unit, general-purpose register module emulation unit, arithmetic unit module emulation unit, memory and bus module emulation unit, instruction component emulation unit, microprogram controller module emulation unit and timing and start-stop module emulation unit adopt flashActionscript_ is developed and published in HTML form, and the organization of the experimental system is connected in the form of HTML hyperlinks.

实施例1:运算器模块仿真说明Embodiment 1: Simulation description of the arithmetic unit module

(1)选择实验列表上实验三(1) Select Experiment 3 on the experiment list

(2)进入实验三实验指导文档,文档末尾是仿真操作链接(2) Enter the experimental guidance document of Experiment 3, and the end of the document is a link to the simulation operation

(3)点击仿真操作,进入运算器仿真机界面(3) Click the simulation operation to enter the calculator simulator interface

(4)在数据开关总线连接头上单击,再到运算器模块总线连接头上单击,在数据开关和运算器模块总线间出现白色的数据通路(4) Click on the data switch bus connector, and then click on the calculator module bus connector, a white data path appears between the data switch and the calculator module bus

(5)在控制开关EDR1上单击,再到运算器模块的控制信号EDR1上单击,两个点间出现连接信号线。在控制开关EDR2上单击,再到运算器模块的控制信号EDR2上单击,两个点间出现连接信号线。(5) Click on the control switch EDR1, and then click on the control signal EDR1 of the arithmetic unit module, and a connecting signal line appears between the two points. Click on the control switch EDR2, and then click on the control signal EDR2 of the arithmetic unit module, and a connecting signal line appears between the two points.

依次将控制开关上标称的控制信号单击后,单击相应的运算器模块控制信号,使得10个控制信号之间出现连接信号线。After clicking the nominal control signal on the control switch in turn, click the corresponding operator module control signal, so that the connection signal line appears between the 10 control signals.

再单击脉冲按钮点CCK1和EDR1CK,CCK2和EDR2CK,出现2个脉冲信号连线。Then click the pulse button to point CCK1 and EDR1CK, CCK2 and EDR2CK, and two pulse signal connections appear.

上述连线操作没有顺序要求,只要求连续2次单击的信号之间是有连线的,否则不会出现连线。There is no sequence requirement for the above connection operations, only the signals of two consecutive clicks are required to be connected, otherwise there will be no connection.

(6)现在可以通过给数据开关和控制开关不同值,使运算器完成运算。假设要完成22H+33H(6) Now you can make the arithmetic unit complete the calculation by giving different values to the data switch and the control switch. Suppose to complete 22H+33H

(7)在数据开关上操作,使开关的二进制组合为00100010,在控制开关中将EDR1对应的开关置为0,其它开关置为1。在EDR1CK上点击。在数据开关到DR1通路上出现信号流动的动画。此时可将鼠标点击DR1硬件芯片,察看到芯片内数值为00100010。(7) Operate on the data switch, make the binary combination of the switch be 00100010, set the switch corresponding to EDR1 to 0 in the control switch, and set the other switches to 1. Click on EDR1CK. Animation of signal flow on the data switch to DR1 path. At this point, you can click the mouse on the DR1 hardware chip and see that the value in the chip is 00100010.

(8)在数据开关上操作,使开关的二进制组合为00110011,在控制开关中将EDR2对应的开关置为0,其它开关置为1。在EDR2CK上点击。在数据开关到DR2通路上出现信号流动的动画。此时可将鼠标点击DR2硬件芯片,察看到芯片内数值为00110011。(8) Operate on the data switch, make the binary combination of the switch be 00110011, set the switch corresponding to EDR2 to 0 in the control switch, and set the other switches to 1. Click on EDR2CK. Animation of signal flow on the data switch to DR2 path. At this point, you can click the mouse on the DR2 hardware chip and see that the value in the chip is 00110011.

(9)将控制开关s0~s3置为1001,将控制开关CN置为0。此时可将鼠标点击ALU硬件芯片,察看到芯片内数值为01010101。(9) Set the control switches s0-s3 to 1001, and set the control switch CN to 0. At this time, you can click the ALU hardware chip with the mouse, and observe that the value in the chip is 01010101.

(10)将ALU-O控制开关置为0,由运算器模块到数据总线灯有信号流动动画,数据灯显示ALU硬件芯片的值为01010101。(10) Set the ALU-O control switch to 0, and there will be a signal flow animation from the arithmetic unit module to the data bus light, and the data light will display the value of the ALU hardware chip as 01010101.

(11)    此时可调整S0~s3的开关组合,ALU芯片旁提示信息显示现在ALU芯片进行的操作。同时可通过数据灯和点击ALU芯片查看到不同运算的结果。(11) At this time, the switch combination of S0~s3 can be adjusted, and the prompt information next to the ALU chip shows the current operation of the ALU chip. At the same time, you can view the results of different operations through the data light and click on the ALU chip.

实施例2:整机仿真说明Embodiment 2: description of the whole machine simulation

(1)选择实验列表上实验八(1) Select Experiment 8 on the experiment list

(2)进入整机实验指导说明文档,文档末尾是仿真操作链接(2) Enter the whole machine experiment guidance document, at the end of the document is the simulation operation link

(3)点击整机仿真操作链接,进入程序编辑页面(3) Click the whole machine simulation operation link to enter the program editing page

(4)在输入文本框中输入程序。假设我们输入程序如下(4) Enter the program in the input text box. Suppose we enter the program as follows

MOV A,#55MOV A, #55

MOV R0,#11MOV R0, #11

ADD A,R0ADD A, R0

(5)按提交按钮,进入程序编译界面,通过点击取指令、翻译指令按钮,将每条指令翻译为十六进制代码形式。代码如下(5) Press the submit button to enter the program compilation interface, and translate each instruction into hexadecimal code form by clicking the instruction fetch and translation instruction buttons. code show as below

00 5F00 5F

01 5501 55

02 6C02 6C

03 1103 11

04 0C04 0C

(6)最后一条指令翻译完成后,进入仿真机界面。可以点击内存芯片,查看到前一步翻译得到的代码。可以点击微程序控制器芯片,查看到机器内事先存放好的微程序。(6) After the translation of the last command is completed, enter the emulator interface. You can click on the memory chip to view the code translated in the previous step. You can click on the microprogram controller chip to view the prestored microprograms in the machine.

(7)点击微单步或单步运行按钮,执行程序。假设按微单步运行程序。(7) Click the micro-step or single-step operation button to execute the program. Assume that the program is run in microsteps.

(8)点击微单步运行按钮,从PC芯片到内存芯片间有信号流动,内存的地址addr=0。地址总线指示灯显示为00000000,内存到IR1芯片有信号流动,数据总线指示灯显示为01011111,指令指示灯显示为01011111。微地址=00H。此时有微信号指示灯显示为010011011111111111111111。控制信号灯PC-O、EIR1、RM、MLD闪烁。完成取指微指令。(8) Click the micro single-step operation button, there is a signal flow from the PC chip to the memory chip, and the address of the memory is addr=0. The address bus indicator shows 00000000, there is a signal flow from the memory to the IR1 chip, the data bus indicator shows 01011111, and the command indicator shows 01011111. Micro address = 00H. At this time, there is a micro-signal indicator displaying 01001101111111111111111. The control signal lights PC-O, EIR1, RM, MLD flash. Complete instruction fetch microinstructions.

(9)点击微单步运行按钮,从IR1芯片到微程序存储器芯片有信号流动,微地址=17H。微地址显示灯为00010111。微指令代码指示灯为110111011111101111111111。完成分析指令(9) Click the micro single-step operation button, there is a signal flow from the IR1 chip to the micro program memory chip, micro address = 17H. The micro address display light is 00010111. The microcode indicator light is 110111011111101111111111. Complete analysis instructions

(10)点击微单步运行按钮,从内存芯片到通用寄存器A芯片有信号流动,内存地址addr=1,地址总线指示灯为00000001,数据总线指示灯为01010101。控制信号灯PC-O、ERA、RM、MLD有效。此时点击通用寄存器A芯片,可查看到A内数值为55H。完成第一条指令功能,将55H送A寄存器。(10) Click the micro single-step operation button, there is a signal flow from the memory chip to the general register A chip, the memory address addr=1, the address bus indicator is 00000001, and the data bus indicator is 01010101. Control signal lights PC-O, ERA, RM, MLD are valid. At this time, click on the general register A chip, and you can see that the value in A is 55H. Complete the function of the first instruction, and send 55H to the A register.

(11)点击微单步运行按钮,从PC芯片到内存芯片间有信号流动,内存的地址addr=2。地址总线指示灯显示为00000010,内存到IR1芯片有信号流动,数据总线指示灯显示为01101100,指令指示灯显示为01101100。微地址=18H。此时有微信号指示灯显示为010011011111111111111111。控制信号灯PC-O、EIR1、RM、MLD闪烁。完成取指微指令。(11) Click the micro single-step operation button, there is a signal flow from the PC chip to the memory chip, and the address of the memory is addr=2. The address bus indicator shows 00000010, there is a signal flow from the memory to the IR1 chip, the data bus indicator shows 01101100, and the command indicator shows 01101100. Micro address = 18H. At this time, there is a micro-signal indicator displaying 01001101111111111111111. The control signal lights PC-O, EIR1, RM, MLD flash. Complete instruction fetch microinstructions.

(12)点击微单步运行按钮,从IR1芯片到微程序存储器芯片有信号流动,微地址=1BH。微地址显示灯为00011011。微指令代码指示灯为110111011011111111111111。完成分析指令(12) Click the micro single-step operation button, there is a signal flow from the IR1 chip to the micro-program memory chip, and the micro-address=1BH. The micro address display light is 00011011. The microcode indicator is 11011101101111111111111. Complete analysis instructions

(13)点击微单步运行按钮,从内存芯片到寄存器R0芯片有信号流动,内存地址addr=3,地址总线指示灯为00000011,数据总线指示灯为00010001。控制信号灯PC-O、RM、MLD、WR有效。此时点击寄存器R0芯片,可查看到R0内数值为11H。完成第二条指令功能,将11H送R0寄存器。(13) Click the micro-step operation button, there is a signal flow from the memory chip to the register R0 chip, the memory address addr=3, the address bus indicator is 00000011, and the data bus indicator is 00010001. Control signal lights PC-O, RM, MLD, WR are valid. At this time, click the register R0 chip, and you can see that the value in R0 is 11H. Complete the function of the second instruction, send 11H to the R0 register.

(14)点击微单步运行按钮,从PC芯片到内存芯片间有信号流动,内存的地址addr=4。地址总线指示灯显示为00000100,内存到IR1芯片有信号流动,数据总线指示灯显示为00001100,指令指示灯显示为00001100。微地址=03H。此时有微信号指示灯显示为111111111111110011111001。控制信号灯PC-O、EIR1、RM、MLD闪烁。完成取指微指令。(14) Click the micro single-step operation button, there is a signal flow from the PC chip to the memory chip, and the address of the memory is addr=4. The address bus indicator shows 00000100, there is a signal flow from the memory to the IR1 chip, the data bus indicator shows 00001100, and the command indicator shows 00001100. Micro address = 03H. At this time, there is a micro-signal indicator showing 111111111111110011111001. The control signal lights PC-O, EIR1, RM, MLD flash. Complete instruction fetch microinstructions.

(15)点击微单步运行按钮,从A芯片到DR1芯片有信号流动,可点击DR1查看到DR1值为55H。有控制信号灯ERA、RA-O、RR、EDR1闪烁。完成加法指令ADD微程序的第1条微指令。(15) Click the micro-step operation button, there is a signal flow from the A chip to the DR1 chip, and you can click DR1 to check that the DR1 value is 55H. There are control signal lamps ERA, RA-O, RR, EDR1 flashing. Complete the first microinstruction of the addition instruction ADD microprogram.

(16)点击微单步运行按钮,微地址=04H。此时有微信号指示灯显示为111111110111111101111001。完成取加法指令ADD微程序的第2条微指令。(16) Click the micro single-step operation button, micro address = 04H. At this time, there is a micro-signal indicator showing 111111110111111101111001. Complete the second microinstruction of the ADD microprogram.

(17)点击微单步运行按钮,从R0芯片到DR2芯片有信号流动,可点击DR2查看到DR2值为11H。有控制信号灯RR、EDR2闪烁。完成加法指令ADD微程序的第2条微指令。(17) Click the micro-step operation button, there is a signal flow from the R0 chip to the DR2 chip, and you can click DR2 to check that the DR2 value is 11H. There are control signal lamps RR and EDR2 flashing. Complete the second microinstruction of the addition instruction ADD microprogram.

(18)点击微单步运行按钮,微地址=05H。此时有微信号指示灯显示为111111111111101111111001。完成取加法指令ADD微程序的第3条微指令。(18) Click the micro single-step operation button, micro address = 05H. At this time, there is a micro-signal indicator displaying 11111111111110111111001. Complete the third microinstruction of the ADD microprogram.

(19)点击微单步运行按钮,从ALU到A芯片有信号流动,点击ALU查看到ALU值为66H,点击A芯片查看到A值为66H。完成取加法指令ADD微程序的第2条微指令,也即完成第3条指令。(19) Click the micro-step operation button, and there is a signal flow from ALU to A chip. Click ALU to check that the ALU value is 66H, and click A chip to check that the A value is 66H. Complete the second microinstruction of the ADD microprogram, that is, complete the third instruction.

(20)点击微单步运行按钮,从PC芯片到内存芯片间有信号流动,内存的地址addr=5。地址总线指示灯显示为00000101,内存到IR1芯片有信号流动,数据总线指示灯显示为11111111,指令指示灯显示为11111111。微地址=3FH。此时有微信号指示灯显示为111111111101111111111111。控制信号灯PC-O、EIR1、RM、MLD闪烁。完成取指微指令。(20) Click the micro-step operation button, there is a signal flow from the PC chip to the memory chip, and the address of the memory is addr=5. The address bus indicator shows 00000101, there is a signal flow from the memory to the IR1 chip, the data bus indicator shows 11111111, and the command indicator shows 11111111. Micro address = 3FH. At this time, there is a micro-signal indicator displaying 11111111110111111111111. The control signal lights PC-O, EIR1, RM, MLD flash. Complete instruction fetch microinstructions.

(21)点击微单步运行按钮,机器没有任何动作,停机。(21) Click the micro single-step operation button, the machine will stop without any action.

Claims (2)

1、一种《计算机组成原理》仿真实验系统,其特征在于:所述仿真实验系统包括单模块实验仿真子系统和整机实验仿真子系统,所述单模块实验仿真子系统包括寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元,所述单模块实验仿真子系统包括:1, a kind of " computer composition principle " simulation experiment system, it is characterized in that: described simulation experiment system comprises single module experiment simulation subsystem and complete machine experiment simulation subsystem, and described single module experiment simulation subsystem comprises register group module simulation unit, general-purpose register module simulation unit, computing unit module simulation unit, memory and bus module simulation unit, instruction component simulation unit, microprogram controller module simulation unit and timing and start-stop module simulation unit, the single-module experiment simulation unit The system includes: 初始化模块,用于设置各个对象是否可见,设置变量初始值,所述对象包括硬件芯片、操作开关和模块间信息通道,所述变量包括硬件芯片值、操作开关的信号值、信息通路上信号值、操作开关代表的控制信号含义、信息传输的方向;开关按钮检测模块,用于在flash中按钮元件为自动检测,会激发动作,在该动作中编写代码,判断是数据开关还是控制信号开关;The initialization module is used to set whether each object is visible, and to set the initial value of the variable. The object includes the hardware chip, the operation switch and the information channel between the modules. The variable includes the value of the hardware chip, the signal value of the operation switch, and the signal value on the information path , The meaning of the control signal represented by the operation switch, and the direction of information transmission; the switch button detection module is used for automatic detection of the button element in the flash, which will trigger an action, write code in this action, and judge whether it is a data switch or a control signal switch; 数据开关操作模块,用于显示数据输入到实验模块的信息流动动画,并将数据开关值赋值给模块硬件芯片值;The data switch operation module is used to display the information flow animation of data input to the experimental module, and assign the data switch value to the module hardware chip value; 开关动作操作模块,用于根据该模块信号的定义,判断控制信号对实验模块是否有效,如有效,则执行模块的功能代码,完成要求的功能。若不是,则模块不运行;The switch action operation module is used to judge whether the control signal is valid for the experimental module according to the definition of the module signal, and if it is valid, execute the function code of the module to complete the required function. If not, the module does not run; 所述整机实验仿真子系统包括:The complete machine experiment simulation subsystem includes: 初始化模块,用于初始化整机界面上所有对象及变量;The initialization module is used to initialize all objects and variables on the whole machine interface; 运行模式识别模块,用于检测运行按钮,判断是按下微单步按钮还是全速按钮,设置运行模式标志变量;The running mode identification module is used to detect the running button, judge whether to press the micro single step button or the full speed button, and set the running mode flag variable; 取指令模块,用于将值赋值给内存当前地址值,根据内存当前地址值查内存数据数组,得到内存当前数据值,将此值传送到指令寄存器;内存当前地址值、内存当前数据值、指令寄存器值用显示灯显示;The instruction fetch module is used to assign the value to the current address value of the memory, check the memory data array according to the current address value of the memory, obtain the current data value of the memory, and transfer this value to the instruction register; the current address value of the memory, the current data value of the memory, the instruction The register value is displayed by the indicator light; 分析指令模块,用于根据指令寄存器的值查表得到该指令对应的微程序的微地址,把微地址作为微程序存储器数组的下标,查找到微程序的第1条微指令,微指令中的代码即为各模块的控制信号,根据微指令代码,给涉及到的模块送控制信号,模块根据控制信号完成相应的功能;显示灯显示微指令值、微地址值、各模块控制信号灯值;The analysis command module is used to obtain the micro-address of the micro-program corresponding to the command according to the value of the command register, and use the micro-address as the subscript of the micro-program memory array to find the first micro-command of the micro-program. The code of each module is the control signal of each module. According to the micro-command code, the control signal is sent to the modules involved, and the module completes the corresponding function according to the control signal; the display lamp displays the micro-command value, micro-address value, and the value of the control signal light of each module; 执行指令模块,用于根据取得的微指令,给各单模块剪辑传送控制信号,即各单模块剪辑得到控制信号组合,若控制信号有效,则该模块实现自身的功能,执行结果体现在硬件芯片的变量中。The execution command module is used to transmit control signals to each single module editing according to the obtained micro instructions, that is, each single module editing obtains a combination of control signals. If the control signal is valid, the module realizes its own function, and the execution result is reflected in the hardware chip. in the variable. 2、如权利要求1所述的一种《计算机组成原理》仿真实验系统,其特征在于:所述的寄存器组模块仿真单元、通用寄存器发模块仿真单元、运算器模块仿真单元、存储器和总线模块仿真单元、指令部件仿真单元、微程序控制器模块仿真单元和时序和启停模块仿真单元采用flashActionscript_开发,发布为HTML形式,实验系统的组织采用HTML超链接形式连接。2, a kind of "computer composition principle" simulation experiment system as claimed in claim 1, is characterized in that: described register set module simulation unit, general register send module simulation unit, computing unit module simulation unit, memory and bus module The simulation unit, instruction component simulation unit, microprogram controller module simulation unit and timing and start-stop module simulation unit are developed with flashActionscript_ and published in HTML format. The organization of the experimental system is connected in the form of HTML hyperlinks.
CN2008100609599A 2008-04-11 2008-04-11 A 'computer composition principle' simulation experimental system Expired - Fee Related CN101261783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100609599A CN101261783B (en) 2008-04-11 2008-04-11 A 'computer composition principle' simulation experimental system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100609599A CN101261783B (en) 2008-04-11 2008-04-11 A 'computer composition principle' simulation experimental system

Publications (2)

Publication Number Publication Date
CN101261783A true CN101261783A (en) 2008-09-10
CN101261783B CN101261783B (en) 2010-07-07

Family

ID=39962216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100609599A Expired - Fee Related CN101261783B (en) 2008-04-11 2008-04-11 A 'computer composition principle' simulation experimental system

Country Status (1)

Country Link
CN (1) CN101261783B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591776A (en) * 2011-12-30 2012-07-18 苏州汉清投资管理有限公司 System for automatically generating codes
CN103295461A (en) * 2013-05-13 2013-09-11 西安电子科技大学 Experimental microprocessor and experimental method for same
CN104269098A (en) * 2014-10-13 2015-01-07 上海交通大学 System for enhancing sense of immediacy of network experiment wire connection
CN105047044A (en) * 2015-09-15 2015-11-11 华北理工大学 Computer principle practical teaching method
CN105930584A (en) * 2016-04-19 2016-09-07 安徽大学 Virtual experiment platform of computer organization and system structure and realization method for virtual experiment platform
TWI558148B (en) * 2015-05-07 2016-11-11 緯創資通股份有限公司 Method for showing address information and electronic device using the same
CN111390908A (en) * 2020-03-26 2020-07-10 哈尔滨工业大学 A web-based virtual dragging method for robotic arms

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1612160A (en) * 2003-10-31 2005-05-04 上海科技馆 Method for stimulating experiment via computer

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591776A (en) * 2011-12-30 2012-07-18 苏州汉清投资管理有限公司 System for automatically generating codes
CN103295461A (en) * 2013-05-13 2013-09-11 西安电子科技大学 Experimental microprocessor and experimental method for same
CN103295461B (en) * 2013-05-13 2015-06-03 西安电子科技大学 Experimental microprocessor
CN104269098A (en) * 2014-10-13 2015-01-07 上海交通大学 System for enhancing sense of immediacy of network experiment wire connection
CN104269098B (en) * 2014-10-13 2016-05-25 上海交通大学 Strengthen the system of network experiment line telepresenc
TWI558148B (en) * 2015-05-07 2016-11-11 緯創資通股份有限公司 Method for showing address information and electronic device using the same
CN105047044A (en) * 2015-09-15 2015-11-11 华北理工大学 Computer principle practical teaching method
CN105047044B (en) * 2015-09-15 2018-03-09 华北理工大学 Computer Organization Principles practice teaching method
CN105930584A (en) * 2016-04-19 2016-09-07 安徽大学 Virtual experiment platform of computer organization and system structure and realization method for virtual experiment platform
CN105930584B (en) * 2016-04-19 2019-03-26 安徽大学 A kind of Virtual Experiment Platform Based and its implementation of computer composition and system structure
CN111390908A (en) * 2020-03-26 2020-07-10 哈尔滨工业大学 A web-based virtual dragging method for robotic arms
CN111390908B (en) * 2020-03-26 2022-05-17 哈尔滨工业大学 Webpage-based mechanical arm virtual dragging method

Also Published As

Publication number Publication date
CN101261783B (en) 2010-07-07

Similar Documents

Publication Publication Date Title
CN101261783B (en) A 'computer composition principle' simulation experimental system
CN113961453B (en) Aviation airborne software full digital simulation test system
CN104050080B (en) User space debugs the method and system of linux kernel
CN101706750B (en) Detective pole acquiring method based on embedded type simulator
CN102073480B (en) Method for simulating cores of multi-core processor by adopting time division multiplex
Black et al. A full system x86 simulator for teaching computer organization
Nova et al. Tool to support computer architecture teaching and learning
JP5118562B2 (en) Debugging support device
JP2888242B2 (en) Microprocessor program development system
Goossens Installing and Using the RISC-V Tools
Topaloglu et al. A highly interactive PC based simulator tool for teaching microprocessor architecture and assembly language programming
CN116089019B (en) Hexagon architecture-oriented fine-grained CPU simulator
CN110321171A (en) Be switched on detection device, system and method
US20060178863A1 (en) Combining and representing signals of a hardware simulation device and elements of a program listing
CN101615209B (en) Processor Verification Method Based on Memory Monitoring
JP2018026067A (en) Simulation apparatus and connection information generation method in the same apparatus
Mantu et al. Approaches to teaching embedded development
Liu et al. SWEVM: a software EVM for embedded system programming
Chaver et al. The RISC-V FPGA (RVfpga) Teaching Package
Qian et al. Introduction to Embedded Systems
Dupák Graphical RISC-V Architecture Simulator
CN114676064A (en) General test system and method for hardware language code
CN115935876A (en) FPGA circuit analog simulation method and device
Gladstone Comparing Microcomputer Development System Capabilities
KR101654194B1 (en) AVR software system and the method of control

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100707

Termination date: 20130411