[go: up one dir, main page]

CN115061948A - Method and system for verifying non-aligned access in multi-core system - Google Patents

Method and system for verifying non-aligned access in multi-core system Download PDF

Info

Publication number
CN115061948A
CN115061948A CN202210671686.1A CN202210671686A CN115061948A CN 115061948 A CN115061948 A CN 115061948A CN 202210671686 A CN202210671686 A CN 202210671686A CN 115061948 A CN115061948 A CN 115061948A
Authority
CN
China
Prior art keywords
access
data
instruction
controller
aligned
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
Application number
CN202210671686.1A
Other languages
Chinese (zh)
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.)
Guangdong Saifang Technology Co ltd
Original Assignee
Guangdong Saifang Technology 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 Guangdong Saifang Technology Co ltd filed Critical Guangdong Saifang Technology Co ltd
Priority to CN202210671686.1A priority Critical patent/CN115061948A/en
Publication of CN115061948A publication Critical patent/CN115061948A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明涉及处理器技术领域,具体涉及一种多核系统中非对齐访问的验证方法及系统,包括访问指令信息采集器,存储指令信息采集器,访问指令控制器,存储指令控制器,访问指令队列,存储指令队列,内存模型和比较器。本发明适用于多核系统,多核系统中存在多个核正在进行非对齐访问的情况,且要保证数据一致性,本验证方法能很好的解决数据一致性的问题,在验证非对齐访问的同时,验证硬件的数据一致性是否正确。对于本发明若非对齐访问的地址属性是可缓存的,则数据可以从本核缓存中读取,写数据最后也是写入本核缓存中,若非对齐地址属性是不可缓存的,数据需要从外设读取,写数据最后写入外设中,支持不同地址属性的非对齐访问验证。

Figure 202210671686

The invention relates to the technical field of processors, in particular to a method and system for verifying non-aligned access in a multi-core system, including an access instruction information collector, a storage instruction information collector, an access instruction controller, a storage instruction controller, and an access instruction queue , which stores the instruction queue, memory model, and comparator. The present invention is suitable for multi-core systems. In the multi-core system, there are multiple cores performing non-aligned access, and to ensure data consistency, the verification method can well solve the problem of data consistency. , to verify whether the data consistency of the hardware is correct. For the present invention, if the address attribute of non-aligned access is cacheable, the data can be read from the cache of the core, and the write data is also written into the cache of the core. Read and write data is finally written to the peripheral, and supports unaligned access verification of different address attributes.

Figure 202210671686

Description

多核系统中非对齐访问的验证方法及系统Verification method and system for non-aligned access in multi-core system

技术领域technical field

本发明涉及处理器技术领域,具体涉及一种多核系统中非对齐访问的验证方法及系统。The present invention relates to the technical field of processors, in particular to a method and system for verifying unaligned access in a multi-core system.

背景技术Background technique

处理器在访问内存时,地址可以是对齐的,也可以是非对齐的,不同处理器架构对非对齐访问的操作不同,ARM架构提供控制寄存器配置是否支持非对齐访问,X86架构支持非对齐访问,RSICV架构可进行微架构自定义。地址对齐指的是访问大小为一个word时,地址低两位必须为0,访问大小为两个byte时,地址低一位必须为0,访问大小是一个byte时,地址没有要求。When the processor accesses memory, the address can be aligned or unaligned. Different processor architectures have different operations on unaligned access. The ARM architecture provides control over whether the register configuration supports unaligned access, and the X86 architecture supports unaligned access. The RSICV architecture allows for microarchitectural customization. Address alignment means that when the access size is one word, the lower two bits of the address must be 0. When the access size is two bytes, the lower one bit of the address must be 0. When the access size is one byte, the address is not required.

地址非对齐指的是不符合上述规则的地址。不支持非对齐访问的架构在碰到非对齐访问时一般会产生非对齐异常,交给软件来处理,支持非对齐访问的架构一般会将非对齐访问拆分成多条对齐的访问,若是读操作,在获得所有数据后将数据合并,若是写操作,将写数据拆分后分别写入对齐后的地址。Address misalignment refers to addresses that do not conform to the above rules. Architectures that do not support unaligned access will generally generate unaligned exceptions when encountering unaligned access, which will be handled by software. Architectures that support unaligned access will generally split unaligned access into multiple aligned accesses. operation, merge the data after obtaining all the data, if it is a write operation, split the write data and write the aligned addresses respectively.

因此本文提供一种方法的目的就是验证非对齐访问在拆分成多个访问的过程中读数据是否正确,写数据是否正确写入内存或缓存中,同时支持地址属性是可缓存或者不可缓存的非对齐访问的验证。Therefore, the purpose of providing a method in this paper is to verify whether the read data is correct in the process of splitting the unaligned access into multiple accesses, and whether the write data is correctly written into the memory or cache, and at the same time, it supports whether the address attribute is cacheable or uncacheable. Validation of unaligned accesses.

发明内容SUMMARY OF THE INVENTION

针对现有技术的不足,本发明公开了一种多核系统中非对齐访问的验证方法及系统,用于解决在多核系统下,在顶层建模进行仿真,但是这种方法需要一个黄金模型来执行访存指令,对于非对齐访问拆分后的访问指令,对于调用黄金模型的时间点不好把握,容易造成过早或者过完执行访存指令的问题。In view of the deficiencies of the prior art, the present invention discloses a method and system for verifying non-aligned access in a multi-core system, which is used to solve the problem of performing simulation on top-level modeling in a multi-core system, but this method requires a golden model to execute For memory access instructions, for the access instructions after unaligned access splits, it is not easy to grasp the time point of calling the golden model, which may easily cause the problem of premature or over-complete execution of memory access instructions.

本发明通过以下技术方案予以实现:The present invention is achieved through the following technical solutions:

第一方面,本发明提供一种多核系统中非对齐访问的验证系统,包括In a first aspect, the present invention provides a verification system for non-aligned access in a multi-core system, comprising:

访问指令信息采集器,用于监测DUT中访问指令的发射信息,地址,访问大小,地址属性,地址对齐等信息的更新;The access command information collector is used to monitor the update of information such as the transmission information, address, access size, address attribute, address alignment and other information of the access command in the DUT;

存储指令信息采集器,用于监测DUT中存储指令的发射信息,地址,写数据,访问大小,地址属性,地址对齐等信息的更新;The storage instruction information collector is used to monitor the update of information such as transmission information, address, write data, access size, address attribute, address alignment and other information of storage instructions in the DUT;

访问指令控制器,用于控制访问指令的执行,并在控制器接收到新的访问指令时,将访问指令存入访问指令队列;The access command controller is used to control the execution of the access command, and when the controller receives a new access command, the access command is stored in the access command queue;

