Real-time acquisition method and device for register change and electronic equipment
By constructing a detection module corresponding to the register and a UVM transmission mechanism, the internal storage data of the register is monitored and updated in real time, solving the problem that the real-time jump state of the register cannot be accurately known in the existing technology, and realizing high-precision register comparison.
Patent Information
- Application Number
- CN202211718808.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-12-29
AI Technical Summary
Existing technologies cannot accurately determine the real-time jump state of registers, making it impossible to achieve high-precision comparisons at the cycle level.
A detection module corresponding to the register is constructed. By defining detection events, changes in the internal storage data of the register are detected in real time. The detection module is then passed to the verification component using the UVM transmission mechanism, thereby realizing real-time data monitoring and updating of the register.
It enables real-time data monitoring and updating of registers, ensuring high-precision comparison at the cycle level and solving the problem that existing solutions cannot obtain register changes in real time.
Smart Images

Figure CN116185496B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of register technology, and more specifically, to a method, apparatus, computer-readable storage medium, processor, and electronic device for real-time acquisition of register changes. Background Technology
[0002] Existing solutions generally configure function registers using UVM register models / VMM RAL (Register Abstraction Layer), etc. The verification component obtains the register configuration values via handles to the register models and then uses `get()` or `get_mirror_value()` methods. The process is as follows: Figure 1 As shown, this method cannot accurately know the real-time jump state of the register. When it is necessary to accurately compare the real-time state of the output signal, the jump of the register will directly affect the final real-time state. Using this method, it is difficult to achieve high-precision comparison at the cycle level. Summary of the Invention
[0003] The main objective of this application is to provide a method, apparatus, computer-readable storage medium, processor, and electronic device for real-time acquisition of register changes, so as to at least solve the problem that existing solutions cannot acquire register changes in real time.
[0004] To achieve the above objectives, according to one aspect of this application, a method for real-time acquisition of register changes is provided. The method includes: constructing a detection module corresponding to the register, the detection module being used to detect in real time whether the data stored internally in the register has changed; and, when a verification component is used to verify that the data stored internally in the register has changed, determining whether the verification component has detected that the data stored internally in the register has changed.
[0005] Optionally, constructing a detection module corresponding to the register includes: constructing the detection module; defining detection events in the detection module, wherein the detection events are used to detect in real time whether the data stored internally in the register has changed.
[0006] Optionally, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using a UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0007] Optionally, when the verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0008] Optionally, after determining that the data stored internally in the register has changed, the method further includes: using the verification component to call an update function to upgrade the register and obtain an upgraded register, wherein the update function is used to update the register.
[0009] Optionally, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0010] According to another aspect of this application, a real-time acquisition device for register changes is provided. The device includes a construction unit and a verification unit. The construction unit is used to construct a detection module corresponding to the register, and the detection module is used to detect in real time whether the data stored internally in the register has changed. The verification unit is used to determine whether the verification component has detected a change in the data stored internally in the register when the verification component verifies that the data stored internally in the register has changed.
[0011] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the aforementioned real-time acquisition methods of register changes.
[0012] According to another aspect of this application, a processor is provided for running a program, wherein the program executes any of the aforementioned real-time acquisition methods for register changes.
[0013] According to another aspect of this application, an electronic device is provided, the electronic device including one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a real-time acquisition method for performing any of the aforementioned register changes.
[0014] By applying the technical solution of this application, a detection module corresponding to the register is constructed, and then a verification component is used to verify whether the data stored inside the register has changed. This determines whether the data stored inside the register has changed in real time, thereby solving the problem that the existing solution cannot obtain the changes in the register in real time. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for a real-time acquisition method of execution register changes provided in an embodiment of this application is shown.
[0017] Figure 2 A flowchart is shown for a real-time acquisition method of register changes according to an embodiment of this application;
[0018] Figure 3 A schematic diagram of a real-time acquisition device for register changes provided according to an embodiment of this application is shown.
[0019] The above figures include the following reference numerals:
[0020] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] As described in the background section, existing solutions generally configure function registers using UVM reg model / VMM RAL, etc. The verification component obtains the register configuration values via the reg model handle and then uses `get()` or `get_mirror_value()`. The process is as follows... Figure 1 As shown, this method cannot accurately obtain the real-time jump state of the register. When it is necessary to accurately compare the real-time state of the output signal, the jump of the register will directly affect the final real-time state. Using this method, it is difficult to achieve high-precision comparison at the cycle level. In order to solve the problem that the existing solution cannot obtain the changes of the register in real time, the embodiments of this application provide a method, apparatus, computer-readable storage medium, processor and electronic device for real-time acquisition of register changes.
[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0026] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a real-time acquisition method of register changes according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0027] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the device information display method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] This embodiment provides a method for real-time acquisition of register changes running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] Figure 2 This is a flowchart illustrating a real-time method for acquiring register changes according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0030] Step S201: Construct a detection module corresponding to the register. The detection module is used to detect in real time whether the data stored inside the register has changed.
[0031] Step S202: If the verification component verifies that the data stored inside the above register has changed, determine whether the verification component has detected that the data stored inside the above register has changed.
[0032] In the above steps, by constructing a detection module corresponding to the register, and by using a verification component to verify whether the data stored inside the register has changed, it is determined whether the verification component has detected a change in the data stored inside the register. This allows for real-time determination of whether the data stored inside the register has changed, thereby solving the problem of not being able to obtain changes in the register in real time in existing solutions.
[0033] In one embodiment of this application, a detection module corresponding to the register is constructed, comprising: constructing the detection module; defining detection events in the detection module, wherein the detection events are used to detect in real time whether the data internally stored in the register has changed. This effectively monitors changes in all output ports of the register in real time, ensuring the real-time performance of subsequent processes.
[0034] Specifically, the interface is the detection module, and the programming for this part is as follows:
[0035] interface reg_prob_if(
[0036] input wire reg_demo1_out, ......
[0038] input wire reg_demo2_out);
[0039] Define a register output detection event (event); define a detection event that reacts to changes in the register in real time.
[0040] event reg_change_evt;
[0041] By outputting signals or performing operations on all registers, the function of reflecting register changes in real time can be achieved through event output.
[0042] always@(reg_demo1_out or......or reg_demo2_out)begin
[0043] —>reg_change_evt;
[0044] end
[0045] In one embodiment of this application, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; using the UVM transmission mechanism, the detection module is transmitted to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed. This transmission ensures real-time performance, ensuring that the register can be updated in real time in the verification component after a change. This implementation also effectively ensures the reusability of the overall structure, ensuring that it can still be used normally when integrated into a higher-level verification platform.
[0046] The verification platform must be able to determine whether the DUT's (Device Under Test) behavior matches expectations based on its output; this function is accomplished by the scoreboard. When the DUT generates output based on its input, the verification platform must also complete the same process and generate the expected output. In the verification platform, this process is performed by the reference model.
[0047] Binding process: Bind reg prob interface to the corresponding register at the top level of the verification platform;
[0048] The code is: bind reg reg_prob_if reg_prob_if(.*);
[0049] The UVM transmission mechanism is used to pass the above detection module to the above verification component: the prob interface is passed to the corresponding verification component in the verification platform through uvm_config_db.
[0050] uvm_config_db#(virtual reg_prob_if)::set(null,...,tb.u_dut.~.reg_prob_if);
[0051] The UVM delivery mechanism is used to pass the detection module to the verification component. In the verification component, the `reg_prob_if` interface at the top level of the verification environment is accessed, and the registers are updated in real time by detecting the `reg_change_evt` event. See the sample code below:
[0052] / * Instantiate reg_prob_if in the validation component * /
[0053] class reference_model extends uvm_component;
[0054] virtual reg_prob_if reg_prob_if;
[0055] / *The rest of the code is omitted here* /
[0056] / * Obtain the reg_prob_if interface of the top-level set of the environment through the uvm_config_db get function * /
[0057] uvm_config_db#(virtual reg_prob_if)::get(this,"","reg_prob_vif",reg_prob_if);
[0058] / *The rest of the code is omitted here* /
[0059] / * Use a while(1) loop to continuously monitor the reg_change_evt event. When the event occurs, call the load_all_fields function to immediately update the registers.* /
[0060] while(1)begin
[0061] @(reg_prob_if.reg_change_evt);
[0062] reg_mirror.load_all_fields(reg_model);
[0063] End
[0064] / *The rest of the code is omitted here* /
[0065] endclass
[0066] In this application, the register model configures the REG_STAT register value in the design via the update() function, causing corresponding changes to the register values. The environment connects the register output signal to reg_prob_if using bind, and detects register output changes via the reg_change_evt event. Then, the verification component (reference model) waits for the reg_change_evt event; upon detecting a change in the register output signal, it immediately updates the register by calling the load_all_fields function, thus achieving accurate register comparison in the verification component.
[0067] In one embodiment of this application, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0068] In one embodiment of this application, after determining that the data stored internally in the aforementioned register has changed, the method further includes: using the aforementioned verification component to call an update function to upgrade the aforementioned register, thereby obtaining an upgraded register. The update function is used to update the aforementioned register. The load_all_fields function is the update function.
[0069] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register. This ensures that changes in the output ports of all registers are monitored without omission.
[0070] In a UVM environment, if uvm_reg.write is used, the desired value needs to be set to the corresponding register model before the actual bus register update, using a factory or callback method. This application avoids the delay problem in register value updates in the general-purpose register model. In projects that require real-time monitoring of register changes, it achieves synchronous changes in the reference model register values, enabling high-precision comparisons at the cycle level.
[0071] In the above embodiments, the verification component configures the REG_STAT register value in the design via update(), causing a corresponding change in the register value. In the environment, the register output signal is connected to reg_prob_if via bind, and the register output change is detected through the reg_change_evt event. Then, by waiting for the reg_change_evt event in the verification component, upon detecting a change in the register output signal, the register is immediately updated by calling the load_all_fields function, thus achieving accurate comparison of the registers in the verification component.
[0072] This application also provides a real-time register change acquisition device. It should be noted that the real-time register change acquisition device of this application can be used to execute the real-time register change acquisition method provided in this application. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0073] The following describes the real-time acquisition device for register changes provided in the embodiments of this application.
[0074] Figure 3 This is a schematic diagram of a real-time register change acquisition device according to an embodiment of this application. Figure 3 As shown, the device includes a construction unit 31 and a verification unit 32; the construction unit 31 is used to construct a detection module corresponding to the register, the detection module is used to detect in real time whether the data stored inside the register has changed; the verification unit 32 is used to determine whether the verification component has detected that the data stored inside the register has changed when the verification component verifies that the data stored inside the register has changed.
[0075] In the above-described device, by constructing a detection module corresponding to the register, and by using a verification component to verify that the data stored inside the register has changed, it is determined whether the verification component has detected a change in the data stored inside the register. This allows for real-time determination of whether the data stored inside the register has changed, thereby solving the problem of not being able to obtain changes in the register in real time in existing solutions.
[0076] In one embodiment of this application, the construction unit includes a construction module and a first processing module. The construction module is used to construct the detection module. The first processing module is used to define detection events in the detection module. The detection events are used to detect in real time whether the data stored internally in the register has changed.
[0077] In one embodiment of this application, the device further includes a first processing unit and a second processing unit. Before determining whether the verification component has detected a change in the data stored internally in the register, the first processing unit is used to establish a connection between the detection module and the register, so that the interface of the detection module is bound to the interface of the register, and the detection module can detect whether the data stored internally in the register has changed in real time. The second processing unit is used to transmit the detection module to the verification component using the UVM transmission mechanism, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0078] In one embodiment of this application, the verification unit includes a determination module, which is used to determine that the data stored internally in the register has changed when the verification component determines that the detection event has changed.
[0079] In one embodiment of this application, the verification unit further includes a second processing module. After determining that the data stored internally in the register has changed, the second processing module is used to call the update function using the verification component to upgrade the register and obtain the upgraded register. The update function is used to update the register.
[0080] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0081] The aforementioned real-time register change acquisition device includes a processor and a memory. The aforementioned construction units and verification units are all stored as program units in the memory, and the processor executes these program units stored in the memory to implement the corresponding functions. All of the aforementioned modules reside in the same processor; alternatively, the aforementioned modules may be located in different processors in any combination.
[0082] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of existing solutions being unable to capture register changes in real time.
[0083] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0084] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to execute the real-time acquisition method of register changes.
[0085] Specifically, the methods for real-time acquisition of register changes include:
[0086] Step S201: Construct a detection module corresponding to the register. The detection module is used to detect in real time whether the data stored inside the register has changed.
[0087] Step S202: If the verification component verifies that the data stored inside the above register has changed, determine whether the verification component has detected that the data stored inside the above register has changed.
[0088] In one embodiment of this application, constructing a detection module corresponding to a register includes: constructing the detection module; defining a detection event in the detection module, wherein the detection event is used to detect in real time whether the data stored internally in the register has changed.
[0089] In one embodiment of this application, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using the UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0090] In one embodiment of this application, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0091] In one embodiment of this application, after determining that the data stored internally in the register has changed, the method further includes: using the verification component to call the update function to upgrade the register and obtain the upgraded register, wherein the update function is used to update the register.
[0092] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0093] This invention provides a processor for running a program, wherein the program executes the real-time acquisition method for register changes during runtime.
[0094] Specifically, the methods for real-time acquisition of register changes include:
[0095] Step S201: Construct a detection module corresponding to the register. The detection module is used to detect in real time whether the data stored inside the register has changed.
[0096] Step S202: If the verification component verifies that the data stored inside the above register has changed, determine whether the verification component has detected that the data stored inside the above register has changed.
[0097] In one embodiment of this application, constructing a detection module corresponding to a register includes: constructing the detection module; defining a detection event in the detection module, wherein the detection event is used to detect in real time whether the data stored internally in the register has changed.
[0098] In one embodiment of this application, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using the UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0099] In one embodiment of this application, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0100] In one embodiment of this application, after determining that the data stored internally in the register has changed, the method further includes: using the verification component to call the update function to upgrade the register and obtain the upgraded register, wherein the update function is used to update the register.
[0101] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0102] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps: constructing a detection module corresponding to a register, the detection module being used to detect in real time whether the data stored internally in the register has changed; and, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register. The device described herein can be a server, PC, PAD, mobile phone, etc.
[0103] In one embodiment of this application, constructing a detection module corresponding to a register includes: constructing the detection module; defining a detection event in the detection module, wherein the detection event is used to detect in real time whether the data stored internally in the register has changed.
[0104] In one embodiment of this application, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using the UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0105] In one embodiment of this application, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0106] In one embodiment of this application, after determining that the data stored internally in the register has changed, the method further includes: using the verification component to call the update function to upgrade the register and obtain the upgraded register, wherein the update function is used to update the register.
[0107] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0108] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps: constructing a detection module corresponding to a register, the detection module being used to detect in real time whether the data stored internally in the register has changed; and, in the case where a verification component is used to verify that the data stored internally in the register has changed, determining whether the verification component has detected that the data stored internally in the register has changed.
[0109] In one embodiment of this application, constructing a detection module corresponding to a register includes: constructing the detection module; defining a detection event in the detection module, wherein the detection event is used to detect in real time whether the data stored internally in the register has changed.
[0110] In one embodiment of this application, before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using the UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
[0111] In one embodiment of this application, when a verification component verifies that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: when the verification component determines that the detection event has changed, determining that the data stored internally in the register has changed.
[0112] In one embodiment of this application, after determining that the data stored internally in the register has changed, the method further includes: using the verification component to call the update function to upgrade the register and obtain the upgraded register, wherein the update function is used to update the register.
[0113] In one embodiment of this application, the number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
[0114] This application also provides an electronic device including one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a real-time acquisition method for performing any of the above-described register changes.
[0115] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0116] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0117] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0120] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0121] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0122] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0123] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0124] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0125] 1) The real-time acquisition method of register changes in this application constructs a detection module corresponding to the register, and then determines whether the verification component has detected the change in the data stored inside the register when the data stored inside the register has changed by using a verification component. This allows for real-time determination of whether the data stored inside the register has changed, thereby solving the problem that the existing solution cannot acquire register changes in real time.
[0126] 2) The real-time acquisition method for register changes in this application employs a verification component that configures the REG_STAT register value in the design via update(), causing a corresponding change in the register value. In the environment, the register output signal is connected to reg_prob_if via bind, and the register output change is detected through the reg_change_evt event. Then, by waiting for the reg_change_evt event in the verification component, if a change in the register output signal is detected, the register is immediately updated by calling the load_all_fields function, thus achieving accurate comparison of the registers in the verification component.
[0127] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for real-time acquisition of register changes, characterized in that, include: A detection module corresponding to the register is constructed, which is used to detect in real time whether the data stored internally in the register has changed; When a verification component is used to verify that the data stored internally in the register has changed, it is determined whether the verification component has detected that the data stored internally in the register has changed. Constructing a detection module corresponding to the register includes: constructing the detection module; defining detection events in the detection module, wherein the detection events are used to detect in real time whether the data stored internally in the register has changed; Before determining whether the verification component has detected a change in the data stored internally in the register, the method further includes: establishing a connection between the detection module and the register, such that the interface of the detection module is bound to the interface of the register, and the detection module can detect in real time whether the data stored internally in the register has changed; and using a UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
2. The method according to claim 1, characterized in that, When using a verification component to verify that the data stored internally in the register has changed, determining whether the verification component has detected a change in the data stored internally in the register includes: If the verification component determines that the detected event has changed, it is determined that the data stored internally in the register has changed.
3. The method according to claim 2, characterized in that, After determining that the data stored internally in the register has changed, the method further includes: The verification component calls the update function to upgrade the register, resulting in an upgraded register. The update function is used to update the register.
4. The method according to any one of claims 1 to 3, characterized in that, The number of ports of the detection module is the same as the number of output ports of the register, and the ports of the detection module correspond one-to-one with the output ports of the register.
5. A device for real-time acquisition of register changes, characterized in that, include: A construction unit is used to construct a detection module corresponding to the register, the detection module being used to detect in real time whether the data stored internally in the register has changed; A verification unit is configured to determine whether the verification component has detected a change in the data stored internally in the register when the verification component verifies that the data has changed. The construction unit includes a construction module and a first processing module. The construction module is used to construct the detection module. The first processing module is used to define detection events in the detection module. The detection events are used to detect in real time whether the data stored internally in the register has changed. The real-time acquisition device for register changes further includes a first processing unit and a second processing unit. Before determining whether the verification component has detected a change in the data stored internally in the register, the first processing unit is used to establish a connection between the detection module and the register, so that the interface of the detection module is bound to the interface of the register, and the detection module can detect whether the data stored internally in the register has changed in real time. The second processing unit is used to use the UVM transmission mechanism to transmit the detection module to the verification component, so that the verification component can determine whether the data stored internally in the register has changed based on whether the detection event in the detection module has changed.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the real-time acquisition method of register changes as described in any one of claims 1 to 4.
7. A processor, characterized in that, The processor is used to run a program, wherein the program executes the real-time acquisition method of register changes as described in any one of claims 1 to 4.
8. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a real-time acquisition method for register changes as described in any one of claims 1 to 4.
Citation Information
Patent Citations
State synchronization method and device, electronic equipment and storage medium
CN114417780A