[go: up one dir, main page]

CN109829192B - Reference model construction method and device for processor computing unit - Google Patents

Reference model construction method and device for processor computing unit Download PDF

Info

Publication number
CN109829192B
CN109829192B CN201811603788.XA CN201811603788A CN109829192B CN 109829192 B CN109829192 B CN 109829192B CN 201811603788 A CN201811603788 A CN 201811603788A CN 109829192 B CN109829192 B CN 109829192B
Authority
CN
China
Prior art keywords
model
module
computing
processor
function
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.)
Active
Application number
CN201811603788.XA
Other languages
Chinese (zh)
Other versions
CN109829192A (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.)
Hexin Technology Suzhou Co ltd
Original Assignee
Hexin Technology Suzhou Co ltd
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 Hexin Technology Suzhou Co ltd filed Critical Hexin Technology Suzhou Co ltd
Priority to CN201811603788.XA priority Critical patent/CN109829192B/en
Publication of CN109829192A publication Critical patent/CN109829192A/en
Application granted granted Critical
Publication of CN109829192B publication Critical patent/CN109829192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a reference model construction method and a device for a processor computing unit, wherein the method comprises the following steps: acquiring a calculation function instruction, a control function and an interface function of a processor calculation unit; establishing a calculation model of a processor calculation unit according to the calculation function instruction; configuring a control model of the calculation model according to the control function; and configuring a model interface of the calculation model according to the interface function, and generating a reference model of the processor calculation unit. By implementing the application, the reference model established according to the actual calculation function instruction, the control function and the interface function has good consistency with the calculation unit in the real processor, so that the complete simulation verification of the calculation process of all calculation instructions in the calculation unit can be realized, and the problem of difficult function verification of the calculation unit can be solved by utilizing the reference model.

Description

一种处理器计算单元的参考模型构建方法及装置A reference model construction method and device for a processor computing unit

技术领域Technical field

本发明涉及计算机领域,具体涉及一种处理器计算单元的参考模型构建方法及装置。The invention relates to the field of computers, and in particular to a reference model construction method and device for a processor computing unit.

背景技术Background technique

在处理器设计中,矢量标量计算单元简称计算单元是最体现处理器计算能力的功能单元,其功能复杂(包含简单定/浮点计算、复杂定/浮点计算、数据置换、定浮点转换、除法/平方根计算、估值计算、十进制浮点计算、加密计算以及内部的指令译码、控制流、数据流实现等),指令集的大部分计算指令都要在其中实现;因此对计算单元进行功能验证也一直是个难题,在计算单元功能验证中如何能有一个计算精确、功能完整的参考模型则是解决问题的关键。传统的MCU类模型不支持复杂计算功能指令的验证如浮点、矢量计算,而依赖外部硬件装置的参考模型可能会支持复杂如浮点、矢量类计算,但是只能提供结果,并不能直观的对数据流、控制流加以控制模拟,不能完整的验证指令计算的过程。In the design of the processor, the vector scalar computing unit, referred to as the computing unit, is the functional unit that best reflects the computing power of the processor. Its functions are complex (including simple fixed/floating point calculations, complex fixed/floating point calculations, data replacement, fixed and floating point conversions). , division/square root calculation, valuation calculation, decimal floating point calculation, encryption calculation and internal instruction decoding, control flow, data flow implementation, etc.), most of the calculation instructions of the instruction set must be implemented in it; therefore, for the computing unit Functional verification has always been a difficult problem. How to have a reference model with accurate calculation and complete functions in the functional verification of computing units is the key to solving the problem. Traditional MCU class models do not support the verification of complex computing function instructions such as floating point and vector calculations. Reference models that rely on external hardware devices may support complex calculations such as floating point and vector calculations, but they can only provide results and are not intuitive. Controlling and simulating the data flow and control flow cannot completely verify the instruction calculation process.

发明内容Contents of the invention

本发明实施例提供了一种处理器计算单元的参考模型构建方法及装置,以克服现有技术中的计算单元的参考模型所实现的验证功能单一,无法对计算单元中所有的计算指令的计算过程进行完整验证的问题。Embodiments of the present invention provide a reference model construction method and device for a processor computing unit to overcome the single verification function implemented by the reference model of the computing unit in the prior art and the inability to calculate all computing instructions in the computing unit. The process is fully verified.

本发明实施例提供了一种处理器计算单元的参考模型构建方法,包括:获取处理器计算单元的计算功能指令、控制功能及接口功能;根据所述计算功能指令建立所述处理器计算单元的计算模型;根据所述控制功能配置所述计算模型的控制模型;根据所述接口功能配置所述计算模型的模型接口,生成处理器计算单元的参考模型。Embodiments of the present invention provide a reference model construction method for a processor computing unit, which includes: obtaining computing function instructions, control functions and interface functions of the processor computing unit; establishing a reference model of the processor computing unit according to the computing function instructions. A computing model; a control model that configures the computing model according to the control function; a model interface that configures the computing model according to the interface function and generates a reference model of the processor computing unit.

可选地,所述根据所述计算功能指令建立所述处理器计算单元的计算模型,包括:获取各个所述计算功能指令的参数信息;根据各所述参数信息,分别建立各计算功能指令的指令模型;将各所述指令模型按照所对应的各所述计算指令进行集成,生成所述计算模型。Optionally, establishing a computing model of the processor computing unit according to the computing function instructions includes: obtaining parameter information of each computing function instruction; and establishing a computing model of each computing function instruction based on each of the parameter information. Instruction model: integrate each of the instruction models according to the corresponding computing instructions to generate the computing model.

可选地,所述根据所述计算功能指令建立所述处理器计算单元的计算模型,还包括:采用真实处理器对所述计算模型进行验证;当验证未通过时,返回所述根据各所述参数信息,分别建立各计算功能指令的指令模型的步骤。Optionally, establishing the computing model of the processor computing unit according to the computing function instructions further includes: using a real processor to verify the computing model; when the verification fails, returning the computing model according to each The above parameter information is used to establish the steps of instruction model for each calculation function instruction.

可选地,所述根据所述计算功能指令建立所述处理器计算单元的计算模型,还包括:当验证通过时,返回所述根据所述控制功能配置所述计算模型的控制模型的步骤。Optionally, establishing the computing model of the processor computing unit according to the computing function instructions further includes: when the verification is passed, returning to the step of configuring the control model of the computing model according to the control function.

可选地,所述处理器计算单元的参考模型构建方法还包括:对所述参考模型的所述模型接口进行仿真验证;当所述仿真验证未通过时,返回所述根据所述计算功能指令建立所述处理器计算单元的计算模型的步骤。Optionally, the reference model construction method of the processor computing unit also includes: performing simulation verification on the model interface of the reference model; when the simulation verification fails, returning the calculation function instruction according to the The step of establishing a computing model of the processor computing unit.

可选地,所述处理器计算单元的参考模型构建方法还包括:当所述仿真验证通过时,将通过所述仿真验证的参考模型确定为所述处理器计算单元的参考模型。Optionally, the reference model construction method of the processor computing unit further includes: when the simulation verification passes, determining the reference model that passes the simulation verification as the reference model of the processor computing unit.

可选地,所述处理器计算单元的参考模型构建方法还包括:获取所述处理器计算单元的验证功能需求;根据所述验证功能需求为所述参考模型配置功能验证接口。Optionally, the reference model construction method of the processor computing unit further includes: obtaining verification functional requirements of the processor computing unit; and configuring a functional verification interface for the reference model according to the verification functional requirements.

