CN116737473A - Memory reading and writing methods for chip verification and related devices - Google Patents
Memory reading and writing methods for chip verification and related devices Download PDFInfo
- Publication number
- CN116737473A CN116737473A CN202310568552.1A CN202310568552A CN116737473A CN 116737473 A CN116737473 A CN 116737473A CN 202310568552 A CN202310568552 A CN 202310568552A CN 116737473 A CN116737473 A CN 116737473A
- Authority
- CN
- China
- Prior art keywords
- address
- language
- memory
- data
- chip
- 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.)
- Pending
Links
- 230000015654 memory Effects 0.000 title claims abstract description 233
- 238000012795 verification Methods 0.000 title claims abstract description 129
- 238000000034 method Methods 0.000 title claims abstract description 79
- 230000006870 function Effects 0.000 claims abstract description 47
- 238000012545 processing Methods 0.000 claims abstract description 17
- 230000008569 process Effects 0.000 claims abstract description 15
- 238000006243 chemical reaction Methods 0.000 claims description 22
- 230000006386 memory function Effects 0.000 abstract description 7
- 238000004088 simulation Methods 0.000 description 13
- 238000012360 testing method Methods 0.000 description 10
- 239000002245 particle Substances 0.000 description 7
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 239000008187 granular material Substances 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000000638 stimulation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/2221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本申请实施例提供一种芯片验证的存储器读取、写入方法及其相关装置,包括:获取数据读取请求,所述数据读取请求包括使用第一语言表达的待获取数据的第一地址;使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待获取数据。本申请实施例可以在后门访问的读取中,多种语言互通的基础上,实现多种复杂操作,扩大了SOC验证过程中后门访问的适用范围,满足存储器功能验证的需要,提高了验证的效率和正确性。
Embodiments of the present application provide a chip-verified memory reading and writing method and related devices, including: obtaining a data reading request, where the data reading request includes a first address of data to be obtained expressed in a first language. ; Use the interface function to convert the first address expressed in the first language into the second address expressed in the second language; use the second language to convert the second address, determine the memory and obtain the granular address; according to the granular address, call the processing command of the memory, and read the data to be obtained stored at the second address. The embodiments of this application can realize multiple complex operations on the basis of multi-language interoperability during the reading of backdoor access, expand the applicable scope of backdoor access in the SOC verification process, meet the needs of memory function verification, and improve the verification efficiency. efficiency and correctness.
Description
技术领域Technical field
本公开涉及电子系统的仿真验证,特别涉及芯片验证的存储器读取、写入方法及其相关装置。The present disclosure relates to simulation verification of electronic systems, and in particular to memory reading and writing methods for chip verification and related devices.
背景技术Background technique
在SOC中处理大量数据时,数据的存储以及后续数据的比对都要耗费大量的仿真时间,使验证速度降低。另外,在SOC系统中,读写操作都是利用相同的访问方法进行操作,此时若存储器访问过程中出现问题,极难被察觉并且容易出现验证漏洞。为解决以上问题,引入了后门访问内存的方式。When processing large amounts of data in SOC, data storage and subsequent data comparison will consume a lot of simulation time, reducing the verification speed. In addition, in the SOC system, read and write operations are performed using the same access method. At this time, if there is a problem during the memory access process, it is extremely difficult to detect and verification vulnerabilities are prone to occur. In order to solve the above problems, a backdoor method of accessing memory was introduced.
然而,现有后门访问内存的方式,是在验证环境中根据物理地址,调用内存内部函数,直接将其写入,其使用范围比较小,仅适用于简单的IP验证,而实际大型的SOC验证,情况要复杂的多。However, the existing backdoor method of accessing memory is to call the internal function of the memory based on the physical address in the verification environment and write it directly. Its scope of use is relatively small and is only suitable for simple IP verification, but in actual large-scale SOC verification , the situation is much more complicated.
因此如何扩大SOC验证中后门访问的适用范围,满足存储器功能验证的需要,提高验证的效率和正确性,就成为了本领域技术人员亟需解决的技术问题。Therefore, how to expand the applicable scope of backdoor access in SOC verification, meet the needs of memory function verification, and improve the efficiency and accuracy of verification has become an urgent technical problem that technicians in this field need to solve.
发明内容Contents of the invention
有鉴于此,本申请实施例提供存储器的访问方法,以扩大SOC验证中后门访问的适用范围,满足存储器功能验证的需要,提高验证的效率和正确性。In view of this, embodiments of the present application provide a memory access method to expand the applicable scope of backdoor access in SOC verification, meet the needs of memory function verification, and improve the efficiency and accuracy of verification.
为实现上述目的,本发明实施例提供如下技术方案:To achieve the above objectives, embodiments of the present invention provide the following technical solutions:
本申请实施例提供一种芯片验证的存储器读取方法,包括:Embodiments of the present application provide a memory reading method for chip verification, including:
获取数据读取请求,所述数据读取请求包括使用第一语言表达的待获取数据的第一地址;Obtain a data reading request, the data reading request includes a first address of the data to be obtained expressed in a first language;
使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;Use the interface function to convert the first address expressed in the first language into the second address expressed in the second language;
使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;Convert the second address using a second language, determine the memory and obtain the granular address;
根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待According to the granular address, the processing command of the memory is called to read the to-be-used data stored at the second address.
获取数据。retrieve data.
可选的,所述第一语言包括通用编程语言,所述第二语言包括硬件描述语言。Optionally, the first language includes a general programming language, and the second language includes a hardware description language.
可选的,所述通用编程语言包括C++语言,所述硬件描述语言包括SystemVerilog语言。可选的,所述第一地址包括第一虚拟地址,所述第二地址包括第二虚拟地址,所述使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:Optionally, the general programming language includes C++ language, and the hardware description language includes SystemVerilog language. Optionally, the first address includes a first virtual address, the second address includes a second virtual address, and using a second language to convert the second address, determine the memory and obtain the granular address includes:
使用第二语言转换所述第二虚拟地址获得物理地址;Use a second language to convert the second virtual address to obtain a physical address;
转换所述物理地址获得颗粒化地址;Convert the physical address to obtain a granular address;
根据所述物理地址确定对应的存储器。The corresponding memory is determined according to the physical address.
可选的,所述存储器包括易失性存储器或非易失性存储器。Optionally, the memory includes volatile memory or non-volatile memory.
可选的,还包括,将读取的所述颗粒化地址的数据进行拼接。Optionally, the method further includes splicing the read data of the granular addresses.
本申请实施例还提供一种芯片验证的存储器写入方法,包括:Embodiments of the present application also provide a memory writing method for chip verification, including:
获取数据写入请求,所述数据写入请求包括使用第一语言表达的第一地址和待写入的数据;Obtain a data write request, the data write request including a first address expressed in a first language and data to be written;
使用接口函数,将使用第一语言表达的存储器的第一地址和所述待写入的数据转换为使用第二语言表达的第二地址和待写入的数据;Use an interface function to convert the first address of the memory expressed in the first language and the data to be written into the second address and the data to be written expressed in the second language;
使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;Convert the second address using a second language, determine the memory and obtain the granular address;
根据所述颗粒化地址,调用所述存储器的处理命令,将待写入的数据写入所述存储器。According to the granular address, a processing command of the memory is called to write the data to be written into the memory.
可选的,所述第一语言包括通用编程语言,所述第二语言包括硬件描述语言。Optionally, the first language includes a general programming language, and the second language includes a hardware description language.
可选的,所述通用编程语言包括C++语言,所述硬件描述语言包括SystemVerilog语言。可选的,所述第一地址包括第一虚拟地址,所述第二地址包括第二虚拟地址,所述使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:Optionally, the general programming language includes C++ language, and the hardware description language includes SystemVerilog language. Optionally, the first address includes a first virtual address, the second address includes a second virtual address, and using a second language to convert the second address, determine the memory and obtain the granular address includes:
使用第二语言转换所述第二虚拟地址获得物理地址;Use a second language to convert the second virtual address to obtain a physical address;
转换所述物理地址获得颗粒化地址;Convert the physical address to obtain a granular address;
根据所述物理地址确定对应的存储器。The corresponding memory is determined according to the physical address.
可选的,所述存储器包括易失性存储器或非易失性存储器。Optionally, the memory includes volatile memory or non-volatile memory.
可选的,所述根据所述颗粒化地址,调用所述存储器的处理命令,将待写入的数据写入所述存储器步骤之前,还包括,将所述待写入的数据进行拆分。Optionally, before the step of calling a processing command of the memory and writing the data to be written to the memory according to the granular address, the step further includes splitting the data to be written.
本申请实施例还提供一种芯片验证的存储器读取装置,包括:An embodiment of the present application also provides a memory reading device for chip verification, including:
地址获取模块,用于获取数据读取请求,所述数据读取请求包括使用第一语言表达的待获取数据的第一地址;An address acquisition module, configured to acquire a data reading request, where the data reading request includes a first address of data to be acquired expressed in a first language;
语言转换模块,用于使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;The language conversion module is used to use the interface function to convert the first address expressed in the first language into the second address expressed in the second language;
地址操作模块:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;Address operation module: used to convert the second address using a second language, determine the memory and obtain the granular address;
数据读取模块,用于根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待获取数据。A data reading module is configured to call a processing command of the memory according to the granular address and read the data to be obtained stored at the second address.
可选的,所述第一地址包括第一虚拟地址,所述第二地址包括第二虚拟地址,所述地址操作模块,用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:Optionally, the first address includes a first virtual address, the second address includes a second virtual address, and the address operation module is used to convert the second address using a second language, determine the memory, and obtain particles. address, including:
使用第二语言转换所述第二虚拟地址获得物理地址;Use a second language to convert the second virtual address to obtain a physical address;
转换所述物理地址获得颗粒化地址;Convert the physical address to obtain a granular address;
根据所述物理地址确定对应的存储器。The corresponding memory is determined according to the physical address.
可选的,还包括:数据拼接模块,用于将读取的所述颗粒化地址的数据进行拼接。Optionally, a data splicing module is also included, configured to splice the read data of the granular address.
本申请实施例还提供一种芯片验证的存储器写入装置,包括:An embodiment of the present application also provides a memory writing device for chip verification, including:
地址获取模块,用于获取数据写入请求,所述数据写入请求包括使用第一语言表达的第一地址和待写入的数据;An address acquisition module, configured to acquire a data write request, where the data write request includes a first address expressed in a first language and data to be written;
语言转换模块,用于使用接口函数,将使用第一语言表达的存储器的第一地址和所述待写入的数据转换为使用第二语言表达的第二地址和待写入的数据;A language conversion module, configured to use an interface function to convert the first address of the memory expressed in the first language and the data to be written into the second address expressed in the second language and the data to be written;
地址操作模块,用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;An address operation module, used to convert the second address using a second language, determine the memory and obtain the granular address;
数据写入模块,用于根据所述颗粒化地址,调用所述存储器的处理命令,将待写入的数据写入所述存储器。A data writing module is configured to call a processing command of the memory according to the granular address, and write the data to be written into the memory.
可选的所述第一地址包括第一虚拟地址,所述第二地址包括第二虚拟地址,所述地址操作模块:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:Optionally, the first address includes a first virtual address, the second address includes a second virtual address, and the address operation module is configured to use a second language to convert the second address, determine memory and obtain granularity Address, including:
使用第二语言转换所述第二虚拟地址获得物理地址;Use a second language to convert the second virtual address to obtain a physical address;
转换所述物理地址获得颗粒化地址;Convert the physical address to obtain a granular address;
根据所述物理地址确定对应的存储器。The corresponding memory is determined according to the physical address.
可选的,还包括数据拆分模块,用于将所述待写入的数据进行拆分。Optionally, a data splitting module is also included for splitting the data to be written.
本申请实施例还提供一种芯片,所述芯片被配置为如上所述的芯片验证的存储器读取装置或芯片验证的存储器写入装置。An embodiment of the present application further provides a chip configured as a chip-verified memory reading device or a chip-verified memory writing device as described above.
本申请实施例还提供一种电子设备,包括如上所述的芯片。An embodiment of the present application also provides an electronic device, including the chip as described above.
本申请实施例提供的一种芯片验证的存储器读取方法,获取数据读取请求,所述数据读取请求包括使用第一语言表达的待获取数据的第一地址;使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待获取数据。这样,在SOC验证过程中,使用后门访问读取存储器时,利用接口函数,互通多种语言,同时在第二语言中,执行数据通路中地址的转换和存储器的选择,可以在后门访问的读取中,多种语言互通的基础上,实现多种复杂操作,扩大了SOC验证过程中后门访问的适用范围,满足存储器功能验证的需要,提高了验证的效率和正确性。An embodiment of the present application provides a memory reading method for chip verification, and obtains a data reading request. The data reading request includes the first address of the data to be obtained expressed in the first language; using the interface function, the first address of the data to be obtained is used. The first address expressed in one language is converted into the second address expressed in the second language; the second address is converted using the second language, the memory is determined and the granular address is obtained; according to the granular address, the memory is called Process the command to read the data to be obtained stored at the second address. In this way, during the SOC verification process, when using the backdoor to access and read the memory, the interface function is used to communicate with multiple languages. At the same time, in the second language, the address conversion and memory selection in the data path are performed. On the basis of multi-language interoperability, a variety of complex operations are realized, which expands the applicable scope of backdoor access in the SOC verification process, meets the needs of memory function verification, and improves the efficiency and correctness of verification.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only This is an embodiment of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1为一种芯片验证的存储器访问装置结构示意图;Figure 1 is a schematic structural diagram of a memory access device for chip verification;
图2为本申请实施例提供的芯片验证的存储器读取方法的一流程图;Figure 2 is a flow chart of a memory reading method for chip verification provided by an embodiment of the present application;
图3为本申请实施例提供的芯片验证的存储器读取方法的确定存储器并获得颗粒化地址步骤的一流程图;Figure 3 is a flow chart of the steps of determining the memory and obtaining the granular address of the memory reading method for chip verification provided by the embodiment of the present application;
图4为本申请实施例提供的芯片验证的存储器写入方法的一流程图;Figure 4 is a flow chart of a memory writing method for chip verification provided by an embodiment of the present application;
图5为本申请实施例提供的芯片验证的存储器写入方法的另一流程图;Figure 5 is another flow chart of a memory writing method for chip verification provided by an embodiment of the present application;
图6为本申请实施例提供的芯片验证的存储器读取装置结构示意图;Figure 6 is a schematic structural diagram of a memory reading device for chip verification provided by an embodiment of the present application;
图7为本申请实施例提供的芯片验证的存储器写入装置结构示意图。FIG. 7 is a schematic structural diagram of a memory writing device for chip verification provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
在SOC(System-on-a-Chip,系统级芯片)验证中,存在大量存储访问操作。一种存储访问方法包括如下步骤:首先进行数据预存,通过仿真,模拟DUT(Design under Test,被测器件)的内存操作后得到的数据;然后DUT进行实际内存操作;最后,对DUT进行实际内存操作得到的数据读取与模拟DUT的内存操作后得到的数据,进行比对,以确定DUT行为的正确性。In SOC (System-on-a-Chip, system-on-a-chip) verification, there are a large number of storage access operations. A storage access method includes the following steps: first, data is pre-stored, and the data obtained after simulating the memory operation of the DUT (Design under Test, device under test) is simulated; then the DUT performs actual memory operations; finally, the DUT performs actual memory operations. The data obtained from the operation is read and compared with the data obtained after simulating the DUT's memory operation to determine the correctness of the DUT's behavior.
上述的方法为对内存进行验证操作的前门访问方法,但是,当处理大量数据时,数据的预先存储以及读取数据后的数据比对都要耗费大量的仿真时间,导致验证速度降低。另外,在SOC系统中,对存储器的验证都是利用相同的访问方法进行操作,此时若存储器访问过程中出现问题,极难被察觉并且容易出现验证漏洞。The above method is a front-door access method for verifying memory operations. However, when processing a large amount of data, the pre-storage of data and the comparison of data after reading the data consume a lot of simulation time, resulting in a reduction in verification speed. In addition, in the SOC system, the verification of the memory is performed using the same access method. At this time, if there is a problem during the memory access process, it is extremely difficult to detect and verification loopholes are prone to occur.
为此,可以通过使用后门访问存储器的方法,后门访问不占用仿真时间,可以快速对存储器进行操作,在处理大量数据的存储器访问中,大大提高了仿真效率,提高了验证速度。此外通过使用前门访问写入数据后门访问读取数据,或后门访问写入数据前门访问读取数据的对比方式,可以检测出在前门操作中出现的错误,通过多种验证手段,可以提高验证质量。但是针对不同类型的存储,其仿真模型的后门访问方式也不同,所以没有统一的方法可适用于大部分类型的存储器。To this end, you can use the backdoor method to access the memory. The backdoor access does not take up simulation time and can quickly operate the memory. When processing large amounts of data in memory access, the simulation efficiency is greatly improved and the verification speed is improved. In addition, by using front door access to write data and back door access to read data, or back door access to write data and front door access to read data, errors that occur in the front door operation can be detected, and the verification quality can be improved through a variety of verification methods. . However, for different types of storage, the backdoor access methods of the simulation models are also different, so there is no unified method that can be applied to most types of storage.
图1是一种存储器访问装置结构示意图,包括测试端1和存储器2,在进行存储器的访问验证时,一种后门访问内存的方式如图1所示,测试端1调用存储器2内读写函数,直接访问存储器2内的物理地址。Figure 1 is a schematic structural diagram of a memory access device, including test terminal 1 and memory 2. When performing memory access verification, a backdoor method of accessing the memory is shown in Figure 1. Test terminal 1 calls the read and write functions in memory 2 , directly access the physical address in memory 2.
上述方法的功能有限,仅适用于简单的数据对比验证。而实际大型的SOC验证,需要依次执行大量复杂操作,数据在验证中需要经过多次处理,其中涉及虚实地址变换等问题;若有多个存储设备时,访问存储器时会涉及存储设备的选择问题。另外,在SOC验证中,验证语言为硬件描述语言,例如System Verilog或Verilog,而SOC内需要使用通用编程语言,例如C语言或C++语言,模拟验证驱动,可见在SOC验证中需要使用多种不同语言,且这些语言间存在数据交互。这些语言间的数据交互也是SOC验证中的重要难题。因此现有技术方案无法实现SOC验证中多种复杂的数据操作,并且无法实现多种语言间的互通。因此,需要扩大后门访问的适用范围。The above methods have limited functions and are only suitable for simple data comparison verification. However, actual large-scale SOC verification requires a large number of complex operations to be performed in sequence. The data needs to be processed multiple times during the verification, which involves issues such as virtual and real address conversion. If there are multiple storage devices, accessing the memory will involve the selection of storage devices. . In addition, in SOC verification, the verification language is a hardware description language, such as System Verilog or Verilog, and a general programming language, such as C language or C++ language, and simulation verification driver need to be used in the SOC. It can be seen that a variety of different methods need to be used in SOC verification. languages, and there is data interaction between these languages. Data interaction between these languages is also an important problem in SOC verification. Therefore, the existing technical solution cannot realize various complex data operations in SOC verification, and cannot realize interoperability between multiple languages. Therefore, the scope of backdoor access needs to be expanded.
为了解决前述问题,本发明实施例提供了一种芯片验证的存储器读取方法,可以在SOC验证过程中,使用后门访问读取数据时,在多种语言互通的基础上,实现数据通路中地址的转换,该方法流程具体步骤如图2所示,包括:In order to solve the aforementioned problems, embodiments of the present invention provide a memory reading method for chip verification. During the SOC verification process, when using backdoor access to read data, on the basis of multi-language interoperability, the address in the data path can be realized. The specific steps of this method are shown in Figure 2, including:
步骤S11:获取数据读取请求,所述数据读取请求包括使用第一语言表达的待获取数据的第一地址。Step S11: Obtain a data reading request, where the data reading request includes a first address of the data to be obtained expressed in a first language.
由于在SOC验证的测试环境中需要对数据进行仿真并与实际操作进行对比验证,因此为了对存储器功能进行验证,需要首先获取数据读取请求。Since data needs to be simulated and compared with actual operations in the test environment of SOC verification, in order to verify the memory function, a data read request needs to be obtained first.
在SOC验证中,SOC级的激励需要执行一系列软件操作,其中为了访问存储器,需要产生访问存储器的地址,数据读取请求中包括待获取数据的第一地址。In SOC verification, SOC-level stimulation requires the execution of a series of software operations. In order to access the memory, an address to access the memory needs to be generated. The data read request includes the first address of the data to be obtained.
由于在存储器的验证时,验证语言为硬件描述语言,而SOC验证由于需要使用通用编程语言模拟验证驱动,二者的语言不同。受到后门验证方式的验证语言的限制,数据读取请求中的待获取数据的第一地址通过第一语言表达。Because during memory verification, the verification language is a hardware description language, while SOC verification requires the use of a general programming language to simulate the verification driver, so the languages of the two are different. Due to the limitation of the verification language of the backdoor verification method, the first address of the data to be obtained in the data reading request is expressed in the first language.
容易理解的是,第一语言为用于模拟验证驱动的语言,即通用编程语言,通用编程语言相比硬件描述语言可以更简单的达成模拟验证驱动。It is easy to understand that the first language is a language used for simulation verification driving, that is, a general programming language. A general programming language can achieve simulation verification driving more simply than a hardware description language.
其中,测试环境指的是为了完成测试所必需的硬件、软件、设备、数据等。Among them, the test environment refers to the hardware, software, equipment, data, etc. necessary to complete the test.
步骤S12:使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址。Step S12: Use the interface function to convert the first address expressed in the first language into the second address expressed in the second language.
如前所述,在得到使用第一语言表达的第一地址后,为了实现后续的芯片验证过程,需要将其转换为方便进行验证的第二语言。As mentioned above, after obtaining the first address expressed in the first language, in order to implement the subsequent chip verification process, it needs to be converted into a second language that is convenient for verification.
基于前述描述可知,第二语言为硬件描述语言,硬件描述语言相比通用编程语言可以更简单的执行存储器的后门访问,同时能直接操作获取到的数据。Based on the foregoing description, it can be seen that the second language is a hardware description language. Compared with a general programming language, a hardware description language can more easily perform backdoor access to the memory and can directly operate the acquired data.
具体地,通用编程语言可以包括C++语言,硬件描述语言可以为System Verilog语言。System Verilog语言作为一种硬件描述语言的同时也是一种验证语言,因此其可以直接使用读取到的存储器的数据进行验证操作。System Verilog语言在设计时结合了C++语言的部分概念,集成了面向对象编程特性,因此C++语言是与System Verilog语言配合使用的最优选Specifically, the general programming language may include C++ language, and the hardware description language may be System Verilog language. System Verilog language, as a hardware description language, is also a verification language, so it can directly use the read memory data to perform verification operations. System Verilog language was designed with some concepts of C++ language and integrated object-oriented programming features. Therefore, C++ language is the best choice for use with System Verilog language.
语言。language.
通过接口函数,可以更容易的实现两种语言之间的数据转换。在一种具体实施方式中,接口函数包括第一语言层和第二语言层,因此,根据使用的具体语言的不同,可以更换具有相应两种语言层的接口函数,进行任意两种语言间的数据转换。容易理解的是,当第一语言或者第二语言中的至少一者发生改变后,仅需要根据语言的种类更换接口函数。Through interface functions, data conversion between the two languages can be more easily achieved. In a specific implementation, the interface function includes a first language layer and a second language layer. Therefore, depending on the specific language used, the interface function with the corresponding two language layers can be replaced to perform communication between any two languages. Data conversion. It is easy to understand that when at least one of the first language or the second language changes, the interface function only needs to be replaced according to the type of language.
在一种可选实现中,当第一语言为System Verilog语言层时,所述接口函数可以为DPI(Direct Programming Interface,直接编程接口)接口函数。DPI由两层组成:SystemVerilog层和第二语言层,两层都彼此隔离,第二语言层实际使用哪种编程语言与此接口的System Verilog端无关,因此DPI接口可以连接System Verilog语言。In an optional implementation, when the first language is the System Verilog language layer, the interface function may be a DPI (Direct Programming Interface, direct programming interface) interface function. DPI consists of two layers: the SystemVerilog layer and the second language layer. Both layers are isolated from each other. Which programming language is actually used in the second language layer has nothing to do with the System Verilog side of this interface, so the DPI interface can connect to the System Verilog language.
在一种可选实现中,接口函数可以包括用于调用不同名称的函数的多个指令,其中每个指令用于调用对应的函数代码的运行。In an optional implementation, the interface function may include multiple instructions for calling functions with different names, where each instruction is used to call the execution of the corresponding function code.
步骤S13:使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址。Step S13: Use the second language to convert the second address, determine the memory and obtain the granular address.
在一种可选实现中,转换后的第二地址为用第二语言表达的物理地址,为了读取数据,还需进一步根据所述第二地址确定数据具体的位置。In an optional implementation, the converted second address is a physical address expressed in the second language. In order to read the data, it is further necessary to determine the specific location of the data based on the second address.
如前所述,由于在计算机设备中,往往可以设置有多个同类型或多种不同类型存储器,因此在获得转换后的第二地址,即前述物理地址后还需要根据获得的所述物理地址确定需要访问的存储器。As mentioned above, since computer equipment can often be provided with multiple memories of the same type or multiple different types, it is necessary to obtain the converted second address, that is, the physical address according to the obtained physical address. Determine the memory that needs to be accessed.
容易理解的是,在存储器的类型为内存时,内存设置有多个存储颗粒,该存储颗粒也称存储芯片。这些存储颗粒是由多个存储矩阵(Bank)组成,也称为Logical Bank(逻辑Bank),每个Bank的结构类似一个大方格子阵,每个Bank中格子数量是相同的。这些格子阵有很多列(Column)和很多行(Row),这样存取某个格子内的数据时,可以通过行列信息确定位置。因此在获得第二地址后,还需要将地址转换为由上述bank、row和column信息组成的能够访问颗粒化存储器的颗粒化地址,才可对存储颗粒内的数据进行操作。It is easy to understand that when the memory type is a memory, the memory is provided with multiple storage particles, and the storage particles are also called memory chips. These storage particles are composed of multiple storage matrices (Banks), also called Logical Banks. The structure of each Bank is similar to a large square grid array, and the number of grids in each Bank is the same. These grid arrays have many columns (Column) and many rows (Row), so that when accessing data in a certain grid, the position can be determined through the row and column information. Therefore, after obtaining the second address, the address needs to be converted into a granular address composed of the above bank, row, and column information that can access the granular memory before the data in the storage granule can be operated.
请参考图3,在一种具体实施方式中,为了实现所获取的第一地址为虚拟地址的情况下的芯片的验证,即第一地址包括第一虚拟地址,经过接口函数转换所得到的第二地址也为第二虚拟地址时,本申请实施例所提供的芯片验证的存储器读取方法的步骤S13,可以包括:Please refer to Figure 3. In a specific implementation, in order to achieve verification of the chip when the obtained first address is a virtual address, that is, the first address includes the first virtual address, the first address obtained after conversion by the interface function is When the second address is also a second virtual address, step S13 of the memory reading method for chip verification provided by the embodiment of the present application may include:
步骤S131:使用第二语言转换所述第二虚拟地址获得物理地址,转换所述物理地址获得Step S131: Use the second language to convert the second virtual address to obtain a physical address, and convert the physical address to obtain
颗粒化地址。Granular address.
第二语言无法直接使用所述第二虚拟地址直接访问存储器,需要先将虚拟地址转换为存储器的物理地址才可继续访问存储器,当然,所述颗粒化地址也需要经过物理地址转换得到。The second language cannot directly use the second virtual address to directly access the memory. The virtual address needs to be converted into the physical address of the memory before it can continue to access the memory. Of course, the granular address also needs to be obtained through physical address conversion.
步骤S132:根据所述物理地址确定对应的存储器。Step S132: Determine the corresponding memory according to the physical address.
得到物理地址后,基于所述物理地址进一步确定颗粒化地址和存储器。After the physical address is obtained, the granular address and memory are further determined based on the physical address.
颗粒化地址的具体确定方式不再赘述。The specific method of determining the granular address will not be described again.
由于在计算机设备中,往往可以设置有多个同类型或多种不同类型存储器,因此在获得物理地址后还需要根据获得的所述物理地址确定需要访问的存储器。Since a computer device may often be provided with multiple memories of the same type or multiple different types, it is necessary to determine the memory to be accessed based on the obtained physical address after obtaining the physical address.
步骤S14:根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待获取数据。Step S14: According to the granular address, call the processing command of the memory to read the data to be obtained stored at the second address.
获取数据后,可由第二语言适用该数据进行验证或配合SOC执行其他操作。After obtaining the data, the second language can use the data for verification or cooperate with the SOC to perform other operations.
由于存储器的种类有多种,为了适应多种不同种类的存储器的访问需要,可以通过更改调用存储器内部命令的函数,从而可调用多种类型的存储器的内部命令,进而可以适用于多种类型的存储器。Since there are many types of memories, in order to adapt to the access needs of many different types of memories, the function that calls the internal commands of the memory can be changed, so that the internal commands of multiple types of memories can be called, which can be applied to multiple types of memory. memory.
进一步的,在一种可选实现中,所述存储器包括易失性存储器或非易失性存储器。由于本申请实施例的存储器访问方法是通过调用存储器自身命令,即实现后门访问,从而实现对芯片验证的存储器读取,当更换存储设备后,仅需针对不同类型的存储器,更改调用函数,调用对应存储器的读取方法即可,因此本方法不仅可用于如上所述的内存等易失性存储器,也可用于如固态硬盘等非易失性存储器。Further, in an optional implementation, the memory includes volatile memory or non-volatile memory. Since the memory access method in the embodiment of the present application is to achieve backdoor access by calling the memory's own command, thereby realizing memory reading for chip verification, when the storage device is replaced, it is only necessary to change the calling function for different types of memory, and call The reading method of the corresponding memory is sufficient. Therefore, this method can be used not only for volatile memories such as memory as mentioned above, but also for non-volatile memories such as solid state drives.
所述本申请实施例的芯片验证的存储器读取方法,可以在SOC验证过程中,使用后门访问读取存储器时,利用接口函数,实现了互通多种语言基础上的后门访问的读取,同时在第二语言中,执行了数据通路中地址的转换和存储器的选择,实现了在后门访问的读取中,多种语言互通的基础上,执行多种复杂操作,扩大了后门访问的适用范围,满足存储器功能验证的需要,提高了验证的效率和正确性。The memory reading method for chip verification in the embodiment of the present application can use the interface function to realize the reading of backdoor access based on interoperability with multiple languages during the SOC verification process when using backdoor access to read the memory. At the same time, In the second language, address conversion and memory selection in the data path are performed, and in the reading of backdoor access, multiple complex operations can be performed on the basis of multi-language interoperability, which expands the scope of application of backdoor access. , to meet the needs of memory function verification and improve the efficiency and correctness of verification.
需要说明的是,在SOC内部,SOC级的激励是使用通用编程语言编写的,而在实际执行SOC验证操作则需要使用特殊的验证语言,但通常情况下验证语言为硬件描述语言。It should be noted that within the SOC, the SOC-level incentives are written using a general programming language, while actually performing the SOC verification operation requires the use of a special verification language, but usually the verification language is a hardware description language.
因此,在一种可选实现中,所述第一语言是通用编程语言,所述第二语言是硬件描述语言。Therefore, in an alternative implementation, the first language is a general programming language and the second language is a hardware description language.
在一种可选实现中,所述通用编程语言是C++语言,所述硬件描述语言是SystemVerilog语言。In an optional implementation, the general programming language is C++ language, and the hardware description language is SystemVerilog language.
具体的,在SOC验证中,因为SOC级的激励是基于C++的一套模拟驱动的软件栈实现的,因此在初始获取并表达虚拟地址时的第一语言优选使用的是C++语言。第二语言则主要用于存储器的访问与虚拟地址转换,此时的优选为SystemVerilog语言。SystemVerilog语言是一种将硬件描述语言(HDL)与现代的高层级验证语言(HVL)结合的硬件语言。它主要用于芯片的实现和验证流程上。SystemVerilog拥有芯片设计及验证工程师所需的全部结构,它集成了面向对象编程、动态线程和线程间通信等特性,因此它更容易与C++语言相互通,并且全面综合了寄存器转换级电路(Register Transfer Level)。因此选择C++语言和SystemVerilog语言配合DPI接口函数,可以更容易实现两种语言间互通的同时,完成更多种虚拟地址的复杂变换操作。Specifically, in SOC verification, because SOC-level incentives are implemented based on a set of simulation-driven software stacks in C++, the first language when initially obtaining and expressing the virtual address is preferably the C++ language. The second language is mainly used for memory access and virtual address translation. The preferred language at this time is SystemVerilog. SystemVerilog language is a hardware language that combines hardware description language (HDL) with modern high-level verification language (HVL). It is mainly used for chip implementation and verification processes. SystemVerilog has all the structures needed by chip design and verification engineers. It integrates features such as object-oriented programming, dynamic threads, and inter-thread communication, so it is easier to communicate with the C++ language and fully integrates the register transfer level circuit (Register Transfer level circuit). Level). Therefore, choosing the C++ language and SystemVerilog language to cooperate with the DPI interface function can make it easier to realize interoperability between the two languages and complete more complex transformation operations of virtual addresses.
在一种可选实现中,如图2所示,所述步骤S14之后还可以包括步骤S15:将读取的所述颗粒化地址的数据进行拼接。In an optional implementation, as shown in Figure 2, step S14 may be followed by step S15: splicing the read data of the granular addresses.
当需要读取的数据存储于多个bank中时,数据以被拆分的状态存储,因此在读取出存储颗粒中的数据后,还需要将这些数据拼合成完整数据才可被传输并用于后续操作。When the data to be read is stored in multiple banks, the data is stored in a split state. Therefore, after reading the data in the storage particles, the data needs to be assembled into complete data before it can be transmitted and used. Follow-up operations.
本发明实施例还提供一种芯片验证的存储器写入方法,可以在SOC验证过程中,使用后门访问写入数据时,在多种语言互通的基础上,实现数据通路中地址的转换,从而实现存储器的验证,该方法流程具体步骤如图4所示,包括:Embodiments of the present invention also provide a memory writing method for chip verification, which can realize address conversion in the data path on the basis of multi-language interoperability when using backdoor access to write data during the SOC verification process, thereby realizing For memory verification, the specific steps of this method are shown in Figure 4, including:
步骤S21:获取数据写入请求,所述数据写入请求包括使用第一语言表达的第一地址和待写入的数据。Step S21: Obtain a data writing request, which includes a first address expressed in a first language and data to be written.
由于在SOC验证的测试环境中需要对数据进行仿真并与实际操作进行对比验证,因此为了对芯片验证的存储器写入功能进行验证,需要首先获取数据写入请求。Since data needs to be simulated and compared with actual operations in the test environment of SOC verification, in order to verify the memory write function of chip verification, a data write request needs to be obtained first.
在SOC验证中,SOC级的激励需要执行一系列软件操作,其中为了访问存储器,需要产生访问存储器的地址,数据写入请求中包括的第一地址。而为了写入数据,写入请求中还包括待写入的数据。In SOC verification, the SOC level stimulus needs to perform a series of software operations, in which in order to access the memory, the address to access the memory needs to be generated, the first address included in the data write request. In order to write data, the write request also includes the data to be written.
由于在存储器的验证时,验证语言为硬件描述语言,而SOC验证由于需要使用通用编程语言模拟验证驱动,二者的语言不同。受到后门验证方式的验证语言的限制,数据写入请求中的第一地址通过第一语言表达。Because during memory verification, the verification language is a hardware description language, while SOC verification requires the use of a general programming language to simulate the verification driver, so the languages of the two are different. Limited by the verification language of the backdoor verification method, the first address in the data writing request is expressed in the first language.
容易理解的是,第一语言为用于模拟验证驱动的语言,即通用编程语言,通用编程语言相比硬件描述语言可以更简单的达成模拟验证驱动。It is easy to understand that the first language is a language used for simulation verification driving, that is, a general programming language. A general programming language can achieve simulation verification driving more simply than a hardware description language.
其中,测试环境指的是为了完成测试所必需的硬件、软件、设备、数据等。Among them, the test environment refers to the hardware, software, equipment, data, etc. necessary to complete the test.
步骤S22:使用接口函数,将使用第一语言表达的存储器的第一地址和所述待写入的数据转换为使用第二语言表达的第二地址和待写入的数据。Step S22: Use an interface function to convert the first address of the memory expressed in the first language and the data to be written into the second address and the data to be written expressed in the second language.
如前所述,在得到使用第一语言表达的第一地址后,为了实现后续的芯片验证过程,需要将其转换为方便进行验证的第二语言。As mentioned above, after obtaining the first address expressed in the first language, in order to implement the subsequent chip verification process, it needs to be converted into a second language that is convenient for verification.
基于前述描述可知,第二语言为硬件描述语言,硬件描述语言相比通用编程语言可以更简单的执行存储器的后门访问。Based on the foregoing description, it can be seen that the second language is a hardware description language, and a hardware description language can perform backdoor access to the memory more easily than a general-purpose programming language.
通用编程语言与硬件描述语言的语言选择,与本申请实施例所提供的芯片验证的存储器读取方法中的语言选择相同,此处不再赘述。通过接口函数,可以更容易的实现两种语言之间的数据转换。在一种具体实施方式中,接口函数包括第一语言层和第二语言层,因此,根据使用的具体语言的不同,可以更换具有相应两种语言层的接口函数,进行任意两种语言间的数据转换。容易理解的是,当第一语言或者第二语言中的至少一者发生改变后,仅需要根据语言的种类更换接口函数。The language selection of the general programming language and the hardware description language is the same as the language selection in the memory reading method for chip verification provided by the embodiment of the present application, and will not be described again here. Through interface functions, data conversion between the two languages can be more easily achieved. In a specific implementation, the interface function includes a first language layer and a second language layer. Therefore, depending on the specific language used, the interface function with the corresponding two language layers can be replaced to perform communication between any two languages. Data conversion. It is easy to understand that when at least one of the first language or the second language changes, the interface function only needs to be replaced according to the type of language.
在一种可选实现中,与本申请实施例所提供的芯片验证的存储器读取方法相同,当所需要的第一语言层和第二语言层为System Verilog语言层和C++语言层时,所述接口函数为DPI。In an optional implementation, the same as the memory reading method for chip verification provided in the embodiment of the present application, when the required first language layer and second language layer are System Verilog language layer and C++ language layer, the The interface function is DPI.
在一种可选实现中,接口函数可以包括用于调用不同名称的函数的多个指令,其中每个指令用于调用对应的函数代码的运行。In an optional implementation, the interface function may include multiple instructions for calling functions with different names, where each instruction is used to call the execution of the corresponding function code.
步骤S23:使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址。Step S23: Use the second language to convert the second address, determine the memory and obtain the granular address.
在一种可选实现中,转换后的第二地址为用第二语言表达的物理地址,为了写入数据,还需进一步根据所述第二地址确定数据具体需写入的位置。In an optional implementation, the converted second address is a physical address expressed in the second language. In order to write data, it is further necessary to determine the specific location where the data needs to be written based on the second address.
如前所述,由于在计算机设备中,往往可以设置有多个同类型或多种不同类型存储器,因此在获得转换后的第二地址,即前述物理地址后还需要根据获得的所述物理地址确定需要访问的存储器。As mentioned above, since computer equipment can often be provided with multiple memories of the same type or multiple different types, it is necessary to obtain the converted second address, that is, the physical address according to the obtained physical address. Determine the memory that needs to be accessed.
请参考图5,在一种具体实施方式中,为了实现所获取的第一地址为虚拟地址的情况下的存储器的验证,即第一地址包括第一虚拟地址,经过接口函数转换所得到的第二地址也为第二虚拟地址时,本申请实施例所提供的芯片验证的存储器读取方法的步骤S23,可以包括:Please refer to Figure 5. In a specific implementation, in order to realize the verification of the memory when the obtained first address is a virtual address, that is, the first address includes the first virtual address, the first address obtained after conversion by the interface function is When the second address is also a second virtual address, step S23 of the memory reading method for chip verification provided by the embodiment of the present application may include:
步骤S231:使用第二语言转换所述第二虚拟地址获得物理地址,转换所述物理地址获得颗粒化地址;Step S231: Use the second language to convert the second virtual address to obtain a physical address, and convert the physical address to obtain a granular address;
第二语言无法直接使用所述虚拟地址直接访问存储器,需要先将虚拟地址转换为存储器的物理地址才可继续访问存储器,且所述颗粒化地址也需要经过物理地址转换得到。The second language cannot directly use the virtual address to directly access the memory. The virtual address needs to be converted into the physical address of the memory before it can continue to access the memory, and the granular address also needs to be obtained through physical address conversion.
步骤S232:根据所述物理地址确定对应的存储器。Step S232: Determine the corresponding memory according to the physical address.
得到物理地址后,基于所述物理地址进一步确定颗粒化地址和存储器。After the physical address is obtained, the granular address and memory are further determined based on the physical address.
颗粒化地址的具体确定方式不再赘述。The specific method of determining the granular address will not be described again.
由于在计算机设备中,往往可以设置有多个同类型或多种不同类型存储器,因此在获得物理地址后还需要根据获得的所述物理地址确定需要访问的存储器。Since a computer device may often be provided with multiple memories of the same type or multiple different types, it is necessary to determine the memory to be accessed based on the obtained physical address after obtaining the physical address.
步骤S24:根据所述颗粒化地址,调用所述存储器的处理命令,将待写入的数据写入所述存储器。Step S24: According to the granular address, call the processing command of the memory to write the data to be written into the memory.
写入数据后,可由第二语言进行验证或配合SOC执行其他操作。After the data is written, it can be verified by the second language or performed with the SOC to perform other operations.
由于存储器的种类有多种,为了适应多种不同种类的存储器的访问需要,可以通过更改调用存储器内部命令的函数,从而可调用多种类型的存储器的内部命令,进而可以适用于多种类型的存储器。Since there are many types of memories, in order to adapt to the access needs of many different types of memories, the function that calls the internal commands of the memory can be changed, so that the internal commands of multiple types of memories can be called, which can be applied to multiple types of memory. memory.
进一步的,在一种可选实现中,所述存储器包括易失性存储器或非易失性存储器。由于本申请实施例的存储器访问方法是通过调用存储器自身命令,即实现后门访问,从而实现对芯片验证的存储器读取,当更换存储设备后,仅需针对不同类型的存储器,更改调用函数,调用对应存储器的读取方法即可,因此本方法不仅可用于如上所述的内存等易失性存储器也可用于如固态硬盘等非易失性存储器。Further, in an optional implementation, the memory includes volatile memory or non-volatile memory. Since the memory access method in the embodiment of the present application is to achieve backdoor access by calling the memory's own command, thereby realizing memory reading for chip verification, when the storage device is replaced, it is only necessary to change the calling function for different types of memory, and call The reading method of the corresponding memory is enough. Therefore, this method can be used not only for volatile memories such as memory as mentioned above, but also for non-volatile memories such as solid state drives.
所述本申请实施例的芯片验证的存储器写入方法,可以在SOC验证过程中,使用后门访问写入存储器时,利用接口函数,实现了互通多种语言基础上的后门访问的写入,同时在第二语言中,执行了数据通路中地址的转换,实现了在后门访问的读取中,多种语言互通的基础上,执行多种复杂操作,扩大了后门访问的适用范围,满足存储器功能验证的需要,提高了验证的效率和正确性。The memory writing method for chip verification in the embodiment of the present application can use the interface function to realize the writing of backdoor access based on the interoperability of multiple languages during the SOC verification process when using backdoor access to write to the memory. At the same time, In the second language, the address conversion in the data path is performed, and in the reading of backdoor access, multiple complex operations can be performed on the basis of multi-language interoperability, which expands the applicable scope of backdoor access and satisfies the memory function. The need for verification improves the efficiency and correctness of verification.
需要说明的是,在SOC内部,SOC级的激励是使用通用编程语言编写的,而在实际执行SOC验证操作则需要使用特殊的验证语言,但通常情况下验证语言为硬件描述语言。因此,在一种可选实现中,所述第一语言是通用编程语言,所述第二语言是硬件描述语言。It should be noted that within the SOC, the SOC-level incentives are written using a general programming language, while actually performing the SOC verification operation requires the use of a special verification language, but usually the verification language is a hardware description language. Therefore, in an alternative implementation, the first language is a general programming language and the second language is a hardware description language.
在一种可选实现中,所述通用编程语言是C++语言,所述硬件描述语言是SystemVerilog语言。In an optional implementation, the general programming language is C++ language, and the hardware description language is SystemVerilog language.
具体的,在SOC验证中,因为SOC级的激励是基于C++的一套模拟驱动(driver)的软件栈来实现的,因此在初始获取并表达虚拟地址时的通用编程语言优选使用的是C++语言。硬件描述语言则主要用于存储器的访问与虚拟地址转换,此时的优选为System Verilog语言。System Verilog语言是一种将硬件描述语言(HDL)与现代的高层级验证语言(HVL)结合的硬件语言。它主要用于芯片的实现和验证流程上。System Verilog拥有芯片设计及验证工程师所需的全部结构,它集成了面向对象编程、动态线程和线程间通信等特性,因此它更容易与C++语言相互通,并且全面综合了寄存器转换级电路(Register Transfer Level)。因此选择C++语言和System Verilog语言可以更容易实现两种语言间互通的同时,完成更多种虚拟地址的复杂变换操作。Specifically, in SOC verification, because SOC-level incentives are implemented based on a set of simulation driver software stacks in C++, the general programming language when initially obtaining and expressing the virtual address is preferably the C++ language. . Hardware description language is mainly used for memory access and virtual address translation. The preferred language at this time is System Verilog. System Verilog language is a hardware language that combines hardware description language (HDL) with modern high-level verification language (HVL). It is mainly used for chip implementation and verification processes. System Verilog has all the structures needed by chip design and verification engineers. It integrates features such as object-oriented programming, dynamic threads and inter-thread communication, so it is easier to communicate with the C++ language and comprehensively integrates the register conversion level circuit (Register Transfer Level). Therefore, choosing C++ language and System Verilog language can make it easier to realize interoperability between the two languages and complete more complex transformation operations of virtual addresses.
在一种可选实现中,如图4所示所述步骤S24之前还包括步骤S25:将待写入的数据进行拆分。In an optional implementation, step S24 as shown in Figure 4 is preceded by step S25: splitting the data to be written.
在如步骤S23所描述的内存设备中,需写入的数据需要被拆散并存储于多个bank中,因此在向存储颗粒中写入数据前,还需要将需写入的数据拆分并对应bank,才可被写入存储器颗粒。In the memory device described in step S23, the data to be written needs to be split and stored in multiple banks. Therefore, before writing data to the storage particles, the data to be written needs to be split and corresponding bank, can be written to the memory granule.
此外,本申请实施例所述的芯片验证的存储器读取方法和写入方法因为应用System Verilog语言,因此依靠其适用于多种不同的芯片验证方法学的语言特性,本方法不仅可用于SOC验证,还可应用于监视器,可直接作为一种监测手段,以检测存储器数据的正确性。In addition, the memory reading method and writing method for chip verification described in the embodiments of this application use the System Verilog language, so relying on its language characteristics that are suitable for a variety of different chip verification methodologies, this method can not only be used for SOC verification , can also be applied to monitors and can be directly used as a monitoring method to detect the correctness of memory data.
本申请实施例还提供一种芯片验证的存储器读取装置,如图6所示,包括:An embodiment of the present application also provides a memory reading device for chip verification, as shown in Figure 6, including:
读取数据获取模块10:用于获取数据读取请求,所述数据读取请求包括使用第一语言Read data acquisition module 10: used to obtain data reading requests, the data reading requests include using the first language
表达的待获取数据的第一地址;Express the first address of the data to be obtained;
语言转换模块11:用于使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;Language conversion module 11: used to use the interface function to convert the first address expressed in the first language into the second address expressed in the second language;
数据操作模块12:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;Data operation module 12: used to convert the second address using the second language, determine the memory and obtain the granular address;
数据读取模块13:用于根据所述颗粒化地址,调用所述存储器的处理命令,读取所述第二地址存储的所述待获取数据。Data reading module 13: configured to call the processing command of the memory according to the granular address and read the data to be obtained stored at the second address.
在一种具体实施方式中,为了实现所获取的第一地址为虚拟地址的情况下的存储器的验证,即第一地址包括第一虚拟地址,经过接口函数转换所得到的第二地址也为第二虚拟地址时,本申请实施例所提供的芯片验证的存储器读取装置可以包括,In a specific implementation, in order to realize the verification of the memory when the obtained first address is a virtual address, that is, the first address includes the first virtual address, and the second address obtained after conversion by the interface function is also the second address. When two virtual addresses are used, the memory reading device for chip verification provided by the embodiment of the present application may include:
数据操作模块12:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:Data operation module 12: used to convert the second address using the second language, determine the memory and obtain the granular address, including:
使用第二语言转换所述第二虚拟地址获得物理地址,转换所述物理地址获得颗粒化地址;根据所述物理地址确定对应的存储器。Use the second language to convert the second virtual address to obtain a physical address, convert the physical address to obtain a granular address; determine the corresponding memory according to the physical address.
得到物理地址后,基于所述物理地址进一步确定颗粒化地址和存储器。After the physical address is obtained, the granular address and memory are further determined based on the physical address.
在一种可选实现中,在如前文所描述的内存设备中,需要被读取的数据会被拆散并存储于多个格子中,因此在读取出存储颗粒中的数据后,还需要将这些数据拼合成完整数据才可被传输并用于后续操作。In an optional implementation, in the memory device as described above, the data to be read will be split and stored in multiple grids. Therefore, after reading the data in the storage particles, it is also necessary to These data are assembled into complete data before they can be transmitted and used for subsequent operations.
因此,如图6所示,所述芯片验证的存储器读取装置还包括数据拼接模块14,用于将读取的所述颗粒化地址的数据进行拼接。Therefore, as shown in FIG. 6 , the memory reading device for chip verification also includes a data splicing module 14 for splicing the read data of the granular address.
本申请实施例还提供一种芯片验证的存储器写入装置,如图7所示,包括:An embodiment of the present application also provides a memory writing device for chip verification, as shown in Figure 7, including:
写入数据获取模块20:用于获取数据写入请求,所述数据写入请求包括使用第一语言表达的第一地址和待写入的数据;Write data acquisition module 20: used to acquire a data write request, which includes a first address expressed in a first language and data to be written;
语言转换模块21:用于使用接口函数,将使用第一语言表达的第一地址转换为使用第二语言表达的第二地址;Language conversion module 21: used to use the interface function to convert the first address expressed in the first language into the second address expressed in the second language;
数据操作模块22:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址;Data operation module 22: used to convert the second address using the second language, determine the memory and obtain the granular address;
数据写入模块23:根据所述颗粒化地址,调用所述存储器的处理命令,将待写入的数据写入所述存储器。Data writing module 23: According to the granular address, call the processing command of the memory to write the data to be written into the memory.
在一种具体实施方式中,为了实现所获取的第一地址为虚拟地址的情况下的存储器的验证,即第一地址包括第一虚拟地址,经过接口函数转换所得到的第二地址也为第二虚拟地址时,本申请实施例所提供的芯片验证的存储器写入装置可以包括,In a specific implementation, in order to realize the verification of the memory when the obtained first address is a virtual address, that is, the first address includes the first virtual address, and the second address obtained after conversion by the interface function is also the second address. When two virtual addresses are used, the memory writing device for chip verification provided by the embodiment of the present application may include:
所述数据操作模块22:用于使用第二语言转换所述第二地址,确定存储器并获得颗粒化地址,包括:The data operation module 22 is used to convert the second address using the second language, determine the memory and obtain the granular address, including:
使用第二语言转换所述第二虚拟地址获得物理地址,转换所述物理地址获得颗粒化地址;根据所述物理地址确定对应的存储器。Use the second language to convert the second virtual address to obtain a physical address, convert the physical address to obtain a granular address; determine the corresponding memory according to the physical address.
得到物理地址后,基于所述物理地址进一步确定颗粒化地址和存储器。After the physical address is obtained, the granular address and memory are further determined based on the physical address.
在一种可选实现中,在如前文所描述的内存设备中,需写入的数据需要被拆散并存储于多个格子中,因此如图7所示,在向存储颗粒中写入的数据前,还包括数据拆分模块24,用于将所述待写入的数据进行拆分。In an optional implementation, in the memory device as described above, the data to be written needs to be split and stored in multiple grids. Therefore, as shown in Figure 7, when the data is written to the storage granule Before, a data splitting module 24 is also included, which is used to split the data to be written.
特别的,上述两种存储器的访问装置可组合为一个装置,包括上述全部模块。In particular, the above two memory access devices can be combined into one device, including all the above modules.
本申请实施例还提供一种芯片,在本申请实施例中,该芯片可以配置上述任意一种或多种存储器访问装置。An embodiment of the present application also provides a chip. In the embodiment of the present application, the chip can be configured with any one or more of the above memory access devices.
本申请实施例还提供一种电子设备,在本申请实施例中,该电子设备可以配置上述的芯片。An embodiment of the present application also provides an electronic device. In the embodiment of the present application, the electronic device can be configured with the above-mentioned chip.
虽然本申请实施例披露如上,但本申请并非限定于此。任何本领域技术人员,在不脱离本申请的精神和范围内,均可作各种更动与修改,因此本申请的保护范围应当以权利要求所限定的范围为准。Although the embodiments of the present application are disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application shall be subject to the scope defined by the claims.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310568552.1A CN116737473A (en) | 2023-05-18 | 2023-05-18 | Memory reading and writing methods for chip verification and related devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310568552.1A CN116737473A (en) | 2023-05-18 | 2023-05-18 | Memory reading and writing methods for chip verification and related devices |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116737473A true CN116737473A (en) | 2023-09-12 |
Family
ID=87914234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310568552.1A Pending CN116737473A (en) | 2023-05-18 | 2023-05-18 | Memory reading and writing methods for chip verification and related devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116737473A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117077115A (en) * | 2023-10-13 | 2023-11-17 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
CN119201756A (en) * | 2024-11-28 | 2024-12-27 | 沐曦集成电路(上海)有限公司 | Simulation verification system based on DFI interface |
-
2023
- 2023-05-18 CN CN202310568552.1A patent/CN116737473A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117077115A (en) * | 2023-10-13 | 2023-11-17 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
CN117077115B (en) * | 2023-10-13 | 2023-12-15 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
CN119201756A (en) * | 2024-11-28 | 2024-12-27 | 沐曦集成电路(上海)有限公司 | Simulation verification system based on DFI interface |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113076227B (en) | MCU verification method, system and terminal device | |
WO2016197768A1 (en) | Chip verification method, device, and system | |
CN116737473A (en) | Memory reading and writing methods for chip verification and related devices | |
US10204698B2 (en) | Method to dynamically inject errors in a repairable memory on silicon and a method to validate built-in-self-repair logic | |
US8645116B2 (en) | Hybrid simulation system and method | |
US11507718B1 (en) | Chip verification system and verification method therefor | |
US11520968B2 (en) | Verification platform for system on chip and verification method thereof | |
EP3216027B1 (en) | Test of semiconductor storage power consumption on basis of executed access commands | |
CN110941395A (en) | Dynamic random access memory, memory management method, system and storage medium | |
CN108170571B (en) | Chip tracking debugging device and method | |
CN110321260B (en) | Uvm-based AXI bus interface read-write data comparison method and UVM verification platform | |
CN113486625A (en) | Chip verification method and verification system | |
CN105654993A (en) | Function verification method and platform for DDR3 SDRAM (double data rate 3 synchronous dynamic random access memory) controller | |
US20170103797A1 (en) | Calibration method and device for dynamic random access memory | |
CN111176926B (en) | IP core simulation system and simulation method based on dual-port SRAM | |
CN108334453B (en) | File debugging method and device, terminal equipment and storage medium | |
CN113760751B (en) | Method for generating test case, electronic device and storage medium | |
US20070179772A1 (en) | Method and apparatus for increasing the efficiency of an emulation engine | |
CN110765060B (en) | MDIO bus-to-parallel bus conversion method and device, equipment and medium | |
US20130159591A1 (en) | Verifying data received out-of-order from a bus | |
CN116627496B (en) | UVM-based register model construction and verification method, system and electronic equipment | |
CN108628761A (en) | Atomic commands execute method and apparatus | |
CN115470125B (en) | Log file-based debugging method, device and storage medium | |
CN116894411A (en) | SPI module verification platform and method with DMA interface | |
CN116560924A (en) | Performance test method, device, computer equipment and readable storage medium |
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 |