存储指令控制器,用于控制访问指令的执行,并在控制器接收到新的存储指令时,将存储指令存入存储指令队列;The storage instruction controller is used to control the execution of the access instruction, and when the controller receives a new storage instruction, the storage instruction is stored in the storage instruction queue;

访问指令队列,用于存放DUT中执行的访问指令,指令信息的更新于DUT保持同步;The access instruction queue is used to store the access instructions executed in the DUT, and the update of the instruction information is kept synchronized with the DUT;

存储指令队列,用于存放DUT中执行的存储指令,指令信息的更新于DUT保持同步;The storage instruction queue is used to store the storage instructions executed in the DUT, and the update of the instruction information is synchronized with the DUT;

内存模型,用于在读操作时从内存模型中读取数据,写操作时将数据更新进内存模型;The memory model is used to read data from the memory model during read operations, and update data into the memory model during write operations;

比较器,用于在访问指令提交时,比较DUT和验证系统的访问指令的数据是否一致,并打印比较结果,在存储指令将数据写入缓存或外设时,比较DUT写数据和验证系统的写数据是否一致,并打印比较结果。The comparator is used to compare whether the data of the access command of the DUT and the verification system are consistent when the access command is submitted, and print the comparison result. When the storage command writes the data to the cache or peripheral, compare the data written by the DUT and the verification system. Write whether the data is consistent, and print the comparison result.

更进一步的,所述访问指令控制器接收到访问指令信息更新时,将信息更新访问指令队列中相应的单元,若该访问指令的地址是非对齐的,则该指令会被拆成两次对齐的访问操作,DUT中该访问指令的地址会更新两次,控制器会将这两次地址和两次访问大小的信息都记录在访问指令队列中。Further, when the access command controller receives the access command information update, it updates the information to the corresponding unit in the access command queue. If the address of the access command is unaligned, the command will be split into two alignments. In the access operation, the address of the access instruction in the DUT will be updated twice, and the controller will record the information of the two addresses and the two access sizes in the access instruction queue.

更进一步的,所述访问指令控制器接收到访问指令获得数据的信息时,首先判断这次访问是非对齐访问的第几次获得数据,若是第一次获得数据,则控制器根据ma1_addr和访问大小访问内存模型,获得第一次数据,并存入访问指令队列相应单元,同时保存DUT数据;若是第二次获得数据,则控制器根据ma2_addr和访问大小访问内存模型,获得第二次数据,并将第一次数据和第二次数据拼接在一起,存入访问指令队列相应单元,同时保存DUT数据;Further, when the access instruction controller receives the information that the access instruction obtains the data, it first judges that the access is the number of times the data is obtained by the unaligned access. Access the memory model, obtain the first data, store it in the corresponding unit of the access command queue, and save the DUT data at the same time; if the data is obtained for the second time, the controller accesses the memory model according to ma2_addr and the access size, obtains the second data, and The first data and the second data are spliced together, stored in the corresponding unit of the access command queue, and the DUT data is saved at the same time;

更进一步的,所述访问指令控制器接收到访问指令提交信息时,从访问指令队列中选出对应单元,调用比较器进行数据的比较,比较完成后将该访问指令从访问指令队列中删除。Further, when the access command controller receives the access command submission information, it selects the corresponding unit from the access command queue, calls the comparator to compare the data, and deletes the access command from the access command queue after the comparison is completed.

更进一步的,所述存储指令控制器收到存储指令信息更新时,将信息更新存储指令队列中相应的单元,若该存储指令的地址是非对齐的,则该指令会被拆成两次对齐的存储操作,DUT中该存储指令的地址会更新两次,控制器会将这两次地址和两次存储大小的信息都记录在存储指令队列中。Further, when the storage instruction controller receives the storage instruction information update, it updates the information to the corresponding unit in the storage instruction queue. If the address of the storage instruction is unaligned, the instruction will be split into two alignments. In the storage operation, the address of the storage instruction in the DUT will be updated twice, and the controller will record the information of the two addresses and the two storage sizes in the storage instruction queue.

更进一步的,所述存储指令控制器接收到存储指令将数据写入缓存或者外设的信息时,首先判断这次写操作是非对齐访问的第几次写操作,若是第一次写操作,控制器根据ma1_addr和存储大小,将相应数据写入内存模型,并调用比较器比较当前DUT的写数据于验证系统的写数据是否相同;若是第二次写操作,控制器根据ma2_addr和存储大小,将相应数据写入内存模型,并调用比较器比较当前DUT的写数据于验证系统的写数据是否相同。Further, when the storage instruction controller receives the information that the storage instruction writes data into the cache or peripherals, it first determines that the write operation is the second write operation of the unaligned access. If it is the first write operation, the control The controller writes the corresponding data into the memory model according to ma1_addr and storage size, and calls the comparator to compare the write data of the current DUT to verify whether the write data of the system is the same; if it is the second write operation, the controller according to ma2_addr and storage size, will The corresponding data is written into the memory model, and the comparator is called to compare the write data of the current DUT to verify whether the write data of the system are the same.

第二方面,本发明提供了一种多核系统中非对齐访问的验证方法,所述方法使用第一方面所述的多核系统中非对齐访问的验证系统,所述方法用于非对齐访问指令验证和非对齐存储指令验证。In a second aspect, the present invention provides a method for verifying non-aligned access in a multi-core system, the method uses the verification system for non-aligned access in a multi-core system described in the first aspect, and the method is used for non-aligned access instruction verification and unaligned store instruction validation.

更进一步的,所述方法进行非对齐访问指令验证时,包括以下步骤:Further, when the method performs unaligned access instruction verification, the following steps are included:

访问指令信息采集器监测DUT访问指令的信息,若是新发射的访问指令,则存入访问指令队列中;若是访问指令的更新信息,则将信息更新至访问指令队列中的相应单元;The access command information collector monitors the information of the DUT access command, and if it is a newly launched access command, it is stored in the access command queue; if it is the update information of the access command, the information is updated to the corresponding unit in the access command queue;

根据更新的地址和访问大小信息判断该访问是否为非对齐访问,若访问大小是2个word,但是地址低三位不为0,或者访问大小是1个word,但是地址低两位不为0,或者访问大小为2bytes,但是地址低一位不为0,这三种情况符合非对齐访问的条件。若为非对齐访问,走非对齐访问验证流程,若为对齐访问,走对齐访问验证流程。非对齐访问下,指令会被拆分成两次访问,地址分别为ma1_addr和ma2_addr,都记录在访问指令队列中;Determine whether the access is an unaligned access according to the updated address and access size information. If the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the lower two bits of the address are not 0 , or the access size is 2bytes, but the lower one of the address is not 0, these three cases meet the conditions of unaligned access. If it is an unaligned access, go through the unaligned access verification process, if it is an aligned access, go through the aligned access verification process. Under unaligned access, the instruction will be split into two accesses, and the addresses are ma1_addr and ma2_addr, which are recorded in the access instruction queue;