本发明实施例还提供了一种处理器计算单元的参考模型构建装置,包括:功能获取模块,用于获取处理器计算单元的计算功能指令、控制功能及接口功能;计算模型构建模块,用于根据所述计算功能指令建立所述处理器计算单元的计算模型;控制模型配置模块,用于根据所述控制功能配置所述计算模型的控制模型;模型接口配置模块,用于根据所述接口功能配置所述计算模型的模型接口,生成处理器计算单元的参考模型。Embodiments of the present invention also provide a reference model construction device for a processor computing unit, including: a function acquisition module for obtaining computing function instructions, control functions and interface functions of the processor computing unit; and a computing model construction module for Establish a computing model of the processor computing unit according to the computing function instructions; a control model configuration module for configuring the control model of the computing model according to the control function; a model interface configuration module for configuring the control model according to the interface function Configure the model interface of the computing model and generate a reference model of the processor computing unit.

本发明实施例还提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行上述的处理器计算单元的参考模型构建方法。Embodiments of the present invention also provide a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions. The computer instructions are used to cause the computer to execute the above-mentioned processor calculation unit. Reference model construction method.

本发明实施例还提供了一种计算机设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行上述的处理器计算单元的参考模型构建方法。An embodiment of the present invention also provides a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions that can be executed by the at least one processor, The instructions are executed by the at least one processor, so that the at least one processor executes the above-mentioned reference model construction method of the processor computing unit.

本发明技术方案,具有如下优点:The technical solution of the present invention has the following advantages:

本发明实施例提供了一种处理器计算单元的参考模型构建方法,该方法通过根据处理器计算单元的计算功能指令建立处理器计算单元的计算模型,并根据该计算单元的控制功能和接口功能依次为上述计算模型配置相应的控制模型和模型接口,进而建立该处理器计算单元的参考模型。从而通过对依据实际计算功能指令、控制功能和接口功能所建立的参考模型,所建立的参考模型与真实处理器中的计算单元具有良好的一致性,可以实现对计算单元中所有计算指令的计算过程进行完整模拟验证,进而可以利用该参考模型解决对计算单元功能验证困难的问题。Embodiments of the present invention provide a method for building a reference model of a processor computing unit. The method establishes a computing model of the processor computing unit according to the computing function instructions of the processor computing unit, and establishes a computing model based on the control function and interface function of the computing unit. Configure the corresponding control model and model interface for the above computing model in turn, and then establish a reference model of the processor computing unit. Therefore, through the reference model established based on the actual computing function instructions, control functions and interface functions, the established reference model has good consistency with the computing unit in the real processor, and the calculation of all computing instructions in the computing unit can be realized. The process is fully simulated and verified, and the reference model can be used to solve the difficult problem of verifying the function of the computing unit.

附图说明Description of the drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description The drawings illustrate some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting any creative effort.

图1为本发明实施例中处理器计算单元的参考模型构建方法的流程图;Figure 1 is a flow chart of a reference model construction method of a processor computing unit in an embodiment of the present invention;

图2为本发明实施例中根据计算功能指令建立处理器计算单元的计算模型的具体流程图;Figure 2 is a specific flow chart for establishing a computing model of a processor computing unit according to computing function instructions in an embodiment of the present invention;

图3为本发明实施例中处理器计算单元的参考模型构建方法的另一流程图;Figure 3 is another flow chart of a reference model construction method of a processor computing unit in an embodiment of the present invention;

图4为本发明实施例中参考模型的结构示意图;Figure 4 is a schematic structural diagram of the reference model in the embodiment of the present invention;

图5为本发明实施例中处理器计算单元的参考模型构建装置的结构示意图;Figure 5 is a schematic structural diagram of a reference model construction device of a processor computing unit in an embodiment of the present invention;

图6为本发明实施例中计算机设备的结构示意图。Figure 6 is a schematic structural diagram of a computer device in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

实施例1Example 1

本发明实施例提供了一种处理器计算单元的参考模型构建方法,如图1所示,该处理器计算单元的参考模型构建方法包括:An embodiment of the present invention provides a reference model construction method for a processor computing unit. As shown in Figure 1, the reference model construction method for a processor computing unit includes:

步骤S1:获取处理器计算单元的计算功能指令、控制功能及接口功能。具体地,在实际应用中,处理器中计算单元根据其功能实现可分为计算类功能和控制类功能,例如:标量定、浮点计算指令、矢量定浮点计算指令等指令属于计算类指令,指令译码、数据流控制、状态位更新等属于控制类功能。Step S1: Obtain the computing function instructions, control functions and interface functions of the processor computing unit. Specifically, in practical applications, the computing unit in the processor can be divided into computing functions and control functions according to its functional implementation. For example, instructions such as scalar fixed, floating point computing instructions, vector fixed floating point computing instructions, etc. belong to computing instructions. , instruction decoding, data flow control, status bit update, etc. are control functions.

步骤S2:根据计算功能指令建立处理器计算单元的计算模型。根据上述计算单元中的每条计算功能指令,根据预设指令集中设定的格式,定义各个计算功能指令的函数接口,并采用相应的指令函数实现各个指令的功能,完成相关计算和状态位的产生,最后将各个指令集成起来,并实现译码及独立调用,从而建立该计算单元的计算模型。Step S2: Establish a computing model of the processor computing unit according to the computing function instructions. According to each computing function instruction in the above-mentioned computing unit, the function interface of each computing function instruction is defined according to the format set in the preset instruction set, and the corresponding instruction function is used to implement the function of each instruction to complete the relevant calculations and status bits. Generate, and finally integrate each instruction, and implement decoding and independent calling, thereby establishing the computing model of the computing unit.

步骤S3:根据控制功能配置计算模型的控制模型。在实际应用中,上述的计算模型在实现相应计算功能指令时,需要确定数据源的获取位置、数据的流向及计算结果的存储位置等,这些操作通常通过上述的控制功能实现,具体地,根据处理器计算单元在实际应用过程中各计算功能指令的执行过程中所需要的相应的控制功能进行控制,将各个控制功能采用相应的控制函数实现,并将各控制函数构成的控制模型与上述的计算模型集成起来,形成功能完整的计算模型。Step S3: Configure the control model of the calculation model according to the control function. In practical applications, when the above-mentioned computing model implements corresponding computing function instructions, it is necessary to determine the acquisition location of the data source, the flow direction of the data, and the storage location of the calculation results. These operations are usually implemented through the above-mentioned control functions. Specifically, according to The processor computing unit controls the corresponding control functions required during the execution of each computing function instruction in the actual application process, uses corresponding control functions to implement each control function, and combines the control model composed of each control function with the above-mentioned The computing models are integrated to form a fully functional computing model.

步骤S4:根据接口功能配置计算模型的模型接口,生成处理器计算单元的参考模型。在实际应用中,为了使得最终建立的参考模型能够完全模拟处理器计算单元,需要使得上述计算模型的模型接口与处理器计算单元的实际接口保持一致,根据上述计算单元的接口功能来配置上述计算模型的模型接口,得到与处理器计算单元完全等价的参考模型。Step S4: Configure the model interface of the computing model according to the interface function, and generate a reference model of the processor computing unit. In practical applications, in order for the finally established reference model to fully simulate the processor computing unit, the model interface of the above-mentioned computing model needs to be consistent with the actual interface of the processor computing unit, and the above-mentioned calculations are configured according to the interface functions of the above-mentioned computing unit. The model interface of the model obtains a reference model that is completely equivalent to the processor computing unit.