当访问指令是非对齐访问时,控制器根据地址属性判断是否为可缓存属性,若为可缓存属性,则表示访问数据从缓存中获得,若为不可缓存属性,则表示访问数据从外设中获得;When the access instruction is an unaligned access, the controller judges whether it is a cacheable attribute according to the address attribute. If it is a cacheable attribute, it means that the access data is obtained from the cache. If it is a non-cacheable attribute, it means that the access data is obtained from the peripheral device. ;

当地址属性为可缓存时,控制器监测DUT中访存单元的数据输出信号,进行如下操作:When the address attribute is cacheable, the controller monitors the data output signal of the memory access unit in the DUT, and performs the following operations:

a)当监测到有访问数据输出时,根据DUT中信息判断当前输出数据是第几次访问获得,同时控制器从访问指令队列中选出对应的指令,若为第一次访问,控制器根据ma1_addr来访问内存模型,获得第一笔数据;a) When monitoring the output of access data, according to the information in the DUT, it is judged that the current output data is obtained by the number of accesses, and the controller selects the corresponding command from the access command queue. If it is the first access, the controller will ma1_addr to access the memory model and get the first data;

b)控制器继续监测访问数据输出,若判断为第二次访问,控制器根据ma2_addr来访问内存模型,获得第二笔数据;b) The controller continues to monitor the access data output, and if it is judged to be the second access, the controller accesses the memory model according to ma2_addr to obtain the second data;

c)控制器将第一笔数据和第二笔数据合并在一起,获得最终访问指令的数据;c) The controller merges the first data and the second data together to obtain the data of the final access instruction;

d)比较DUT访存单元最终输出的数据和验证系统中最终的数据,并打印比较结果;d) Compare the data finally output by the DUT memory access unit and the final data in the verification system, and print the comparison result;

当地址属性为不可缓存时,控制器监测外设的访问请求,进行如下操作:When the address attribute is not cacheable, the controller monitors the access request of the peripheral and performs the following operations:

a)当监测到外设的读请求时,控制器根据访问地址和核id从访问指令队列中寻找发起该次请求的访问指令,若该指令地址非对齐且还没有获得有效的数据,则本次请求为第一次访问,控制器根据ma1_addr访问内存模型,获得第一笔数据;a) When monitoring the read request of the peripheral device, the controller searches for the access command that initiates the request from the access command queue according to the access address and core id. If the command address is not aligned and no valid data has been obtained, this The second request is the first access, and the controller accesses the memory model according to ma1_addr to obtain the first data;

b)控制器继续监测外设的读请求,同样的从访问指令队列中寻找对应指令,若该指令地址非对齐且以及获得第一笔数据,则本次请求为第二次访问,控制器根据ma2_addr访问内存模型,获得第二笔数据;b) The controller continues to monitor the read request of the peripheral device, and also searches for the corresponding command from the access command queue. If the command address is not aligned and the first data is obtained, this request is the second access. ma2_addr accesses the memory model and obtains the second data;

c)控制器将第一笔数据和第二笔数据合并在一起,获得最终访问指令的数据;c) The controller merges the first data and the second data together to obtain the data of the final access instruction;

d)比较DUT访存单元最终输出的数据和验证系统中最终的数据,并打印比较结果;d) Compare the data finally output by the DUT memory access unit and the final data in the verification system, and print the comparison result;

控制器监测到访存指令提交时,在访问指令队列中找出相应的指令单元,删除该单元。When the controller detects that the memory access instruction is submitted, it finds the corresponding instruction unit in the access instruction queue, and deletes the unit.

更进一步的,所述方法进行非对齐存储指令验证时,包括以下步骤:Further, when the method performs unaligned storage instruction verification, the following steps are included:

访问指令信息采集器监测DUT存储指令的信息,若是新发射的存储指令,则存入存储指令队列中;若是存储指令的更新信息,则将信息更新至存储指令队列中的相应单元;The access instruction information collector monitors the information of the DUT storage instruction, and if it is a newly launched storage instruction, it is stored in the storage instruction queue; if it is the update information of the storage instruction, the information is updated to the corresponding unit in the storage instruction queue;

根据更新的地址和访问大小信息判断该访问是否为非对齐访问,若访问大小是2个word,但是地址低三位不为0,或者访问大小是1个word,但是地址低两位不为0,或者访问大小为2bytes,但是地址低一位不为0,这三种情况符合非对齐访问的条件。若为非对齐访问,走非对齐访问验证流程,若为对齐访问,走对齐访问验证流程。非对齐访问下,指令会被拆分成两次访问,地址分别为ma1_addr和ma2_addr,都记录在存储指令队列中;Determine whether the access is an unaligned access according to the updated address and access size information. If the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the lower two bits of the address are not 0 , or the access size is 2bytes, but the lower one of the address is not 0, these three cases meet the conditions of unaligned access. If it is an unaligned access, go through the unaligned access verification process, if it is an aligned access, go through the aligned access verification process. Under unaligned access, the instruction will be split into two accesses, the addresses are ma1_addr and ma2_addr, which are recorded in the storage instruction queue;

当存储指令是非对齐访问时,控制器根据地址属性判断是否为可缓存属性,若为可缓存属性,则表示最后数据需要写入缓存中,若为不可缓存属性,则表示最后数据需要写入外设;When the storage instruction is an unaligned access, the controller determines whether it is a cacheable attribute according to the address attribute. If it is a cacheable attribute, it means that the last data needs to be written into the cache; if it is a non-cacheable attribute, it means that the last data needs to be written to the external Assume;

当地址属性为可缓存时,控制器监测DUT中一级缓存的写请求,当地址属性为不可缓存时,控制器监测DUT中外设的写请求,进行如下操作:When the address attribute is cacheable, the controller monitors the write request of the L1 cache in the DUT. When the address attribute is not cacheable, the controller monitors the write request of the peripherals in the DUT, and performs the following operations:

a)控制器根据写请求的地址和访问大小从存储指令队列中找出相应指令,若该指令地址非对齐且没有写过缓存,则控制器根据ma1_addr将一部分数据写入内存模型,写入的同时,比较DUT写数据和验证系统写数据是否一致;a) The controller finds the corresponding instruction from the storage instruction queue according to the address and access size of the write request. If the instruction address is not aligned and has not been written to the cache, the controller writes part of the data into the memory model according to ma1_addr. At the same time, compare the data written by the DUT and verify whether the data written by the system is consistent;

b)控制器继续监测一级缓存和外设的写请求,若存储指令队列中相应的指令已经写过一次数据,则当前写请求为第二次写,控制器根据ma2_addr将另一部分数据写入内存模型,写入的同时,比较DUT写数据和验证系统写数据是否一致;b) The controller continues to monitor the write request of the first-level cache and peripherals. If the corresponding instruction in the storage instruction queue has written data once, the current write request is the second write, and the controller writes another part of the data according to ma2_addr In the memory model, while writing, compare the data written by the DUT and verify whether the data written by the system is consistent;

当存储指令提交时,控制器根据指令标识从存储指令队列中找出相应指令,删除该指令。When the storage instruction is submitted, the controller finds out the corresponding instruction from the storage instruction queue according to the instruction identifier, and deletes the instruction.

本发明的有益效果为:The beneficial effects of the present invention are:

本发明适用于多核系统,多核系统中存在多个核正在进行非对齐访问的情况,且要保证数据一致性,本验证方法能很好的解决数据一致性的问题,在验证非对齐访问的同时,验证硬件的数据一致性是否正确。The present invention is suitable for multi-core systems. In the multi-core system, there are multiple cores performing non-aligned access, and to ensure data consistency, the verification method can well solve the problem of data consistency. , to verify that the data consistency of the hardware is correct.

对于本发明若非对齐访问的地址属性是可缓存的,则数据可以从本核缓存中读取,写数据最后也是写入本核缓存中,若非对齐地址属性是不可缓存的,数据需要从外设读取,写数据最后写入外设中,支持不同地址属性的非对齐访问验证。For the present invention, if the address attribute of non-aligned access is cacheable, the data can be read from the cache of the core, and the write data is also written into the cache of the core. Read and write data is finally written to the peripheral, and supports unaligned access verification of different address attributes.

附图说明Description of drawings

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

图1是本发明验证系统结构图;Fig. 1 is the structure diagram of the verification system of the present invention;

图2是本发明实施例非对齐访问指令验证流程图;2 is a flow chart of the verification of an unaligned access instruction according to an embodiment of the present invention;

图3是本发明实施例非对齐存储指令验证流程图。FIG. 3 is a flow chart of verification of an unaligned storage instruction according to an embodiment of the present invention.

具体实施方式Detailed ways

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

实施例1Example 1

参照图1所示,本实施例提供一种多核系统中非对齐访问的验证系统,包括Referring to FIG. 1 , this embodiment provides a verification system for non-aligned access in a multi-core system, including

访问指令信息采集器,监测DUT中访问指令的发射信息,地址,访问大小,地址属性,地址对齐等信息的更新。The access instruction information collector monitors the update of information such as the launch information, address, access size, address attribute, address alignment and other information of the access instruction in the DUT.

进一步的实施例时,在多核系统中读数据可以确定的时间点,以及访问指令提交的时间点,并将这些信息输送给访问指令控制器。In a further embodiment, the time point at which the data can be read in the multi-core system and the time point at which the access command is submitted can be determined, and these information are sent to the access command controller.

存储指令信息采集器,监测DUT中存储指令的发射信息,地址,写数据,访问大小,地址属性,地址对齐等信息的更新。The storage instruction information collector monitors the update of the transmission information, address, write data, access size, address attribute, address alignment and other information of the storage instruction in the DUT.

进一步的实施例时,存储指令写数据被其他核可见的时间点,以及存储指令提交的时间点,并将这些信息输送给存储指令控制器。In a further embodiment, the time point at which the write data of the storage instruction is visible to other cores and the time point at which the storage instruction is submitted is stored, and these information are sent to the storage instruction controller.

访问指令控制器,用于控制访问指令的执行,控制器接收到新的访问指令时,将访问指令存入访问指令队列。The access command controller is used to control the execution of the access command. When the controller receives a new access command, it stores the access command in the access command queue.

本实施例中控制器接收到访问指令信息更新时,将信息更新访问指令队列中相应的单元,若该访问指令的地址是非对齐的,则该指令会被拆成两次对齐的访问操作,DUT中该访问指令的地址会更新两次,控制器会将这两次地址(ma1_addr和ma2_addr)和两次访问大小的信息都记录在访问指令队列中。In this embodiment, when the controller receives the update of the access instruction information, it updates the information to the corresponding unit in the access instruction queue. If the address of the access instruction is not aligned, the instruction will be split into two aligned access operations, and the DUT The address of the access instruction will be updated twice, and the controller will record the two addresses (ma1_addr and ma2_addr) and the information of the two access sizes in the access instruction queue.

本实施例中控制器接收到访问指令获得数据的信息时,首先判断这次访问是非对齐访问的第几次获得数据,若是第一次获得数据,则控制器根据ma1_addr和访问大小访问内存模型,获得第一次数据,并存入访问指令队列相应单元,同时保存DUT数据;若是第二次获得数据,则控制器根据ma2_addr和访问大小访问内存模型,获得第二次数据,并将第一次数据和第二次数据拼接在一起,存入访问指令队列相应单元,同时保存DUT数据。In this embodiment, when the controller receives the information that the access instruction obtains the data, it firstly judges that the access is the number of times the data is obtained by the unaligned access. If the data is obtained for the first time, the controller accesses the memory model according to the ma1_addr and the access size, Obtain the data for the first time, store it in the corresponding unit of the access command queue, and save the DUT data at the same time; if the data is obtained for the second time, the controller accesses the memory model according to ma2_addr and the access size, obtains the data for the second time, and stores the data for the first time. The data and the second data are spliced together, stored in the corresponding unit of the access command queue, and the DUT data is saved at the same time.

本实施例中控制器接收到访问指令提交信息时,从访问指令队列中选出对应单元,调用比较器进行数据的比较,比较完成后将该访问指令从访问指令队列中删除。In this embodiment, when the controller receives the access command submission information, it selects the corresponding unit from the access command queue, calls the comparator to compare the data, and deletes the access command from the access command queue after the comparison is completed.

存储指令控制器,用于控制访问指令的执行,控制器接收到新的存储指令时,将存储指令存入存储指令队列。The storage instruction controller is used to control the execution of the access instruction. When the controller receives a new storage instruction, the storage instruction is stored in the storage instruction queue.

本实施例中控制器接收到存储指令信息更新时,将信息更新存储指令队列中相应的单元,若该存储指令的地址是非对齐的,则该指令会被拆成两次对齐的存储操作,DUT中该存储指令的地址会更新两次,控制器会将这两次地址(ma1_addr和ma2_addr)和两次存储大小的信息都记录在存储指令队列中。In this embodiment, when the controller receives the update of the storage instruction information, it updates the information to the corresponding unit in the storage instruction queue. If the address of the storage instruction is not aligned, the instruction will be split into two aligned storage operations, and the DUT The address of the storage instruction will be updated twice, and the controller will record the two addresses (ma1_addr and ma2_addr) and the information of the two storage sizes in the storage instruction queue.