通过上述步骤S1至步骤S4,本发明实施例的处理器计算单元的参考模型构建方法,通过根据处理器计算单元的计算功能指令建立处理器计算单元的计算模型,并根据该计算单元的控制功能和接口功能依次为上述计算模型配置相应的控制模型和模型接口,进而建立该处理器计算单元的参考模型。从而通过对依据实际计算功能指令、控制功能和接口功能所建立的参考模型,所建立的参考模型与真实处理器中的计算单元具有良好的一致性,可以实现对计算单元中所有计算指令的计算过程进行完整模拟验证,进而可以利用该参考模型解决对计算单元功能验证困难的问题。Through the above steps S1 to S4, the reference model construction method of the processor computing unit according to the embodiment of the present invention establishes the computing model of the processor computing unit according to the computing function instructions of the processor computing unit, and establishes the computing model according to the control function of the computing unit. and interface functions in turn configure the corresponding control model and model interface for the above computing model, and then establish a reference model of the processor computing unit. Therefore, through the reference model established based on the actual computing function instructions, control functions and interface functions, the established reference model has good consistency with the computing unit in the real processor, and the calculation of all computing instructions in the computing unit can be realized. The process is fully simulated and verified, and the reference model can be used to solve the difficult problem of verifying the function of the computing unit.

具体地,在一实施例中,上述的步骤S1,获取处理器计算单元的计算功能指令、控制功能及接口功能。在实际应用中,处理器计算单元的功能复杂,既包含有标量计算也包括矢量运算,既有定点运算也有浮点运算,按照功能可以将该计算单元所执行的操作分为计算类指令和控制类功能。Specifically, in one embodiment, the above-mentioned step S1 obtains the computing function instructions, control functions and interface functions of the processor computing unit. In practical applications, the functions of the processor computing unit are complex, including both scalar calculations and vector operations, both fixed-point operations and floating-point operations. According to the functions, the operations performed by the computing unit can be divided into calculation instructions and control class function.

在一较佳实施例中,如图2所示,上述的步骤S2,根据计算功能指令建立处理器计算单元的计算模型,具体包括:In a preferred embodiment, as shown in Figure 2, the above-mentioned step S2 establishes a computing model of the processor computing unit according to the computing function instructions, which specifically includes:

步骤S21:获取各个计算功能指令的参数信息。在实际应用中,每一个计算功能指令的参数信息包括该计算功能指令所实现的计算功能信息、规定的数据格式信息及该指令相应的指令接口信息等。Step S21: Obtain parameter information of each computing function instruction. In practical applications, the parameter information of each computing function instruction includes the computing function information implemented by the computing function instruction, the specified data format information, the corresponding instruction interface information of the instruction, etc.

步骤S22:根据各参数信息,分别建立各计算功能指令的指令模型。具体地,在实际应用中可以根据上述的参数信息采用C语言进行函数编程,以实现该计算功能指令的计算功能。以简单定点/浮点计算单元中的加法运算指令为例,该加法运算指令在指令集中的指令序列号的格式为{[0:5],[6:10],[11:15],[16:20],[21:31]}={4,VRT,VRA,VRB,384},然后定义该指令的函数接口(如需要上述指令序列号进行译码后的信息、状态寄存器、物理寄存器等等),并用C函数实现该指令功能,完成相关计算和状态位产生,进而完成该加法运算指令的指令模型。具体地,上述各个计算功能指令的C函数实现为现有技术,在此不再赘述。Step S22: Establish instruction models for each computing function instruction based on each parameter information. Specifically, in practical applications, C language can be used to perform function programming based on the above parameter information to realize the calculation function of the calculation function instruction. Taking the addition instruction in a simple fixed-point/floating-point computing unit as an example, the instruction sequence number format of the addition instruction in the instruction set is {[0:5],[6:10],[11:15],[ 16:20],[21:31]}={4,VRT,VRA,VRB,384}, and then define the function interface of the instruction (such as the decoded information, status register, and physical register that require the above instruction sequence number etc.), and use C functions to implement the instruction function, complete relevant calculations and status bit generation, and then complete the instruction model of the addition operation instruction. Specifically, the C function implementation of each of the above calculation function instructions is an existing technology and will not be described again here.

步骤S23:将各指令模型按照所对应的各计算指令进行集成,生成计算模型。在实际应用中将上述实现的各个计算功能指令按照所实现的功能集成起来,具体地,该集成方式通过统一的指令译码、各执行流水线结构、统一的寄存器资源调度这种架构来集成起来,得到所述计算单元参考模型并对各个计算功能指令实现译码以及独立调用,上述所有计算功能指令整体集成后构成了上述的计算模型。Step S23: Integrate each instruction model according to each corresponding computing instruction to generate a computing model. In practical applications, the various computing function instructions implemented above are integrated according to the functions implemented. Specifically, the integration method is integrated through a unified instruction decoding, execution pipeline structure, and unified register resource scheduling architecture. The computing unit reference model is obtained and each computing function instruction is decoded and independently called. All the above computing function instructions are integrated to form the above computing model.

步骤S24:采用真实处理器对计算模型进行验证。在实际应用中,上述的处理器计算单元为Power服务器真机中的处理器,上述计算模型中所实现的各个计算功能指令均已在Power服务器真机中实现,因此,可以通过与Power服务器真机指令进行理论值校对的方式,来判断上述的建立的计算模型所实现的各个计算功能指令是否与实际处理器计算单元相一致。具体地,以上述的加法运算指令为例,power服务器真机已经实现了该指令,可以大量随机源操作数VRA和VRB均输入到计算模型和Power服务器真机中,看二者的目的操作数VRT和系统状态寄存器结果是否一致,从而实现对上述计算模型的准确性进行验证。如果验证通过,则执行步骤S3。Step S24: Use a real processor to verify the computing model. In practical applications, the above-mentioned processor computing unit is the processor in the Power server real machine. Each computing function instruction implemented in the above computing model has been implemented in the Power server real machine. Therefore, it can be used with the Power server real machine. The computer instructions perform theoretical value verification to determine whether each computing function instruction implemented by the above-mentioned computing model is consistent with the actual processor computing unit. Specifically, taking the above addition operation instruction as an example, the power server real machine has already implemented this instruction. A large number of random source operands VRA and VRB can be input into the computing model and the Power server real machine to see the destination operands of both. Whether the VRT and system status register results are consistent, thereby verifying the accuracy of the above calculation model. If the verification passes, step S3 is executed.

当验证未通过时,返回步骤S22。在实际应用中,如果采用真实处理器对上述的计算模型进行验证后,验证未通过,则说明该计算模型与真实处理器计算单元所实现的计算功能指令有误差,则需要分析原因后,重新建立各计算功能指令的指令模型,更正相关的操作,直到所建立的计算模型通过真实处理器的验证,从而保障了所建立的计算模型与真实处理器的一致性,为后续对真实处理器计算单元进行功能验证提供准确的模型基础。When the verification fails, return to step S22. In practical applications, if a real processor is used to verify the above calculation model and the verification fails, it means that there is an error between the calculation model and the calculation function instructions implemented by the calculation unit of the real processor, and it is necessary to analyze the reasons and re- Establish the instruction model of each computing function instruction and correct the relevant operations until the established computing model passes the verification of the real processor, thereby ensuring the consistency between the established computing model and the real processor, and providing a basis for subsequent calculations of the real processor Units provide an accurate model basis for functional verification.

具体地,在一实施例中,上述的步骤S3,根据控制功能配置计算模型的控制模型。在实际应用中,上述的控制功能包括:流水线控制、旁路控制、状态寄存器的读写控制、状态位更新等功能,将各个控制功能参照上述的计算功能指令用C函数实现,以得到上述计算模型的控制模型。Specifically, in one embodiment, the above-mentioned step S3 configures the control model of the calculation model according to the control function. In practical applications, the above control functions include: pipeline control, bypass control, status register read and write control, status bit update and other functions. Each control function is implemented with a C function by referring to the above calculation function instructions to obtain the above calculation The control model of the model.

具体地,在一实施例中,上述的步骤S4,根据接口功能配置计算模型的模型接口,生成处理器计算单元的参考模型。在实际应用中,为了得到与处理器计算单元完全等效的参考模型,需要参照处理器计算单元的接口功能,通过选择相应的配置参数,定义相同的数据压缩格式将上述计算模型和控制模型的接口信号打包并互联,形成与处理器计算单元接口一种的参考模型。通过上述定义统一的接口、参数及其数据结构,将上述实现的控制模型和计算模型集成起来,从而形成一个完整功能的参考模,并且该参考模型接口与处理器计算单元的接口保持一致。Specifically, in one embodiment, the above-mentioned step S4 configures the model interface of the computing model according to the interface function to generate a reference model of the processor computing unit. In practical applications, in order to obtain a reference model that is completely equivalent to the processor calculation unit, it is necessary to refer to the interface function of the processor calculation unit, select the corresponding configuration parameters, and define the same data compression format to combine the above calculation model and control model. The interface signals are packaged and interconnected to form a reference model for the interface with the processor computing unit. Through the unified interfaces, parameters and data structures defined above, the control model and computing model implemented above are integrated to form a complete functional reference model, and the reference model interface is consistent with the interface of the processor computing unit.

在一较佳实施例中,如图3所示,上述的处理器计算单元的参考模型构建方法,还包括:In a preferred embodiment, as shown in Figure 3, the above-mentioned reference model construction method of the processor computing unit also includes:

步骤S5:对参考模型的模型接口进行仿真验证。在实际应用中,为了保障所建立的参考模型的接口与处理器计算单元的接口相一致,需要通过现有的仿真平台对上述参考模型的功能进行仿真验证。Step S5: Perform simulation verification on the model interface of the reference model. In practical applications, in order to ensure that the interface of the established reference model is consistent with the interface of the processor computing unit, the functions of the above reference model need to be simulated and verified through the existing simulation platform.

步骤S6:当仿真验证通过,将通过仿真验证的参考模型确定为处理器计算单元的参考模型。则说明该参考模型即为处理器计算单元的相一致的参考模型,可以将该参考模型用于对处理器计算单元进行仿真/形式验证应用当中。对该参考模型进行仿真调用,与处理器计算单元所实现的功能一致。Step S6: When the simulation verification is passed, the reference model that has passed the simulation verification is determined as the reference model of the processor computing unit. This means that the reference model is a consistent reference model of the processor computing unit, and the reference model can be used for simulation/formal verification applications of the processor computing unit. The simulation call of this reference model is consistent with the functions implemented by the processor computing unit.

当仿真验证未通过时,返回步骤S2。在实际应用中,如果该仿真验证没有通过,则说明该参考模型的设计存在一定的误差,对该误差进行分析后,需要重新调整上述的计算模型,直至仿真验证通过。从而通过上述仿真验证的步骤进一步保障了最终生成的参考模型与处理器计算单元的一致性。When the simulation verification fails, return to step S2. In practical applications, if the simulation verification fails, it means that there is a certain error in the design of the reference model. After analyzing the error, the above calculation model needs to be readjusted until the simulation verification passes. Thus, the consistency of the finally generated reference model and the processor computing unit is further ensured through the above steps of simulation verification.

具体地,在实际应用中,如果将上述的参考模型应用到某个具体验证场景时,还可以位上述参考模型添加特定功能的接口,以适应实际验证场景,例如:输入、输出数据结构体的压缩格式等。Specifically, in actual applications, if the above reference model is applied to a specific verification scenario, interfaces with specific functions can also be added to the above reference model to adapt to the actual verification scenario, such as: input and output data structures Compression format, etc.

通过上述处理器计算单元的参考模型构建方法所建立的参考模型如图4所示,该参考模型的基本组成模块详细内容如下:The reference model established through the above reference model construction method of the processor computing unit is shown in Figure 4. The details of the basic component modules of the reference model are as follows:

输入信号接口模块(IOP_STRUCT),该模块是一个名为IOP_Desc的结构体,包括ISU发射的控制信号和LSU的data及相关信号。Input signal interface module (IOP_STRUCT), which is a structure named IOP_Desc, including the control signal transmitted by the ISU and the data and related signals of the LSU.

输出信号接口模块(VSU_OUT_STRUCT),该模块是一个名为VSU_OUT的结构体,包括指令执行状态、Store data输出和ecc error等输出信号。Output signal interface module (VSU_OUT_STRUCT), this module is a structure named VSU_OUT, including output signals such as instruction execution status, Store data output and ecc error.

指令译码模块(DECODE),由IOP的成员vs_route和vs_iop决定指令的译码,然后进入指令执行模块。Instruction decoding module (DECODE) determines the decoding of instructions by the IOP members vs_route and vs_iop, and then enters the instruction execution module.

数据通道控制模块(Data_flow_control),主要包括global bypass,localbypass等数据数据流向选择功能。The data channel control module (Data_flow_control) mainly includes data flow selection functions such as global bypass and localbypass.

指令执行模块(VSU),是指令功能执行,寄存器的存取等操作。操作过程由IOP信号控制。其由数据通道得到操作数,并将执行结果写回数据通道,指令执行状态通过上述的输出信号接口模块输出。The instruction execution module (VSU) is responsible for the execution of instruction functions and register access and other operations. The operating process is controlled by the IOP signal. It obtains the operand from the data channel and writes the execution result back to the data channel. The instruction execution status is output through the above-mentioned output signal interface module.

SAR模块实现SAR(软件架构寄存器)的功能,swap cast-in,swapcast-out,completion cast-out和sar bypass等功能。The SAR module implements the functions of SAR (software architecture register), swap cast-in, swapcast-out, completion cast-out and sar bypass.

VRF模块实现VRF(向量寄存器文件)的功能,vrf cast-in,vrf cast-out,load LU数据以及将结果写回VRF等功能。The VRF module implements the functions of VRF (vector register file), vrf cast-in, vrf cast-out, load LU data and write the results back to VRF and other functions.

错误检查和纠正模块(ECC),包括ECC gen和ECC check模块,主要对数据进行ECC处理。The error checking and correction module (ECC), including the ECC gen and ECC check modules, mainly performs ECC processing of data.

FMT模块,对输入的LU数据进行格式化处理再加载进数据管道,对输出的数据进行格式化处理再输出。The FMT module formats the input LU data and then loads it into the data pipeline, and formats the output data before outputting it.

以下将结合具体应用过程对上述的处理器计算单元的参考模型构建方法所参考和使用的相关信息进行进一步的说明。The relevant information referenced and used in the above reference model construction method of the processor computing unit will be further described below in conjunction with the specific application process.