本实施例中控制器接收到存储指令将数据写入缓存或者外设的信息时,首先判断这次写操作是非对齐访问的第几次写操作,若是第一次写操作,控制器根据ma1_addr和存储大小,将相应数据写入内存模型,并调用比较器比较当前DUT的写数据于验证系统的写数据是否相同;若是第二次写操作,控制器根据ma2_addr和存储大小,将相应数据写入内存模型,并调用比较器比较当前DUT的写数据于验证系统的写数据是否相同。In this embodiment, when the controller receives the information that the storage instruction writes data into the cache or the peripheral device, it firstly judges that the write operation is the second write operation of the unaligned access. Storage size, write the corresponding data into the memory model, and call the comparator to compare the write data of the current DUT to verify whether the write data of the system is the same; if the second write operation, the controller writes the corresponding data according to ma2_addr and storage size Memory model, and call the comparator to compare the write data of the current DUT to verify whether the write data of the system is the same.

本实施例中控制器接收到存储指令提交信息时,将该指令从存储指令队列中删除。In this embodiment, when the controller receives the storage instruction submission information, the controller deletes the instruction from the storage instruction queue.

访问指令队列,用于存放DUT中执行的访问指令,指令信息的更新于DUT保持同步,同时保存验证系统执行访问指令的结果。每个核有独立的访问指令队列。The access instruction queue is used to store the access instructions executed in the DUT. The update of the instruction information is synchronized with the DUT, and at the same time, the result of the verification system executing the access instruction is saved. Each core has an independent access instruction queue.

存储指令队列,用于存放DUT中执行的存储指令,指令信息的更新于DUT保持同步,同时保存验证系统执行存储指令的结果。每个核有独立的存储指令队列。The storage instruction queue is used to store the storage instructions executed in the DUT. The update of the instruction information is synchronized with the DUT, and at the same time, the result of the verification system executing the storage instruction is saved. Each core has an independent store instruction queue.

内存模型,验证系统中的内存模型,读操作从内存模型中读取数据,写操作将数据更新进内存模型。Memory model, verify the memory model in the system, read operations read data from the memory model, and write operations update data into the memory model.

比较器,在访问指令提交时,比较DUT和验证系统的访问指令的数据是否一致,并打印比较结果;在存储指令将数据写入缓存或外设时,比较DUT写数据和验证系统的写数据是否一致,并打印比较结果。The comparator, when the access command is submitted, compares the data of the DUT and the verification system's access command, and prints the comparison result; when the storage command writes the data to the cache or peripheral, compares the DUT's write data and the verification system's write data. Whether it is consistent, and print the comparison result.

本实施例验证系统针对地址为非对齐的访存指令进行验证,能够验证每条拆分后的指令的正确性,包括访问指令获得数据的正确性,存储指令写数据的正确性。The verification system in this embodiment verifies the memory access instructions whose addresses are not aligned, and can verify the correctness of each split instruction, including the correctness of the data obtained by the access instruction and the correctness of the data written by the storage instruction.

本实施例验证系统支持地址属性为可缓存和不可缓存的非对齐访存指令验证,不同地址属性下,监测的指令perform时间点不同,对于可缓存访存指令,perform时间点为读写缓存的时刻,对于不可缓存访存指令,perform时间点为外设接收读取请求的时刻。The verification system of this embodiment supports the verification of unaligned memory access instructions whose address attributes are cacheable and non-cacheable. Under different address attributes, the monitored instruction perform time points are different. For cacheable memory access instructions, the perform time point is the read-write cache. Time, for non-cacheable memory access instructions, the perform time point is the time when the peripheral receives the read request.

本实施例本验证系统适用于多核系统,且核的个数可配,在验证数据正确性的同时,遵守缓存一致性原理。In this embodiment, the verification system is suitable for a multi-core system, and the number of cores can be configured. While verifying the correctness of data, the principle of cache consistency is followed.

实施例2Example 2

参照图2所示,本实施例提供一种非对齐访问指令验证流程,具体如下:Referring to FIG. 2 , this embodiment provides an unaligned access instruction verification process, which is as follows:

1.访问指令信息采集器监测DUT访问指令的信息,若是新发射的访问指令,则存入访问指令队列中;若是访问指令的更新信息,则将信息更新至访问指令队列中的相应单元。1. The access command information collector monitors the information of the DUT access command. If it is a newly launched access command, it will be stored in the access command queue; if it is the update information of the access command, it will update the information to the corresponding unit in the access command queue.

2.控制器根据更新的地址和访问大小信息判断该访问是否为非对齐访问,若访问大小是2个word,但是地址低三位不为0,或者访问大小是1个word,但是地址低两位不为0,或者访问大小为2bytes,但是地址低一位不为0,这三种情况符合非对齐访问的条件。2. The controller judges whether the access is an unaligned access according to the updated address and access size information. If the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the address is two lower. The bit is not 0, or the access size is 2bytes, but the lower one of the address is not 0, these three cases meet the conditions of unaligned access.

本实施例中,若为非对齐访问,走非对齐访问验证流程,若为对齐访问,走对齐访问验证流程。In this embodiment, if the access is unaligned, the unaligned access verification process is performed, and if the access is aligned, the aligned access verification process is performed.

本实施例中,非对齐访问下,指令会被拆分成两次访问,地址分别为ma1_addr和ma2_addr,都记录在访问指令队列中。In this embodiment, under unaligned access, the instruction is split into two accesses, and the addresses are respectively ma1_addr and ma2_addr, which are recorded in the access instruction queue.

3.当访问指令是非对齐访问时,控制器根据地址属性判断是否为可缓存属性,若为可缓存属性,则表示访问数据从缓存中获得,若为不可缓存属性,则表示访问数据从外设中获得。3. When the access instruction is an unaligned access, the controller judges whether it is a cacheable attribute according to the address attribute. If it is a cacheable attribute, it means that the access data is obtained from the cache. If it is a non-cacheable attribute, it means that the access data is obtained from the peripheral device. obtained in.

4.当地址属性为可缓存时,控制器监测DUT中访存单元的数据输出信号,进行如下操作:4. When the address attribute is cacheable, the controller monitors the data output signal of the memory access unit in the DUT, and performs the following operations:

a)当监测到有访问数据输出时,根据DUT中信息判断当前输出数据是第几次访问获得,同时控制器从访问指令队列中选出对应的指令,若为第一次访问,控制器根据ma1_addr来访问内存模型,获得第一笔数据;a) When monitoring the output of access data, according to the information in the DUT, it is judged that the current output data is obtained by the number of accesses, and the controller selects the corresponding command from the access command queue. If it is the first access, the controller will ma1_addr to access the memory model and get the first data;

b)控制器继续监测访问数据输出,若判断为第二次访问,控制器根据ma2_addr来访问内存模型,获得第二笔数据;b) The controller continues to monitor the access data output, and if it is judged to be the second access, the controller accesses the memory model according to ma2_addr to obtain the second data;

c)控制器将第一笔数据和第二笔数据合并在一起,获得最终访问指令的数据;c) The controller merges the first data and the second data together to obtain the data of the final access instruction;