功能完整性的保留:矢量标量计算单元,通常会集成在core(处理器内核)内部,功能包括指令集中对应指令的RTL实现、FMT数据格式化、ECC、内部寄存器文件(VRF、SAR)数据流控制(local_bypass、global_bypass)、译码等功能。Retention of functional integrity: The vector scalar computing unit is usually integrated inside the core (processor core). Its functions include RTL implementation of corresponding instructions in the instruction set, FMT data formatting, ECC, and internal register file (VRF, SAR) data flow. Control (local_bypass, global_bypass), decoding and other functions.

所采用的计算机建模语言:用软件语言给硬件RTL实现的计算单元建立非周期精确的功能参考模型,其功能仿真几乎不会占用整体仿真的时间;用DPI接口(DirectProgramming interface,直接编程接口)进行深度检测,通过对报文的有效载荷检测决定其合法性)即可与systemverilog(简称为SV语言,是一种建立在Verilog语言的基础上的语言)的验证环境对接,访问共享内存区的数据。在本发明实施例中采用C语言实现的计算单元建模,能很方便的用目标架构服务器真机(例如Power服务器)利用内嵌汇编指令调用实际的指令集来校准核对,核对完成后,这个C模型模拟的就是准确的、要实现的指令功能。Computer modeling language used: Use software language to establish aperiodic accurate functional reference models for computing units implemented by hardware RTL, and its functional simulation will hardly take up the overall simulation time; use DPI interface (Direct Programming interface, direct programming interface) Perform in-depth inspection and determine its legality by inspecting the payload of the message), which can be connected to the verification environment of systemverilog (referred to as SV language, which is a language based on the Verilog language), and access the shared memory area. data. In the embodiment of the present invention, the computing unit modeling implemented in C language can be easily used to calibrate and verify the real machine of the target architecture server (such as Power server) using the embedded assembly instructions to call the actual instruction set. After the verification is completed, this The C model simulates the exact instruction function to be implemented.

矢量数据类型的处理:针对Power指令集中的128比特的矢量数据类型(矢量里基本数据类型支持定点、单双精度浮点),在C模型中对应的数据类型采用联合体实现,以方便各单指令多数据的指令使用。Processing of vector data types: For the 128-bit vector data type in the Power instruction set (the basic data type in the vector supports fixed point, single and double precision floating point), the corresponding data type in the C model is implemented by a union to facilitate each unit. Instructions with multiple data are used.

计算功能指令的正确性校准:在建立参考模型前,会提前把矢量标量计算指令中(指令集相应指令功能的C实现)用Power服务器校准好,具体地校准过程为现有技术,在此不再进行赘述。Correctness calibration of calculation function instructions: Before establishing the reference model, the vector scalar calculation instructions (the C implementation of the corresponding instruction function of the instruction set) will be calibrated in advance using the Power server. The specific calibration process is an existing technology and will not be discussed here. Let’s go into details.

参考模型的输入输出数据类型:在本发明实施例中,计算单元参考模型采用C实现;输入输出信号采用结构体实现,为了后续验证方便,输出结构体里采用内嵌结构体数组的形式,把VRF和SAR这种大量数据的寄存器阵列全部从输出结构体输出,如图4中的虚线所示,方便验证平台能查询矢量标量计算单元的所有内部理论值。Input and output data types of the reference model: In the embodiment of the present invention, the computing unit reference model is implemented in C; the input and output signals are implemented in a structure. For the convenience of subsequent verification, the output structure is in the form of an embedded structure array. Register arrays with a large amount of data such as VRF and SAR are all output from the output structure, as shown by the dotted line in Figure 4, which facilitates the verification platform to query all internal theoretical values of the vector scalar calculation unit.

参考模型的数据规划:在本发明实施例中的参考模型的接口的结构体数据的设计;考虑到DPI接口上systemverilog侧的信号类型、位宽,以及C函数侧的基本数据类型、以及VRF和SAR这种大量数据的寄存器阵列结构体数组;采用如下接口数据结构:数据大小小于4byte的数据统一用4byte的数据类型;结构体元素最大的放在结构体的最前面,小的放在后面,元素顺序固定后,方便systemverilog侧合理安排其数据结构。Data planning of the reference model: the design of the structural data of the interface of the reference model in the embodiment of the present invention; taking into account the signal type and bit width on the systemverilog side of the DPI interface, as well as the basic data type on the C function side, as well as VRF and SAR is a register array structure array with a large amount of data; the following interface data structure is used: data with a data size less than 4 bytes uniformly uses the 4 byte data type; the largest structure element is placed at the front of the structure, and the small one is placed at the back. After the order of elements is fixed, it is convenient for the systemverilog side to arrange its data structure reasonably.

参考模型的使用:依据本发明实施例提供的处理器计算单元的参考模型构建方法构建的参考模型,可以直接用DPI接口与systemverilog验证环境对接、调用;仿真中在流水线多次调用后,VRF能存储所有的计算结果;systemverilog侧能方便的访问参考模型中VRF全部值,极大的方便了验证。Use of the reference model: The reference model constructed according to the reference model construction method of the processor computing unit provided by the embodiment of the present invention can be directly connected and called with the systemverilog verification environment using the DPI interface; after multiple calls to the pipeline in the simulation, the VRF can All calculation results are stored; the systemverilog side can easily access all VRF values in the reference model, which greatly facilitates verification.

具体地,参照如图4的参考模型,其应用示例过程如下:首先,初始化该参考模型;然后,检测输入信号接口模块(IOP)是否有效;如果有效,则加载数据到VRF模块,VRF模块输出对应数据给SAR模块,然后VSU模块对相应的计算功能指令进行译码,并获取相对应的操作数,计算执行相应的计算功能指令,最后将计算结果写回至VRF模块,并通过上述的输出信号接口模块输出结果。Specifically, referring to the reference model in Figure 4, its application example process is as follows: first, initialize the reference model; then, detect whether the input signal interface module (IOP) is valid; if valid, load the data to the VRF module, and the VRF module outputs The corresponding data is given to the SAR module, and then the VSU module decodes the corresponding calculation function instructions, obtains the corresponding operands, calculates and executes the corresponding calculation function instructions, and finally writes the calculation results back to the VRF module, and passes the above output The signal interface module outputs the results.

通过上述的步骤S1至步骤S6,本发明实施例提供的处理器计算单元的参考模型构建方法,所建立的参考模型与真实处理器中的计算单元具有良好的一致性,可以实现对计算单元中所有计算指令的计算过程进行完整模拟验证,进而可以利用该参考模型解决对计算单元功能验证困难的问题。并通过C函数实现的指令集各相应计算功能指令、能用目标架构服务器真机进行核对校准,能给计算单元RTL设计提供精确的理论值作为参考,以准确的验证功能结果;既能有真机硬件装置的准确性,也能脱离硬件装置,在验证中独立使用。此外,通过该构建方法建立的参考模型可以从DPI接口访问参考模型内部VRF和SAR的全部值,在核对具体指令结果的同时,还可实现对VRF等其他寄存器的变化进行检测的功能。Through the above-mentioned steps S1 to S6, the reference model construction method of the processor computing unit provided by the embodiment of the present invention has good consistency with the computing unit in the real processor, and can realize the calculation of the computing unit in the computing unit. The calculation process of all calculation instructions is completely simulated and verified, and the reference model can be used to solve the difficult problem of verifying the function of the calculation unit. The corresponding computing function instructions of the instruction set implemented through the C function can be checked and calibrated with the real machine of the target architecture server, and can provide accurate theoretical values as a reference for the RTL design of the computing unit to accurately verify the functional results; it can not only have real The accuracy of the machine hardware device can also be separated from the hardware device and used independently in verification. In addition, the reference model established through this construction method can access all the values of VRF and SAR inside the reference model from the DPI interface. While checking the results of specific instructions, it can also implement the function of detecting changes in VRF and other registers.