d)比较DUT访存单元最终输出的数据和验证系统中最终的数据,并打印比较结果。d) Compare the final output data of the DUT memory access unit with the final data in the verification system, and print the comparison result.

5.当地址属性为不可缓存时,控制器监测外设的访问请求,进行如下操作:5. When the address attribute is not cacheable, the controller monitors the access request of the peripheral and performs the following operations:

a)当监测到外设的读请求时,控制器根据访问地址和核id从访问指令队列中寻找发起该次请求的访问指令,若该指令地址非对齐且还没有获得有效的数据,则本次请求为第一次访问,控制器根据ma1_addr访问内存模型,获得第一笔数据;a) When monitoring the read request of the peripheral device, the controller searches for the access command that initiates the request from the access command queue according to the access address and core id. If the command address is not aligned and no valid data has been obtained, this The second request is the first access, and the controller accesses the memory model according to ma1_addr to obtain the first data;

b)控制器继续监测外设的读请求,同样的从访问指令队列中寻找对应指令,若该指令地址非对齐且以及获得第一笔数据,则本次请求为第二次访问,控制器根据ma2_addr访问内存模型,获得第二笔数据;b) The controller continues to monitor the read request of the peripheral device, and also searches for the corresponding command from the access command queue. If the command address is not aligned and the first data is obtained, this request is the second access. ma2_addr accesses the memory model and obtains the second data;

c)控制器将第一笔数据和第二笔数据合并在一起,获得最终访问指令的数据;c) The controller merges the first data and the second data together to obtain the data of the final access instruction;

d)比较DUT访存单元最终输出的数据和验证系统中最终的数据,并打印比较结果。d) Compare the final output data of the DUT memory access unit with the final data in the verification system, and print the comparison result.

6.控制器监测到访存指令提交时,在访问指令队列中找出相应的指令单元,删除该单元。6. When the controller detects that the memory access instruction is submitted, it finds the corresponding instruction unit in the access instruction queue, and deletes the unit.

实施例3Example 3

参照图3所示,本实施例提供一种非对齐存储指令验证流程具体如下:Referring to FIG. 3 , the present embodiment provides an unaligned storage instruction verification process as follows:

1.访问指令信息采集器监测DUT存储指令的信息,若是新发射的存储指令,则存入存储指令队列中;若是存储指令的更新信息,则将信息更新至存储指令队列中的相应单元。1. The access instruction information collector monitors the information of the DUT storage instruction. If it is a newly launched storage instruction, it will be stored in the storage instruction queue; if it is the update information of the storage instruction, the information will be updated to the corresponding unit in the storage instruction queue.

2.控制器根据更新的地址和访问大小信息判断该访问是否为非对齐访问,若访问大小是2个word,但是地址低三位不为0,或者访问大小是1个word,但是地址低两位不为0,或者访问大小为2bytes,但是地址低一位不为0,这三种情况符合非对齐访问的条件。2. The controller judges whether the access is an unaligned access according to the updated address and access size information. If the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the address is two lower. The bit is not 0, or the access size is 2bytes, but the lower one of the address is not 0, these three cases meet the conditions of unaligned access.

本实施例中,若为非对齐访问,走非对齐访问验证流程,若为对齐访问,走对齐访问验证流程。In this embodiment, if the access is unaligned, the unaligned access verification process is performed, and if the access is aligned, the aligned access verification process is performed.

本实施例中,非对齐访问下,指令会被拆分成两次访问,地址分别为ma1_addr和ma2_addr,都记录在存储指令队列中。In this embodiment, under unaligned access, the instruction will be split into two accesses, and the addresses are respectively ma1_addr and ma2_addr, both of which are recorded in the storage instruction queue.

3.当存储指令是非对齐访问时,控制器根据地址属性判断是否为可缓存属性,若为可缓存属性,则表示最后数据需要写入缓存中,若为不可缓存属性,则表示最后数据需要写入外设。3. When the storage instruction is an unaligned access, the controller determines whether it is a cacheable attribute according to the address attribute. If it is a cacheable attribute, it means that the last data needs to be written into the cache. If it is a non-cacheable attribute, it means that the last data needs to be written. into the peripheral.

4.当地址属性为可缓存时,控制器监测DUT中一级缓存的写请求,当地址属性为不可缓存时,控制器监测DUT中外设的写请求,进行如下操作:4. When the address attribute is cacheable, the controller monitors the write request of the first-level cache in the DUT. When the address attribute is not cacheable, the controller monitors the write request of the peripherals in the DUT, and performs the following operations:

a)控制器根据写请求的地址和访问大小从存储指令队列中找出相应指令,若该指令地址非对齐且没有写过缓存,则控制器根据ma1_addr将一部分数据写入内存模型,写入的同时,比较DUT写数据和验证系统写数据是否一致;a) The controller finds the corresponding instruction from the storage instruction queue according to the address and access size of the write request. If the instruction address is not aligned and has not been written to the cache, the controller writes part of the data into the memory model according to ma1_addr. At the same time, compare the data written by the DUT and verify whether the data written by the system is consistent;

b)控制器继续监测一级缓存和外设的写请求,若存储指令队列中相应的指令已经写过一次数据,则当前写请求为第二次写,控制器根据ma2_addr将另一部分数据写入内存模型,写入的同时,比较DUT写数据和验证系统写数据是否一致;b) The controller continues to monitor the write request of the first-level cache and peripherals. If the corresponding instruction in the storage instruction queue has written data once, the current write request is the second write, and the controller writes another part of the data according to ma2_addr In the memory model, while writing, compare the data written by the DUT and verify whether the data written by the system is consistent;

5.当存储指令提交时,控制器根据指令标识从存储指令队列中找出相应指令,删除该指令。5. When the storage instruction is submitted, the controller finds out the corresponding instruction from the storage instruction queue according to the instruction identifier, and deletes the instruction.

综上,本发明适用于多核系统,多核系统中存在多个核正在进行非对齐访问的情况,且要保证数据一致性,本验证方法能很好的解决数据一致性的问题,在验证非对齐访问的同时,验证硬件的数据一致性是否正确。To sum up, the present invention is suitable for multi-core systems. In a multi-core system, there are situations where multiple cores are accessing non-aligned access, and to ensure data consistency, this verification method can well solve the problem of data consistency. While accessing, verify whether the data consistency of the hardware is correct.

对于本发明若非对齐访问的地址属性是可缓存的,则数据可以从本核缓存中读取,写数据最后也是写入本核缓存中,若非对齐地址属性是不可缓存的,数据需要从外设读取,写数据最后写入外设中,支持不同地址属性的非对齐访问验证。For the present invention, if the address attribute of non-aligned access is cacheable, the data can be read from the cache of the core, and the write data is also written into the cache of the core. Read and write data is finally written to the peripheral, and supports unaligned access verification of different address attributes.

以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。The above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A verification system for non-aligned access in a multi-core system includes
The access instruction information collector is used for monitoring the updating of information such as emission information, address, access size, address attribute, address alignment and the like of an access instruction in the DUT;
the storage instruction information collector is used for monitoring the updating of information such as transmission information, addresses, write data, access sizes, address attributes, address alignment and the like of storage instructions in the DUT;
the access instruction controller is used for controlling the execution of the access instruction and storing the access instruction into an access instruction queue when the controller receives a new access instruction;
the storage instruction controller is used for controlling the execution of the access instruction and storing the storage instruction into the storage instruction queue when the controller receives a new storage instruction;
the access instruction queue is used for storing access instructions executed in the DUT, and updating of instruction information keeps synchronization with the DUT;
the storage instruction queue is used for storing storage instructions executed in the DUT, and updating of instruction information keeps synchronization with the DUT;
the memory model is used for reading data from the memory model during read operation and updating the data into the memory model during write operation;
and the comparator is used for comparing whether the data of the access instructions of the DUT and the verification system are consistent or not when the access instructions are submitted and printing the comparison result, and comparing whether the data written by the DUT is consistent with the data written by the verification system or not when the data are written into the cache or the peripheral by the storage instructions and printing the comparison result.
2. The system of claim 1, wherein the access instruction controller receives an access instruction information update, updates information to a corresponding unit in the access instruction queue, if the address of the access instruction is not aligned, the access instruction is disassembled into two aligned access operations, the address of the access instruction in the DUT is updated twice, and the controller records the two addresses and the two access size information in the access instruction queue.
3. The system according to claim 2, wherein when the access command controller receives information that the access command obtains data, it first determines that the access is the data obtained for the second time of the non-aligned access, and if the access obtains data for the first time, the controller accesses the memory model according to ma1_ addr and the access size to obtain the first data, and stores the first data in the corresponding unit of the access command queue, and stores DUT data; if the data are obtained for the second time, the controller accesses the memory model according to the ma2_ addr and the access size to obtain the second data, splices the first data and the second data together, stores the first data and the second data into corresponding units of the access instruction queue, and simultaneously stores DUT data.
4. The system according to claim 2, wherein when the access instruction controller receives the access instruction submission information, the access instruction controller selects the corresponding unit from the access instruction queue, invokes the comparator to compare the data, and deletes the access instruction from the access instruction queue after the comparison is completed.
5. The system of claim 1, wherein the store instruction controller receives an update of store instruction information, updates a corresponding location in the store instruction queue with the information, if the address of the store instruction is not aligned, the store instruction is disassembled into two aligned store operations, the address of the store instruction in the DUT is updated twice, and the controller records the two addresses and the two store sizes in the store instruction queue.
6. The system according to claim 1, wherein when the storage instruction controller receives the information that the storage instruction writes data into the cache or the peripheral device, it first determines that the write operation is the second write operation of the non-aligned access, and if the write operation is the first write operation, the controller writes the corresponding data into the memory model according to ma1_ addr and the storage size, and invokes the comparator to compare whether the write data of the current DUT is the same as the write data of the verification system; if the data is written for the second time, the controller writes corresponding data into the memory model according to the ma2_ addr and the storage size, and calls the comparator to compare whether the write data of the current DUT is the same as the write data of the verification system.
7. A method for verifying non-aligned access in a multi-core system, the method using the system for verifying non-aligned access in a multi-core system according to any one of claims 1 to 6, wherein the method is used for verification of non-aligned access instructions and verification of non-aligned storage instructions.
8. The method for verifying non-aligned access in a multi-core system according to claim 7, wherein the method comprises the following steps when verifying a non-aligned access instruction:
monitoring information of the DUT access instruction by the access instruction information collector, and storing the information into an access instruction queue if the access instruction is newly transmitted; if the access instruction is updated, updating the information to a corresponding unit in the access instruction queue;
and judging whether the access is a non-aligned access according to the updated address and the access size information, wherein if the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the lower two bits of the address are not 0, or the access size is 2bytes, but the lower one bit of the address is not 0, the three conditions are in accordance with the conditions of the non-aligned access. And if the access is the non-aligned access, the non-aligned access verification process is carried out, and if the access is the aligned access, the aligned access verification process is carried out. Under the non-aligned access, the instruction is divided into two accesses, addresses are respectively ma1_ addr and ma2_ addr, and the addresses are recorded in an access instruction queue;
when the access instruction is non-aligned access, the controller judges whether the access instruction is a cacheable attribute according to the address attribute, if the access instruction is the cacheable attribute, the access instruction indicates that the access data is obtained from a cache, and if the access instruction is a non-cacheable attribute, the access instruction indicates that the access data is obtained from an external device;
when the address attribute is cacheable, the controller monitors the data output signal of the memory access unit in the DUT, and the following operations are carried out:
a) when monitoring that the access data are output, judging that the current output data are obtained by accessing for the second time according to the information in the DUT, simultaneously selecting a corresponding instruction from an access instruction queue by a controller, and if the current output data are obtained by accessing the memory model according to ma1_ addr to obtain first data if the current output data are the first access;
b) the controller continuously monitors the access data output, and if the access data output is judged to be the second access, the controller accesses the memory model according to the ma2_ addr to obtain second data;
c) the controller combines the first data and the second data together to obtain the data of the final access instruction;
d) comparing the data finally output by the DUT memory access unit with the data finally output by the verification system, and printing a comparison result;
when the address attribute is not cacheable, the controller monitors the access request of the peripheral equipment and performs the following operations:
a) when a peripheral read request is monitored, the controller searches an access instruction for initiating the request from an access instruction queue according to an access address and a core id, if the instruction addresses are not aligned and effective data are not obtained yet, the request is accessed for the first time, and the controller accesses the memory model according to ma1_ addr to obtain first data;
b) the controller continuously monitors the read request of the peripheral equipment, the corresponding instruction is searched from the access instruction queue in the same way, if the instruction address is not aligned and the first data is obtained, the request is accessed for the second time, and the controller accesses the memory model according to the ma2_ addr to obtain the second data;
c) the controller combines the first data and the second data together to obtain the data of the final access instruction;
d) comparing the data finally output by the DUT memory access unit with the data finally output by the verification system, and printing a comparison result;
when the controller monitors that the access instruction is submitted, the corresponding instruction unit is found in the access instruction queue, and the unit is deleted.
9. The method for verifying non-aligned access in a multi-core system according to claim 7, wherein the method comprises the following steps when verifying the non-aligned storage instruction:
the access instruction information collector monitors information of a DUT storage instruction, and if the information is a newly transmitted storage instruction, the information is stored into a storage instruction queue; if the information is the updating information of the storage instruction, the information is updated to a corresponding unit in the storage instruction queue;
and judging whether the access is a non-aligned access according to the updated address and the access size information, wherein if the access size is 2 words, but the lower three bits of the address are not 0, or the access size is 1 word, but the lower two bits of the address are not 0, or the access size is 2bytes, but the lower one bit of the address is not 0, the three conditions are in accordance with the conditions of the non-aligned access. And if the access is the non-aligned access, the non-aligned access verification process is carried out, and if the access is the aligned access, the aligned access verification process is carried out. Under the condition of non-aligned access, the instruction can be split into two accesses, addresses are respectively ma1_ addr and ma2_ addr, and the addresses are recorded in a storage instruction queue;
when the storage instruction is in non-aligned access, the controller judges whether the storage instruction is a cacheable attribute according to the address attribute, if the storage instruction is the cacheable attribute, the last data is indicated to be written into the cache, and if the storage instruction is a non-cacheable attribute, the last data is indicated to be written into the peripheral;
when the address attribute is cacheable, the controller monitors the write request of a first-level cache in the DUT, and when the address attribute is non-cacheable, the controller monitors the write request of peripheral equipment in the DUT, and the following operations are performed:
a) the controller finds out a corresponding instruction from the storage instruction queue according to the address and the access size of the write request, if the instruction address is not aligned and the cache is not written, the controller writes a part of data into the memory model according to the ma1_ addr, and compares the DUT write data and the verification system write data to be consistent during writing;
b) the controller continuously monitors write requests of the first-level cache and the peripheral equipment, if data are written once by corresponding instructions in the storage instruction queue, the current write request is written for the second time, the controller writes the other part of data into the memory model according to the ma2_ addr, and the data written by the DUT and the data written by the verification system are compared to be consistent during writing;
when the storage instruction is submitted, the controller finds out the corresponding instruction from the storage instruction queue according to the instruction identification and deletes the instruction.
CN202210671686.1A 2022-06-14 2022-06-14 Method and system for verifying non-aligned access in multi-core system Pending CN115061948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210671686.1A CN115061948A (en) 2022-06-14 2022-06-14 Method and system for verifying non-aligned access in multi-core system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210671686.1A CN115061948A (en) 2022-06-14 2022-06-14 Method and system for verifying non-aligned access in multi-core system