实施例2Example 2

本发明实施例提供了一种处理器计算单元的参考模型构建装置,如图5所示,该处理器计算单元的参考模型构建装置包括:An embodiment of the present invention provides a reference model construction device for a processor computing unit. As shown in Figure 5, the reference model construction device for a processor computing unit includes:

功能获取模块1,用于获取处理器计算单元的计算功能指令、控制功能及接口功能。详细内容参见实施例1中步骤S1的相关描述。Function acquisition module 1 is used to acquire computing function instructions, control functions and interface functions of the processor computing unit. For details, please refer to the relevant description of step S1 in Embodiment 1.

计算模型构建模块2,用于根据计算功能指令建立处理器计算单元的计算模型。详细内容参见实施例1中步骤S2的相关描述。The computing model building module 2 is used to establish the computing model of the processor computing unit according to the computing function instructions. For details, please refer to the relevant description of step S2 in Embodiment 1.

控制模型配置模块3,用于根据控制功能配置计算模型的控制模型。详细内容参见实施例1中步骤S3的相关描述。The control model configuration module 3 is used to configure the control model of the calculation model according to the control function. For details, please refer to the relevant description of step S3 in Embodiment 1.

模型接口配置模块4,用于根据接口功能配置计算模型的模型接口,生成处理器计算单元的参考模型。详细内容参见实施例1中步骤S4的相关描述。The model interface configuration module 4 is used to configure the model interface of the computing model according to the interface function and generate a reference model of the processor computing unit. For details, refer to the relevant description of step S4 in Embodiment 1.

通过上述各个组成部分的协同合作,本发明实施例提供的处理器计算单元的参考模型构建装置,通过根据处理器计算单元的计算功能指令建立处理器计算单元的计算模型,并根据该计算单元的控制功能和接口功能依次为上述计算模型配置相应的控制模型和模型接口,进而建立该处理器计算单元的参考模型。从而通过对依据实际计算功能指令、控制功能和接口功能所建立的参考模型,所建立的参考模型与真实处理器中的计算单元具有良好的一致性,可以实现对计算单元中所有计算指令的计算过程进行完整模拟验证,进而可以利用该参考模型解决对计算单元功能验证困难的问题。Through the cooperation of the above components, the reference model construction device of the processor computing unit provided by the embodiment of the present invention establishes the computing model of the processor computing unit according to the computing function instructions of the processor computing unit, and establishes the computing model of the processor computing unit based on the computing function instructions of the computing unit. The control function and interface function configure the corresponding control model and model interface for the above-mentioned computing model in turn, thereby establishing a reference model of the processor computing unit. Therefore, through the reference model established based on the actual computing function instructions, control functions and interface functions, the established reference model has good consistency with the computing unit in the real processor, and the calculation of all computing instructions in the computing unit can be realized. The process is fully simulated and verified, and the reference model can be used to solve the difficult problem of verifying the function of the computing unit.

实施例3Example 3