Publications (1)

Publication Number Publication Date
CN115061948A true CN115061948A (en) 2022-09-16

Family

ID=83199536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210671686.1A Pending CN115061948A (en) 2022-06-14 2022-06-14 Method and system for verifying non-aligned access in multi-core system

Country Status (1)

Country Link
CN (1) CN115061948A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472797A (en) * 2023-12-28 2024-01-30 北京微核芯科技有限公司 Processing method and device of unaligned address access instruction and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020174317A1 (en) * 2001-05-18 2002-11-21 Intel Corporation Apparatus and method for performing non-aligned memory accesses
CN104407880A (en) * 2014-10-27 2015-03-11 杭州中天微系统有限公司 RISC (reduced instruction-set computer) processor loading/storage unit supporting non-aligned hardware storage accessing
US20170235557A1 (en) * 2016-02-16 2017-08-17 Microsoft Technology Licensing, Llc. Translating atomic read-modify-write accesses
CN110175049A (en) * 2019-05-17 2019-08-27 西安微电子技术研究所 A kind of data fractionation for supporting that address is unjustified and the processing system and method that polymerize access
CN114237715A (en) * 2021-11-16 2022-03-25 广东赛昉科技有限公司 Multi-core memory access instruction verification system and method
CN114237955A (en) * 2021-12-16 2022-03-25 广东赛昉科技有限公司 Verification method and system for memory disambiguation in processor
CN114237997A (en) * 2021-12-16 2022-03-25 广东赛昉科技有限公司 Verification method and system of LRSC instruction in RISCV instruction set

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020174317A1 (en) * 2001-05-18 2002-11-21 Intel Corporation Apparatus and method for performing non-aligned memory accesses
CN104407880A (en) * 2014-10-27 2015-03-11 杭州中天微系统有限公司 RISC (reduced instruction-set computer) processor loading/storage unit supporting non-aligned hardware storage accessing
US20170235557A1 (en) * 2016-02-16 2017-08-17 Microsoft Technology Licensing, Llc. Translating atomic read-modify-write accesses
CN110175049A (en) * 2019-05-17 2019-08-27 西安微电子技术研究所 A kind of data fractionation for supporting that address is unjustified and the processing system and method that polymerize access
CN114237715A (en) * 2021-11-16 2022-03-25 广东赛昉科技有限公司 Multi-core memory access instruction verification system and method
CN114237955A (en) * 2021-12-16 2022-03-25 广东赛昉科技有限公司 Verification method and system for memory disambiguation in processor
CN114237997A (en) * 2021-12-16 2022-03-25 广东赛昉科技有限公司 Verification method and system of LRSC instruction in RISCV instruction set

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐沛文;陈海燕;陈书明;燕世林;: "基于SystemVerilog的向量存储器验证方法", 计算机研究与发展, no. 1, 15 December 2014 (2014-12-15), pages 248 - 253 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472797A (en) * 2023-12-28 2024-01-30 北京微核芯科技有限公司 Processing method and device of unaligned address access instruction and electronic equipment

Similar Documents

Publication Publication Date Title
CN111611120B (en) On-chip multi-core processor Cache consistency protocol verification method, system and medium
CN114580344B (en) Test excitation generation method, verification system and related equipment
US11650754B2 (en) Data accessing method, device, and storage medium
CN116167310A (en) Method and device for verifying cache consistency of multi-core processor
JPH0997230A (en) Method and system for data transfer
JP2000020391A (en) Storage device, data processor and its method
CN116245054A (en) Verification method, verification device, electronic apparatus, and computer-readable storage medium
WO2016066081A1 (en) Data writing method and device
CN115061948A (en) Method and system for verifying non-aligned access in multi-core system
JPH0744324A (en) I / O control method for external storage
CN114237997A (en) Verification method and system of LRSC instruction in RISCV instruction set
CN114237715A (en) Multi-core memory access instruction verification system and method
CN112486723B (en) Data verification method, device, processor and electronic equipment
KR100404374B1 (en) Method and apparatus for implementing automatic cache variable update
US11734005B2 (en) Processor with split read
CN115269199B (en) Data processing method, device, electronic device and computer-readable storage medium
CN116627331A (en) Cache verification device, method and system
JP2002312416A (en) Logic verification device and method for memory control circuit
US20070079109A1 (en) Simulation apparatus and simulation method
CN115756998B (en) Cache data re-fetching mark verification method, device and system
JP2001318766A (en) Disk array device and cache memory control method
CN114860724B (en) Database shared memory buffer pool processing method, storage medium and device
CN114153767B (en) Method and device for realizing data consistency of DMA (direct memory Access) equipment of processor
JP3081635B2 (en) Cache memory invalidation processing apparatus and invalidation control method
CN114791913A (en) Method, storage medium and device for processing shared memory buffer pool of database

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