本发明实施例提供一种非暂态计算机存储介质,该计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的处理器计算单元的参考模型构建方法,其中,上述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(HardDisk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;该存储介质还可以包括上述种类的存储器的组合。Embodiments of the present invention provide a non-transitory computer storage medium. The computer storage medium stores computer executable instructions. The computer executable instructions can execute the reference model construction method of the processor computing unit in any of the above method embodiments, wherein , the above storage media can be magnetic disks, optical disks, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (Flash Memory), hard disk (HardDisk Drive, Abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above types of memories.

本领域技术人员可以理解,实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成的,程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。Those skilled in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed When doing so, it may include the processes of the above method embodiments. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

实施例4Example 4

本发明实施例提供一种计算机设备,其结构示意图如图6所示,该计算机设备包括:一个或多个处理器410以及存储器420,图6中以一个处理器410为例。An embodiment of the present invention provides a computer device, the schematic structural diagram of which is shown in Figure 6. The computer device includes: one or more processors 410 and a memory 420. In Figure 6, one processor 410 is taken as an example.

上述的计算机设备还可以包括:输入装置430和输出装置440。The above-mentioned computer device may also include: an input device 430 and an output device 440.

处理器410、存储器420、输入装置430和输出装置440可以通过总线或者其他方式连接,图6中以通过总线连接为例。The processor 410, the memory 420, the input device 430 and the output device 440 may be connected through a bus or other means. In FIG. 6, connection through a bus is taken as an example.

处理器410可以为中央处理器(Central Processing Unit,CPU)。处理器410还可以为其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等芯片,或者上述各类芯片的组合。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 410 may be a central processing unit (Central Processing Unit, CPU). The processor 410 may also be another general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA), or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components and other chips, or combinations of the above types of chips. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

存储器420作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的处理器计算单元的参考模型构建方法对应的程序指令/模块,处理器410通过运行存储在存储器420中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的处理器计算单元的参考模型构建方法。As a non-transitory computer-readable storage medium, the memory 420 can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the reference model construction method of the processor computing unit in the embodiment of the present application. Program instructions/modules, the processor 410 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 420, that is, the processor computing unit that implements the above method embodiments Reference model construction method.

存储器420可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据处理器计算单元的参考模型构建方法的处理装置的使用所创建的数据等。此外,存储器420可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器420可选包括相对于处理器410远程设置的存储器,这些远程存储器可以通过网络连接至处理器计算单元的参考模型构建装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required for at least one function; the storage data area may store the processing device according to the reference model construction method of the processor computing unit. Use the created data, etc. In addition, memory 420 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 420 may optionally include a memory located remotely relative to the processor 410, and these remote memories may be connected to a reference model building device of the processor's computing unit through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.

输入装置430可接收输入的数字或字符信息,以及产生与处理器计算单元的参考模型构建操作的处理装置有关的用户设置以及功能控制有关的键信号输入。输出装置440可包括显示屏等显示设备。The input device 430 may receive input numeric or character information and generate key signal input related to user settings and functional control of the processing device of the reference model building operation of the processor computing unit. The output device 440 may include a display device such as a display screen.

一个或者多个模块存储在存储器420中,当被一个或者多个处理器410执行时,执行如图1-图4所示的方法。One or more modules are stored in the memory 420, and when executed by one or more processors 410, the methods shown in Figures 1-4 are performed.

上述产品可执行本发明实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本发明实施例中详尽描述的技术细节,具体可参见如图1-图4所示的实施例中的相关描述。The above-mentioned products can execute the methods provided by the embodiments of the present invention, and have corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in the embodiments of the present invention, please refer to the relevant descriptions in the embodiments shown in FIGS. 1 to 4 .

显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保护范围之中。Obviously, the above-mentioned embodiments are only examples for clear explanation and are not intended to limit the implementation. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. An exhaustive list of all implementations is neither necessary nor possible. The obvious changes or modifications derived therefrom are still within the protection scope of the present invention.

Claims (10)

1.一种处理器计算单元的参考模型构建方法,其特征在于,包括:1. A reference model construction method for a processor computing unit, which is characterized by including: 获取处理器计算单元的计算功能指令、控制功能及接口功能;Obtain the computing function instructions, control functions and interface functions of the processor computing unit; 根据所述计算功能指令建立所述处理器计算单元的计算模型;Establish a computing model of the processor computing unit according to the computing function instructions; 采用真实处理器对所述计算模型进行验证;当验证通过时,根据所述控制功能配置所述计算模型的控制模型;Use a real processor to verify the computing model; when the verification passes, configure the control model of the computing model according to the control function; 根据所述接口功能配置所述计算模型的模型接口;Configure the model interface of the computing model according to the interface function; 将所述控制模型和所述模型接口分别与所述计算模型进行集成,以形成处理器计算单元的参考模型;Integrate the control model and the model interface with the computing model respectively to form a reference model of the processor computing unit; 对所述参考模型的模型接口进行仿真验证;当仿真验证通过时,将通过仿真验证的参考模型确定为处理器计算单元的参考模型;Perform simulation verification on the model interface of the reference model; when the simulation verification passes, determine the reference model that has passed the simulation verification as the reference model of the processor computing unit; 所述参考模型包括:输入信号接口模块、输出信号接口模块、指令译码模块、数据通道控制模块、指令执行模块、VRF模块、SAR模块、错误检查和纠正模块以及FMT模块;The reference model includes: input signal interface module, output signal interface module, instruction decoding module, data channel control module, instruction execution module, VRF module, SAR module, error checking and correction module, and FMT module; 所述输入信号接口模块接收数据和计算机功能指令;The input signal interface module receives data and computer function instructions; 所述指令译码模块接收所述计算功能指令并进行译码获取相对应的计算功能指令译码;The instruction decoding module receives the computing function instruction and decodes it to obtain the corresponding computing function instruction decoding; 所述指令执行模块接收所述指令译码模块输出的相对应的计算功能指令译码以及接收所述数据通道控制模块输出的操作数,以根据所述相对应的计算功能指令译码和所述操作数计算执行相应的计算功能指令以获得计算结果;The instruction execution module receives the corresponding computing function instruction decoding output by the instruction decoding module and receives the operand output by the data channel control module, so as to perform the decoding according to the corresponding computing function instruction decoding and the Operand calculation executes corresponding calculation function instructions to obtain calculation results; 所述数据通道控制模块接收所述指令执行模块输出的计算结果并传送给所述输出信号接口模块;The data channel control module receives the calculation results output by the instruction execution module and transmits them to the output signal interface module; 所述VRF模块用于加载所述输入信号接口模块输出的数据和接收所述数据通道控制模块输出的计算结果;The VRF module is used to load the data output by the input signal interface module and receive the calculation results output by the data channel control module; 所述SAR模块用于存储所述输入信号接口模块输出的数据和所述VRF模块输出的计算结果;The SAR module is used to store the data output by the input signal interface module and the calculation results output by the VRF module; 所述错误检查和纠正模块对输入的数据进行错误检查和纠正处理;The error checking and correction module performs error checking and correction processing on the input data; 所述FMT模块对输入的数据进行格式化处理;The FMT module formats the input data; 所述输出信号接口模块输出所述计算结果。The output signal interface module outputs the calculation result. 2.根据权利要求1所述的处理器计算单元的参考模型构建方法,其特征在于,所述根据所述计算功能指令建立所述处理器计算单元的计算模型,包括:2. The reference model construction method of the processor computing unit according to claim 1, characterized in that, establishing the computing model of the processor computing unit according to the computing function instructions includes: 获取各个所述计算功能指令的参数信息;Obtain the parameter information of each of the calculation function instructions; 根据各所述参数信息,分别建立各计算功能指令的指令模型;Establish instruction models for each computing function instruction based on each of the parameter information; 将各所述指令模型按照所对应的各所述计算指令进行集成,生成所述计算模型。The instruction models are integrated according to the corresponding computing instructions to generate the computing model. 3.根据权利要求2所述的处理器计算单元的参考模型构建方法,其特征在于,所述根据所述计算功能指令建立所述处理器计算单元的计算模型,还包括:3. The reference model construction method of the processor computing unit according to claim 2, characterized in that establishing the computing model of the processor computing unit according to the computing function instructions further includes: 采用真实处理器对所述计算模型进行验证;Verify the computing model using a real processor; 当验证未通过时,返回所述根据各所述参数信息,分别建立各计算功能指令的指令模型的步骤。When the verification fails, return to the step of establishing instruction models for each computing function instruction based on each of the parameter information. 4.根据权利要求3所述的处理器计算单元的参考模型构建方法,其特征在于,还包括:4. The method for building a reference model of a processor computing unit according to claim 3, further comprising: 当验证通过时,返回所述根据所述控制功能配置所述计算模型的控制模型的步骤。When the verification is passed, return to the step of configuring the control model of the calculation model according to the control function. 5.根据权利要求1所述的处理器计算单元的参考模型构建方法,其特征在于,还包括:5. The method for building a reference model of a processor computing unit according to claim 1, further comprising: 对所述参考模型的所述模型接口进行仿真验证;Conduct simulation verification on the model interface of the reference model; 当所述仿真验证未通过时,返回所述根据所述计算功能指令建立所述处理器计算单元的计算模型的步骤。When the simulation verification fails, return to the step of establishing a computing model of the processor computing unit according to the computing function instruction. 6.根据权利要求5所述的处理器计算单元的参考模型构建方法,其特征在于,还包括:6. The method for building a reference model of a processor computing unit according to claim 5, further comprising: 当所述仿真验证通过时,将通过所述仿真验证的参考模型确定为所述处理器计算单元的参考模型。When the simulation verification passes, the reference model that passes the simulation verification is determined as the reference model of the processor computing unit. 7.根据权利要求1所述的处理器计算单元的参考模型构建方法,其特征在于,还包括:7. The method for building a reference model of a processor computing unit according to claim 1, further comprising: 获取所述处理器计算单元的验证功能需求;Obtain the verification function requirements of the processor computing unit; 根据所述验证功能需求为所述参考模型配置功能验证接口。Configure a functional verification interface for the reference model according to the verification functional requirements. 8.一种处理器计算单元的参考模型构建装置,其特征在于,包括:8. A device for building a reference model of a processor computing unit, which is characterized in that it includes: 功能获取模块(1),用于获取处理器计算单元的计算功能指令、控制功能及接口功能;Function acquisition module (1), used to acquire computing function instructions, control functions and interface functions of the processor computing unit; 计算模型构建模块(2),用于根据所述计算功能指令建立所述处理器计算单元的计算模型;A computing model building module (2), used to establish a computing model of the processor computing unit according to the computing function instructions; 控制模型配置模块(3),用于采用真实处理器对所述计算模型进行验证;当验证通过时,根据所述控制功能配置所述计算模型的控制模型;The control model configuration module (3) is used to verify the computing model using a real processor; when the verification is passed, configure the control model of the computing model according to the control function; 模型接口配置模块(4),用于根据所述接口功能配置所述计算模型的模型接口;将所述控制模型和所述模型接口分别与所述计算模型进行集成,以形成处理器计算单元的参考模型;对所述参考模型的模型接口进行仿真验证;当仿真验证通过时,将通过仿真验证的参考模型确定为处理器计算单元的参考模型;所述参考模型包括:输入信号接口模块、输出信号接口模块、指令译码模块、数据通道控制模块、指令执行模块、VRF模块、SAR模块、错误检查和纠正模块以及FMT模块;所述输入信号接口模块接收数据和计算机功能指令;所述指令译码模块接收所述计算功能指令并进行译码获取相对应的计算功能指令译码;所述指令执行模块接收所述指令译码模块输出的相对应的计算功能指令译码以及接收所述数据通道控制模块输出的操作数,以根据所述相对应的计算功能指令译码和所述操作数计算执行相应的计算功能指令以获得计算结果;所述数据通道控制模块接收所述指令执行模块输出的计算结果并传送给所述输出信号接口模块;所述VRF模块用于加载所述输入信号接口模块输出的数据和接收所述数据通道控制模块输出的计算结果;所述SAR模块用于存储所述输入信号接口模块输出的数据和所述VRF模块输出的计算结果;所述错误检查和纠正模块对输入的数据进行错误检查和纠正处理;所述FMT模块对输入的数据进行格式化处理;所述输出信号接口模块输出所述计算结果。The model interface configuration module (4) is used to configure the model interface of the computing model according to the interface function; integrate the control model and the model interface with the computing model respectively to form a processor computing unit. Reference model; perform simulation verification on the model interface of the reference model; when the simulation verification passes, determine the reference model that has passed the simulation verification as the reference model of the processor computing unit; the reference model includes: an input signal interface module, an output Signal interface module, instruction decoding module, data channel control module, instruction execution module, VRF module, SAR module, error checking and correction module, and FMT module; the input signal interface module receives data and computer function instructions; the instruction translation The code module receives the computing function instruction and decodes it to obtain the corresponding computing function instruction decoding; the instruction execution module receives the corresponding computing function instruction decoding output by the instruction decoding module and receives the data channel The operands output by the control module are used to execute the corresponding computing function instructions according to the corresponding computing function instruction decoding and the operand calculation to obtain the computing results; the data channel control module receives the operation data output by the instruction execution module. The calculation results are transmitted to the output signal interface module; the VRF module is used to load the data output by the input signal interface module and receive the calculation results output by the data channel control module; the SAR module is used to store the The data output by the input signal interface module and the calculation result output by the VRF module; the error checking and correction module performs error checking and correction processing on the input data; the FMT module formats the input data; The output signal interface module outputs the calculation result. 9.一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令被处理器执行时实现如权利要求1-7任一项所述的处理器计算单元的参考模型构建方法。9. A non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and when executed by a processor, the computer instructions implement any one of claims 1-7 The reference model construction method of the processor computing unit. 10.一种计算机设备,其特征在于,包括:至少一个处理器(410);以及与所述至少一个处理器(410)通信连接的存储器(420)其中,10. A computer device, characterized by comprising: at least one processor (410); and a memory (420) communicatively connected with the at least one processor (410), wherein, 所述存储器(420)存储有可被所述至少一个处理器(410)执行的指令,所述指令被所述至少一个处理器(410)执行,以使所述至少一个处理器(410)执行如权利要求1-7任一项所述的处理器计算单元的参考模型构建方法。The memory (420) stores instructions executable by the at least one processor (410), and the instructions are executed by the at least one processor (410) to cause the at least one processor (410) to execute The reference model construction method of a processor computing unit according to any one of claims 1-7.
CN201811603788.XA 2018-12-26 2018-12-26 Reference model construction method and device for processor computing unit Active CN109829192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811603788.XA CN109829192B (en) 2018-12-26 2018-12-26 Reference model construction method and device for processor computing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811603788.XA CN109829192B (en) 2018-12-26 2018-12-26 Reference model construction method and device for processor computing unit

Publications (2)

Publication Number Publication Date
CN109829192A CN109829192A (en) 2019-05-31
CN109829192B true CN109829192B (en) 2023-10-17

Family

ID=66861263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811603788.XA Active CN109829192B (en) 2018-12-26 2018-12-26 Reference model construction method and device for processor computing unit

Country Status (1)

Country Link
CN (1) CN109829192B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460620B (en) * 2020-03-06 2023-06-20 北京仿真中心 Test evaluation model construction method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615808A (en) * 2015-01-19 2015-05-13 中国科学院自动化研究所 Pre-testing hardware operational unit test method and reference model device thereof
CN105474166A (en) * 2013-03-15 2016-04-06 先进元素科技公司 Method and system for purposeful computing
CN105589993A (en) * 2015-12-18 2016-05-18 中国科学院微电子研究所 Microprocessor function verification apparatus and microprocessor function verification method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105474166A (en) * 2013-03-15 2016-04-06 先进元素科技公司 Method and system for purposeful computing
CN104615808A (en) * 2015-01-19 2015-05-13 中国科学院自动化研究所 Pre-testing hardware operational unit test method and reference model device thereof
CN105589993A (en) * 2015-12-18 2016-05-18 中国科学院微电子研究所 Microprocessor function verification apparatus and microprocessor function verification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
龙腾Stream流处理器验证;白龙飞等;《计算机工程与应用》;20131231;第49卷(第15期);第65-69页 *

Also Published As

Publication number Publication date
CN109829192A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
US11922101B2 (en) Integrated circuits as a service
JP2025529962A (en) Verification system, verification method, electronic device, and storage medium
US9235669B2 (en) Method and an apparatus for automatic processor design and verification
CN112256572B (en) Random test case generation method and device as well as electronic equipment and storage media
US12112202B2 (en) Framework for application driven exploration and optimization of hardware engines
US9235670B2 (en) Method and an apparatus for automatic generation of verification environment for processor design and verification
CN102841837A (en) Software and hardware co-verification method based on simulator and system thereof
CN110175107A (en) A kind of test method and test macro of FPGA Cloud Server performance
CN105183641B (en) The data consistency verification method and system of a kind of kernel module
CN109829192B (en) Reference model construction method and device for processor computing unit
CN106933727A (en) The verification method and checking device of processor interrupt mechanism
CN115732025A (en) Method and device for verifying RAM access conflict
CN106970879A (en) A kind of parameter automatization configuration verification platform and method for configurable processing core
CN114153674A (en) Verification method, verification apparatus, electronic device, and computer-readable storage medium
CN109783295A (en) Test macro self-test method for producing software and device based on configuration
CN108334313A (en) Continuous integrating method, apparatus and code management system for large-scale SOC research and development
CN103136063A (en) Debugging method and related computer system
CN115510782B (en) Method for locating verification errors, electronic device and storage medium
CN115840593A (en) Method and device for verifying execution component in processor, equipment and storage medium
CN109933948B (en) Form verification method, device, form verification platform and readable storage medium
KR20210012886A (en) Method, apparatus, device and computer-readable storage medium executed by computing devices
CN120493825B (en) Chip verification method, test equipment and chip verification system
US12417163B2 (en) Selectable granularity performance monitor
CN120387408B (en) Bitstream verification method, device, equipment, storage medium and program product
US20250005243A1 (en) Integrated circuit design verification with signal forcing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: No.9, Xuesen Road, science and Technology City, Suzhou high tech Zone, Suzhou City, Jiangsu Province

Applicant after: Hexin Technology (Suzhou) Co.,Ltd.

Address before: 215163 building 3, No.9 Xuesen Road, science and Technology City, high tech Zone, Suzhou City, Jiangsu Province

Applicant before: SUZHOU POWERCORE TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20250801

Granted publication date: 20231017