CN113468010B - File processing method and device, electronic equipment and computer readable storage medium - Google Patents
File processing method and device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN113468010B CN113468010B CN202111025890.8A CN202111025890A CN113468010B CN 113468010 B CN113468010 B CN 113468010B CN 202111025890 A CN202111025890 A CN 202111025890A CN 113468010 B CN113468010 B CN 113468010B
- Authority
- CN
- China
- Prior art keywords
- file
- updated
- operating system
- storage space
- simulation platform
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/2236—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test CPU or processors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application provides a file processing method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: determining a storage space address for storing a file to be updated in a memory of a chip to be tested of a hardware simulation platform, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system; loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by a hardware simulation platform; and after the operating system is started on the hardware simulation platform, copying the file to be updated in the storage space to a target folder under the operating system. According to the embodiment of the application, under the condition that the hardware simulation platform is not provided with peripheral drivers and a network environment, the application program to be updated is copied to the operating system running on the hardware simulation platform.
Description
Technical Field
The present application relates to the field of display technologies, and in particular, to a file processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The hardware simulation platform, which may be referred to as an EMU platform for short, is mainly used for verifying a chip. When the functions of the chip are verified, especially when the functions corresponding to the complex chip are verified, the functions of the chip can be verified to meet the requirements only by using the application program to realize the functions in a matching manner. The application program is run on an operating system, such as a linux system; and applications may be updated frequently. In order to ensure that the functions of the chip can meet the actual application requirements, a linux system is started based on an EMU platform before the tape-out. Because the EMU platform has low performance, does not have a peripheral driver and a network environment, the application program or the file on the linux system is very difficult to update, and the file or the application program cannot be copied by adopting an SCP instruction as the linux installed on a common PC.
Disclosure of Invention
The embodiment of the application provides a file processing method and device, an electronic device and a computer readable storage medium, which are used for copying a file to be updated to an operating system running on a hardware simulation platform under the condition that the hardware simulation platform does not have a peripheral drive and a network environment.
The embodiment of the application provides a file processing method, which is applied to electronic equipment, wherein the electronic equipment comprises a hardware simulation platform, the hardware simulation platform comprises a chip to be tested and an operating system installed on the hardware simulation platform, and the file processing method comprises the following steps:
determining a storage space address for storing a file to be updated in a memory of the chip to be tested, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system;
loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by the hardware simulation platform;
and after the operating system is started on the hardware simulation platform, copying the file to be updated in the storage space to a target folder under the operating system.
The embodiment of the present application further provides a file processing apparatus, which is applied to an electronic device, where the electronic device includes a hardware simulation platform, the hardware simulation platform includes a chip to be tested and an operating system installed on the hardware simulation platform, and the file processing apparatus includes:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a storage space address for storing a file to be updated in a memory of a chip to be tested, and the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system;
the back door loading module is used for loading the file to be updated into the storage space corresponding to the storage space address through a back door interface provided by the hardware simulation platform;
and the copying module is used for copying the files to be updated in the storage space to a target folder under the operating system after the operating system is started on the hardware simulation platform.
An embodiment of the present application further provides an electronic device, where the electronic device includes:
one or more processors; a memory; and one or more computer programs, wherein the processor is coupled to the memory, the one or more computer programs being stored in the memory and configured to be executed by the processor to perform the file processing method described above.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in any of the above-mentioned file processing methods are implemented.
In the embodiment of the application, a storage space address for storing a file to be updated is determined in a memory of a chip to be tested of a hardware simulation platform, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system; loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by the hardware simulation platform; and after the operating system is started on the hardware simulation platform, copying the file to be updated in the storage space to a target folder under the operating system. According to the method and the device, the file to be updated is copied to the memory of the chip to be tested on the hardware simulation platform in a backdoor mode, and the file to be updated is copied to the target folder under the operating system from the memory of the chip corresponding to the hardware simulation platform after the operating system is started on the hardware simulation platform, so that the application program to be updated is copied to the operating system running on the hardware simulation platform under the condition that the hardware simulation platform does not have a peripheral driver and does not have a network environment.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram illustrating a document processing method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a document processing method according to an embodiment of the present disclosure;
FIG. 3 is another schematic flow chart diagram of a document processing method according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a document processing method according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a file processing method and device, electronic equipment and a storage medium. Any one of the file processing devices provided by the embodiments of the present application may be integrated in an electronic device.
The electronic device includes an EMU platform that can verify extremely large scale chip designs, mainly for chip verification at the Presilion stage. In the embodiment of the present application, a chip to be verified is referred to as a chip to be tested. In the embodiment of the application, an RTL (Register Transfer Level, which can be understood as a language for designing a chip) code for designing the chip to be tested is compiled to generate a bitmap file, a software code for designing the chip to be tested is compiled to obtain a test BIN file, and the test BIN file is used for loading a firmware and an operating system of the chip to be tested after an EMU platform is started. And automatically downloading the bitmap file and the test BIN file corresponding to the RTL to the EMU platform through a simple command, and configuring and operating to verify whether the functions of the chip to be tested meet expectations in advance. The EMU platform may be regarded as a hardware of a software Simulator, and has a difference between a design frequency and an operating frequency, for example, the design frequency is 100MHZ, and the operating frequency is 100 KHZ.
The EMU platform includes a plurality of hardware circuits, and may be understood as being a stack of circuits of a plurality of hardware, or as being a stack of one or more circuit boards. After the bitmap file is downloaded to the EMU platform, the EMU platform essentially behaves as a chip. It should be noted that the EMU platform has low performance and does not have peripheral drivers and network environment (without network cards).
In order to ensure that the functions of the chip to be tested can meet the actual application requirements, an operating system, such as a linux system, is generally started based on an EMU platform (the EMU platform can be understood as a chip) before the tape-out, so as to verify whether the functions of the chip to be tested meet the requirements by using an application program in the linux system. However, great challenges are encountered in updating files (such as applications) running in the linux system, because the EMU platform does not have a peripheral driver and a network environment, and the files to be updated (applications to be updated) cannot be loaded into the linux system through a USB interface or network transmission manner. It should be reminded that all resources in the linux system are called files.
The embodiment of the application aims to solve the problem of how to copy a file to be updated (an application program to be updated) to an operating system running on an EMU platform under the condition that the EMU platform does not have a peripheral driver and a network environment. In the embodiment of the present application, an operating system is exemplified by a linux system, and a hardware emulation platform is exemplified by an EMU platform.
Please refer to fig. 1, which is a flowchart illustrating a file processing method according to an embodiment of the present application. The file processing method is applied to electronic equipment, the electronic equipment comprises an EMU platform, the EMU platform comprises a chip to be tested and an operating system installed in the EMU platform, and the chip to be tested comprises a memory. The file processing method comprises the following steps.
101, determining a storage space address for storing a file to be updated in a memory of a chip to be tested of a hardware simulation platform, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system.
The files to be updated include not only the update files corresponding to the application program to be updated running in the operating system, but also other files that can run in the operating system.
And planning a storage space address for storing a file to be updated in a memory corresponding to a chip to be tested (SoC). The storage space address is a storage address corresponding to a preset storage space. The address of the storage space is used for storing the file to be updated after being planned out, and is not used for other purposes before the test is completed.
Specifically, the file size of the file to be updated is obtained, and the storage space address for storing the file to be updated is determined according to the file size of the file to be updated. For example, memory space addresses between 0x60000000 and 0x90000000 in the memory of the chip to be tested are used to store files to be updated.
And 102, loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by the hardware simulation platform.
The back door interface is provided through a hardware simulation platform, is not external, only known by self, and develops a special channel interface for internal development. Specifically, when the EMU platform runs, the file to be updated is loaded into the storage space corresponding to the storage space address through the back door interface.
In one embodiment, the back door interface includes a back door load instruction, step 102, including: when the EMU platform runs/starts, loading a preset script file of the hardware simulation platform, and loading a file to be updated to a storage space corresponding to the storage space address in the preset script file through a backdoor loading instruction provided by the hardware simulation platform.
The preset script file comprises a configuration script file of the EMU platform, and when the EMU platform runs/starts, the corresponding configuration script file is loaded without fail. It should be noted that the preset script file may also be another file that must be loaded when the EMU platform runs. Understandably, a backdoor loading instruction is added in the configuration script file, so that the file to be updated is loaded into the storage space corresponding to the storage space address through the backdoor loading instruction.
The configuration script file comprises some configuration information corresponding to the EMU platform, and when the EMU platform runs/starts, the configuration information is loaded, and meanwhile, a file to be updated corresponding to a backdoor loading instruction is loaded into a storage space corresponding to a storage space address. For the EMU platform, the configuration file is still loaded.
The back door loading instruction is a memload instruction, the memload instruction is a private instruction, and the using mode of the memload is as follows: and (3) other parameters of the memload destination address original file path, wherein the destination address is the storage space address determined in the above, and the original file path refers to a file path corresponding to the file to be updated before the file to be updated is loaded to the storage space corresponding to the storage space address. And loading the file to be updated into the storage space corresponding to the storage space address through a memload instruction.
103, after the operating system is started on the hardware emulation platform, copying the file to be updated in the storage space to a target folder under the operating system.
In the embodiment of the application, the operating system is started on the hardware simulation platform, wherein the two different conditions are included, namely, the operating system is completely started on the EMU platform, namely, the operating system is started; and secondly, starting a kernel of the operating system on the hardware simulation platform, wherein the operating system is not started.
In one embodiment, step 103 comprises: after the operating system finishes starting on the hardware simulation platform, executing a copy instruction; and copying the file to be updated to a target folder under the operating system through a copy instruction.
Wherein the copy instruction is an instruction to run on the linux system, and the copy instruction may be a dd command. The dd command of the linux system is used to read, convert, and output data. dd commands may read data from a standard input or file, convert the data according to a specified format, and output to a file, device, or standard output. And copying the file to be updated to a target folder under the linux system through a copy instruction.
In one embodiment, step 103 comprises: after a kernel of an operating system is started, starting and running a preset application, wherein the preset application is established in the operating system before the operating system is started, and detecting whether a storage space corresponding to a storage space address has file content or not through the preset application, wherein the file content comprises a file to be updated; and if so, executing a copy instruction through the preset application, and copying the file to be updated to a target folder under the operating system through the copy instruction.
And after the kernel of the operating system is started, starting and running the preset application. The preset application may be represented by a service. The preset application is created and compiled before the operating system is started, and the preset application is loaded after the kernel of the operating system is started. It should be noted that the preset application may also start to run after the operating system is completely started.
Detecting whether the file content exists in the storage space corresponding to the determined storage space address through the preset application, and if so, automatically executing a copy instruction through the preset application to copy the file to be updated to a target folder under an operating system; if not, the step of detecting whether the storage space corresponding to the determined storage space address has the file content is continuously executed. The detection can be carried out in real time or at preset time intervals.
In this embodiment, it can be understood that the functions of detection, copying, and the like are integrated into the preset application, and after the kernel of the operating system is started, the preset application is automatically loaded, so that the copying of the file to be updated is automatically completed, and the file processing efficiency is improved.
In an embodiment, before the step of loading the file to be updated into the storage space corresponding to the storage space address through the back door interface provided by the hardware emulation platform, the file processing method further includes: and acquiring a target file format supported by the hardware simulation platform, and converting the file to be updated into a file corresponding to the target file format.
The target file format supported by the hardware simulation platform is in a current configuration relationship with the EMU platform. Specifically, the configuration of the EMU platform is obtained so as to obtain the target file format supported by the hardware simulation platform. If the target file format supported by the current configuration of the EMU platform is binary, converting the file to be updated into a file in the binary format; and if the target file format supported by the current configuration of the EMU platform asks for the hex format, converting the file to be updated into the file with the hex format. The object format file may also be a file of other format. The linux system can be directly loaded in a file in a hex format or a file in a binary format.
Fig. 2 is a schematic diagram of a document processing method according to an embodiment of the present application. Assume that the target folder described in the above embodiment is a dev/mem/myko folder under a linux operating system, the format of the target file is a hex format, the file to be updated is a file, and the file to be updated after the format conversion is a file _ hex file.
When the addresses of the storage space for storing the files to be updated are determined to be 0x60000000 to 0x90000000, the file _ hex files are stored into the storage space corresponding to the addresses of the storage space, and then the file _ hex in the storage space corresponding to the addresses of the storage space is loaded into the dev/mem/myko folder through a dd command or through a preset application service.
The method comprises the steps of firstly determining a storage space address used for storing a file to be updated in a memory of a chip to be tested, and then loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by a hardware simulation platform, so that the file to be updated is loaded into the storage space address preset by the chip to be tested through the back door interface provided under the condition that the hardware simulation platform does not have a peripheral drive and a network environment, and thus, after an operating system is started on the hardware simulation platform, the file to be updated in the storage space is copied into a target folder under the operating system. Namely, in the embodiment of the application, the application program to be updated is copied to the operating system running on the hardware simulation platform under the condition that the hardware simulation platform does not have a peripheral driver and a network environment.
In an embodiment, the step of determining the address of the storage space for storing the file to be updated includes: acquiring the number of memory blocks of a memory; utilizing the script file to segment the file to be updated so as to obtain the segmented files with the same number as the storage blocks; and determining the address of a storage space for storing the corresponding divided file in the corresponding number of storage blocks of the memory. The number of the storage blocks refers to the number of blocks of the memory, and the files to be updated are divided into the divided files with the number equal to the number of the blocks of the memory, so that the files to be updated can be read from each block simultaneously when being read, the address is convenient to fetch, and the reading speed is high.
In an embodiment, the step of determining the address of the storage space for storing the file to be updated includes: acquiring the number of memory blocks of a memory and a reading mode of the memory configured by a hardware simulation platform; determining whether the file to be updated needs to be divided or not according to the number of the storage blocks and the reading mode, and determining the number of targets needing to be divided when the file needs to be divided; the method comprises the steps that a script file is used for dividing a file to be updated to obtain divided files with a target number, wherein the target number is smaller than or equal to the number of storage blocks; and determining the storage space address for storing the corresponding divided file in the storage blocks of the corresponding target number of the storage. In this embodiment, whether the file to be updated needs to be divided is determined according to the reading mode and the number of the storage blocks, so that the file to be updated is divided during the division.
In one embodiment, after the split file is obtained, an object file format supported by a hardware simulation platform is obtained, and the split file is converted by using a script file, so that the file format of the split file is the object file format. Therefore, the hardware simulation platform can accurately load the partitioned files.
In an embodiment, when the file to be updated is divided into a target number of divided files, before the step of executing the copy instruction, the method further includes: merging the divided files in the storage blocks of the storage corresponding to the target number to obtain a file to be updated; the step of executing the copy instruction is then performed.
Fig. 3 is another schematic flow chart of the file processing method according to the embodiment of the present application. The file processing method is also applied to the electronic equipment, and comprises the following steps.
201, obtaining the number of memory blocks of the memory of the chip to be tested and the reading mode of the memory configured by the hardware simulation platform.
The number of the memory blocks of the memory may be two, four, or the like, that is, the number of the memory blocks may be two or four. The reading mode of the memory configured by the hardware simulation platform can be a first reading mode, a second reading mode, a third reading mode and the like. The first reading mode may be parallel reading, and in the reading mode, the file content of each memory block in the memory may be read in parallel. The second reading mode is similar to that of a flash memory. The third reading mode can be other reading modes and the like.
And 202, determining whether the file to be updated needs to be divided or not according to the number of the memory blocks and the reading mode, and determining the target number which needs to be divided when the file to be updated needs to be divided, wherein the file to be updated comprises an updated file corresponding to an application program to be updated which runs in an operating system, and the target number is less than or equal to the number of the memory blocks.
And determining whether the file to be updated needs to be divided according to the reading mode of the memory. For example, if the reading mode is the first reading mode, determining that the file to be updated needs to be divided; and if the reading mode is the second reading mode, determining that the file to be updated does not need to be divided, and the like.
When the division is needed, the target number needed to be divided is determined according to the number of the memory blocks. For example, when the number of memory blocks is four, it is determined that the number of objects to be divided is four. In some embodiments, the number of targets to be divided may also be set to be smaller than the number of memory blocks, which may be done by changing the reading mode. For example, the number of memory blocks is four, and the target setting is determined to be three, two, and so on.
And 203, determining the address of the storage space for storing the corresponding divided file in the storage blocks corresponding to the target number of the storage.
And planning corresponding storage space addresses in the storage for the target number of storage blocks, wherein the storage space addresses are used for storing the corresponding split files.
And 204, segmenting the file to be updated by utilizing the script file to obtain a target number of segmented files.
The script file is used for segmenting the file to be updated to obtain a target number of segmented files. For example, if the target number is four, the divided files may be divided into divided file 1, divided file 2, divided file 3, and divided file 4, respectively.
205, obtaining a target file format supported by the hardware simulation platform, and converting the split file by using the script file, so that the file format of the split file is the target file format.
The target file format may be a hex format, a binary format, and the like. For example, the target file format is a hex format, and each split file is format-converted by using a script file to obtain split files in the hex format, such as file _ hex1, file _ hex2, file _ hex3, and file _ hex4, respectively.
The execution sequence of step 203 and steps 204 to 205 is not particularly limited. Step 203 and steps 204 to 205 may be performed in parallel or may be performed in series. When executing serially, steps 204 to 205 may be executed first, and then step 203 may be executed.
And 206, loading a preset script file of the hardware simulation platform, and loading the split file into a storage space corresponding to the corresponding storage space address through a back door interface provided by the hardware simulation platform in the preset script file.
In this step, the step is consistent with the step of loading the file to be updated into the storage space corresponding to the corresponding storage space address through the backdoor interface provided by the hardware simulation platform. Please refer to the corresponding description above. What is different, in this step, each different partition file needs to be loaded into the storage space corresponding to the storage space address of the corresponding storage block through the back door interface. For example, memory address 1, which is planned in memory block1, is used to store file _ hex1, memory address 2, which is planned in memory block2, is used to store file _ hex2, memory address 3, which is planned in memory block3, is used to store file _ hex3, and memory address 4, which is planned in memory block4, is used to store file _ hex 4.
In addition, it should be noted that the preset script file and the script file mentioned above are not the same file.
207, after the kernel of the operating system is started, a preset application is started and run, and the preset application is created and compiled in the operating system before the operating system is started.
And 208, detecting whether the storage space has file contents or not through a preset application.
Since the storage space corresponding to the storage space address is specially used for storing the file to be updated, when the storage space is detected to have the file content, the file content is the file to be updated loaded in a backdoor manner.
Whether the storage space has the storage content is detected by the preset application, if so, step 209 is executed, and if not, step 208 is executed next.
And 209, executing a copy instruction through a preset application, and copying the file to be updated to a target folder under the operating system through the copy instruction.
Wherein the copy instruction comprises a dd command of the linux system. Please refer to the corresponding description above, which is not repeated herein. In one embodiment, before the step of executing the copy instruction, the method further comprises: and merging the split files in the storage space of the storage block corresponding to the memory to obtain the file to be updated.
The embodiment determines whether the file to be updated needs to be divided according to the number of the memory blocks of the memory and the reading mode of the memory configured by the hardware simulation platform, and determines the target number to be divided when the file needs to be divided so as to divide the file to be updated according to the target number, so that the addressing speed and the reading speed are improved when the divided file is read. And after the content of the operating system is started, the preset application is operated, so that the file to be updated is automatically copied to the target folder under the operating system through the preset application, and the file processing speed is improved by automatically executing the operation. In addition, files to be updated are stored in a memory of the chip to be updated through a back door interface of the hardware simulation platform, after the operating system is started, the corresponding test to be updated is read from the memory, and the application program to be updated is copied to the operating system running on the hardware simulation platform under the condition that the hardware simulation platform does not have a peripheral drive and a network environment.
Fig. 4 is a schematic flowchart of a file processing method according to an embodiment of the present application. The number of the storage blocks in the memory is 4, and the storage blocks are respectively block1, block2, block3 and block4, the determined dividing number of the files to be updated is a target number, and the target number is 4. Memory space addresses 1, 2, 3 and 4 are respectively planned in blocks 1, 2, 3 and 4 of the memory. Dividing the file to be updated into four parts, and performing format conversion to convert the file into four divided files with the hex format, namely file _ hex1, file _ hex2, file _ hex3 and file _ hex 4. Loading the split file _ hex1 into a storage space corresponding to the storage space address 1 through a back door interface provided by a hardware simulation platform, loading the split file _ hex2 into a storage space corresponding to the storage space address 2, loading the split file _ hex3 into a storage space corresponding to the storage space address 3, and loading the split file _ hex4 into a storage space corresponding to the storage space address 4. After the operating system is started, file _ hex1, file _ hex2, file _ hex3 and file _ hex4 are combined into file _ hex, and the file _ hex is copied into a target folder dev/mem/myko under the operating system by using a copy instruction dd or by using a preset application service.
In the above embodiment, after the file to be updated is copied to the target folder under the operating system, the file content in the storage space address in the memory is deleted, so as to avoid occupying the storage resource of the memory.
Fig. 5 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present application. The file processing device is integrated in electronic equipment and comprises a hardware simulation platform, wherein the hardware simulation platform comprises a chip to be tested and an operating system installed on the hardware simulation platform.
The file processing apparatus includes a determination module 301, a back door loading module 302, and a copy module 303.
The determining module 301 is configured to determine, in a memory of a chip to be tested, a storage space address for storing a file to be updated, where the file to be updated includes an update file corresponding to an application program to be updated running in an operating system.
In an embodiment, when the step of determining the address of the storage space for storing the file to be updated is executed, the determining module 301 specifically executes: acquiring the number of the memory blocks of the memory; utilizing a script file to segment the file to be updated to obtain a target number of segmented files, wherein the target number is equal to the number of the storage blocks; and determining the storage space address for storing the corresponding divided file in the storage blocks of the corresponding target number of the memory.
In an embodiment, when the step of determining the address of the storage space for storing the file to be updated is executed, the determining module 301 specifically executes: acquiring the number of memory blocks of the memory and a reading mode of the memory configured by the hardware simulation platform; determining whether the file to be updated needs to be divided or not according to the number of the storage blocks and the reading mode, and determining the number of targets needing to be divided when the file needs to be divided; utilizing a script file to segment the file to be updated to obtain a target number of segmented files, wherein the target number is less than or equal to the number of the storage blocks; and determining the storage space address for storing the corresponding divided file in the storage blocks of the corresponding target number of the memory.
In an embodiment, after obtaining the split file, the determining module 301 is further configured to obtain a target file format supported by the hardware simulation platform; and converting the segmentation file by using the script file to enable the file format of the segmentation file to be the target file format.
A back door loading module 302, configured to load the file to be updated into the storage space corresponding to the storage space address through a back door interface provided by the hardware emulation platform.
In an embodiment, the back door loading module 302 is specifically configured to load a preset script file of the hardware simulation platform; and in the preset script file, loading the file to be updated into a storage space corresponding to the storage space address through a backdoor loading instruction provided by the hardware simulation platform.
The copying module 303 is configured to copy the file to be updated in the storage space to a target folder under the operating system after the operating system is started on the hardware emulation platform.
In an embodiment, the copy module 303 is specifically configured to execute a copy instruction after the operating system is started on the hardware emulation platform; and copying the file to be updated to a target folder under the operating system through the copying instruction.
In an embodiment, the copy module 303 is specifically configured to start and run a preset application after a kernel of the operating system is started, where the preset application is created and compiled in the operating system before the operating system is started; detecting whether file contents exist in the storage space through a preset application, wherein the file contents comprise files to be updated; if yes, executing a copy instruction through a preset application; and copying the file to be updated to a target folder under the operating system through the copying instruction.
In an embodiment, when the file to be updated is divided into a target number of divided files, the copy module 303 further performs merging of the divided files in the storage space of the storage block corresponding to the memory before the step of executing the copy instruction, so as to obtain the file to be updated; the step of executing the copy instruction is then performed.
In specific implementation, the above units may be implemented as independent entities, or may be implemented as one or several entities by any combination. The specific implementation processes of the above apparatus and each unit, and the achieved beneficial effects, may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, no further description is provided herein.
An electronic device according to an embodiment of the present application is further provided, as shown in fig. 6, which shows a schematic structural diagram of the electronic device according to an embodiment of the present application, specifically:
the electronic device may include a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media.
In an embodiment, the electronic device may further include: a Radio Frequency (RF) circuit 403, a power supply 404, an input unit 405, and a display unit 406. Those skilled in the art will appreciate that the electronic device configurations shown in the figures do not constitute limitations of the electronic device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 401 is a control center of the electronic device, and includes a processor, and the processor is connected to the processor. The processor is connected to various parts of the whole electronic device by various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the electronic device. Optionally, the processor may include one or more processing cores; preferably, the processor may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor.
The memory 402 may be used to store software programs (computer programs) and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The RF circuit 403 may be used for receiving and transmitting signals during information transmission and reception, and in particular, for receiving downlink information of a base station and then processing the received downlink information by the one or more processors 401; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 403 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 403 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The electronic device further includes a power supply 404 (e.g., a battery) for supplying power to the various components, and preferably, the power supply 404 is logically connected to the processor 401 via a power management system, so that functions of managing charging, discharging, and power consumption are implemented via the power management system. The power supply 404 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 405, and the input unit 405 may be used to receive input numeric or character information and generate a keyboard, mouse, joystick, optical or trackball signal input in relation to user settings and function control. Specifically, in one particular embodiment, the input unit 405 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 401, and can receive and execute commands sent by the processor 401. In addition, touch sensitive surfaces may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 405 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The electronic device may also include a display unit 406, and the display unit 406 may be used to display information input by or provided to the user as well as various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 406 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 401 to determine the type of the touch event, and then the processor 401 provides a corresponding visual output on the display panel according to the type of the touch event. Although in the figures the touch sensitive surface and the display panel are shown as two separate components to implement input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement input and output functions.
Although not shown, the electronic device may further include a camera (note that the camera here is different from the virtual camera described above, and the camera here refers to hardware), a bluetooth module, and the like, which are not described herein again. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
determining a storage space address for storing a file to be updated in a memory of a chip to be tested of a hardware simulation platform, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system; loading the file to be updated into a storage space corresponding to the storage space address through a back door interface provided by the hardware simulation platform; and after an operating system installed on a hardware simulation platform is started on the hardware simulation platform, copying the files to be updated in the storage space to a target folder under the operating system.
The electronic device can implement the steps in any embodiment of the file processing method provided in the embodiment of the present application, and therefore, the beneficial effects that can be achieved by any file processing method provided in the embodiment of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions (computer programs) which are stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the instructions (computer programs). To this end, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps of any embodiment of the file processing method provided in the embodiment of the present invention.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any file processing method embodiment provided in the embodiments of the present invention, beneficial effects that can be achieved by any file processing method provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The foregoing describes in detail a file processing method, device, electronic device, and storage medium provided in the embodiments of the present application, and specific examples are applied in the present application to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (9)
1. A file processing method is applied to electronic equipment, the electronic equipment comprises a hardware simulation platform, the hardware simulation platform comprises a chip to be tested and an operating system installed on the hardware simulation platform, and the file processing method comprises the following steps:
determining a storage space address for storing a file to be updated in a memory of the chip to be tested, wherein the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system;
loading a preset script file of the hardware simulation platform;
in the preset script file, loading the file to be updated into a storage space corresponding to the storage space address through a backdoor loading instruction provided by the hardware simulation platform;
and after the operating system is started on the hardware simulation platform, copying the file to be updated in the storage space to a target folder under the operating system.
2. The file processing method according to claim 1, wherein the step of determining the address of the storage space for storing the file to be updated comprises:
acquiring the number of memory blocks of the memory and a reading mode of the memory configured by the hardware simulation platform;
determining whether the file to be updated needs to be divided or not according to the number of the storage blocks and the reading mode, and determining the number of targets needing to be divided when the file needs to be divided;
utilizing a script file to segment the file to be updated to obtain a target number of segmented files, wherein the target number is less than or equal to the number of the storage blocks;
and determining the storage space address for storing the corresponding divided file in the storage blocks of the corresponding target number of the memory.
3. The file processing method according to claim 2, further comprising, after obtaining the target number of divided files:
acquiring a target file format supported by the hardware simulation platform;
and converting the segmentation file by using the script file to enable the file format of the segmentation file to be the target file format.
4. The file processing method according to claim 1, wherein the step of copying the file to be updated in the storage space to a target folder under the operating system after the operating system is started on the hardware emulation platform comprises:
after the operating system finishes starting on the hardware simulation platform, executing a copy instruction;
and copying the file to be updated to a target folder under the operating system through the copying instruction.
5. The file processing method according to claim 1, wherein the step of copying the file to be updated in the storage space to a target folder under the operating system after the operating system is started on the hardware emulation platform comprises:
starting and running a preset application after the kernel of the operating system is started, wherein the preset application is created and compiled in the operating system before the operating system is started;
detecting whether file contents exist in the storage space through a preset application, wherein the file contents comprise files to be updated;
if yes, executing a copy instruction through a preset application;
and copying the file to be updated to a target folder under the operating system through the copying instruction.
6. The file processing method according to claim 4 or 5, when the file to be updated is divided into a target number of divided files, before the step of executing the copy instruction, further comprising:
merging the divided files in the storage space of the storage block corresponding to the memory to obtain a file to be updated; the step of executing the copy instruction is then performed.
7. A file processing device is applied to an electronic device, the electronic device includes a hardware simulation platform, the hardware simulation platform includes a chip to be tested and an operating system installed on the hardware simulation platform, the file processing device includes:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a storage space address for storing a file to be updated in a memory of a chip to be tested, and the file to be updated comprises an update file corresponding to an application program to be updated running in an operating system;
the back door loading module is used for loading a preset script file of the hardware simulation platform; in the preset script file, loading the file to be updated into a storage space corresponding to the storage space address through a backdoor loading instruction provided by the hardware simulation platform;
and the copying module is used for copying the files to be updated in the storage space to a target folder under the operating system after the operating system is started on the hardware simulation platform.
8. An electronic device comprising a memory and a processor; the memory stores a computer program, and the processor is used for operating the computer program in the memory to execute the steps in the file processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps in the file processing method of any one of the preceding claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111025890.8A CN113468010B (en) | 2021-09-02 | 2021-09-02 | File processing method and device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111025890.8A CN113468010B (en) | 2021-09-02 | 2021-09-02 | File processing method and device, electronic equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113468010A CN113468010A (en) | 2021-10-01 |
CN113468010B true CN113468010B (en) | 2021-11-16 |
Family
ID=77867418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111025890.8A Active CN113468010B (en) | 2021-09-02 | 2021-09-02 | File processing method and device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113468010B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116306410B (en) * | 2023-05-22 | 2023-12-15 | 南京芯驰半导体科技有限公司 | Information printing method and device based on tightly coupled memory and hardware verification method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101470657A (en) * | 2007-12-28 | 2009-07-01 | 英业达股份有限公司 | Verification method for BIOS refreshing content |
CN103617061A (en) * | 2013-12-05 | 2014-03-05 | 中国航空无线电电子研究所 | Method for multi-node on-line software updating on basis of ARM |
CN109240731A (en) * | 2018-08-29 | 2019-01-18 | 武汉光庭信息技术股份有限公司 | A kind of security upgrading method and system of TBox |
CN112269547A (en) * | 2020-10-26 | 2021-01-26 | 武汉轻工大学 | Active and controllable hard disk data deleting method and device without operating system |
CN112329366A (en) * | 2020-12-04 | 2021-02-05 | 国微集团(深圳)有限公司 | SOC (system on chip) system verification method, device and system for improving simulation efficiency |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103136002B (en) * | 2011-11-25 | 2016-06-29 | 航天信息股份有限公司 | The control method of a kind of upgrading automatically based on UBoot and system |
US20190095554A1 (en) * | 2017-09-28 | 2019-03-28 | Intel Corporation | Root complex integrated endpoint emulation of a discreet pcie endpoint |
CN110196791A (en) * | 2019-04-30 | 2019-09-03 | 北京中电华大电子设计有限责任公司 | A kind of two-way synchronization method of chip software and hardware cooperating simulation verifying |
CN112241311A (en) * | 2020-10-22 | 2021-01-19 | 杭州安恒信息技术股份有限公司 | Firmware simulation method and device, electronic equipment and readable storage medium |
-
2021
- 2021-09-02 CN CN202111025890.8A patent/CN113468010B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101470657A (en) * | 2007-12-28 | 2009-07-01 | 英业达股份有限公司 | Verification method for BIOS refreshing content |
CN103617061A (en) * | 2013-12-05 | 2014-03-05 | 中国航空无线电电子研究所 | Method for multi-node on-line software updating on basis of ARM |
CN109240731A (en) * | 2018-08-29 | 2019-01-18 | 武汉光庭信息技术股份有限公司 | A kind of security upgrading method and system of TBox |
CN112269547A (en) * | 2020-10-26 | 2021-01-26 | 武汉轻工大学 | Active and controllable hard disk data deleting method and device without operating system |
CN112329366A (en) * | 2020-12-04 | 2021-02-05 | 国微集团(深圳)有限公司 | SOC (system on chip) system verification method, device and system for improving simulation efficiency |
Also Published As
Publication number | Publication date |
---|---|
CN113468010A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106502703B (en) | Function calling method and device | |
CN108345543B (en) | Data processing method, device, equipment and storage medium | |
CN109791497B (en) | Method, device and terminal for executing hot patch | |
CN111142711B (en) | Firmware configuration method and device, storage medium and mobile terminal | |
CN109857403B (en) | Page updating method and device, page processing method and device | |
CN106775827B (en) | Application program updating method and device and computer equipment | |
CN111290762A (en) | Deployment method and device of deep learning network and terminal equipment | |
CN108090345B (en) | Linux system external command execution method and device | |
CN104601617A (en) | Peripheral access processing method and device in virtual desktop system | |
CN113468010B (en) | File processing method and device, electronic equipment and computer readable storage medium | |
EP2869604A1 (en) | Method, apparatus and device for processing a mobile terminal resource | |
CN116028455A (en) | Data processing method and device, storage medium and electronic equipment | |
CN104809054A (en) | Method and system for realizing program testing | |
EP3129883B1 (en) | Method and apparatus for repairing dynamic link library file | |
CN104516779A (en) | System switching method and chip | |
CN103309677B (en) | Built-in resource management, device and terminal | |
CN105278942B (en) | Component management method and device | |
CN109145598B (en) | Virus detection method and device for script file, terminal and storage medium | |
CN104461603A (en) | Information processing method and electronic equipment | |
CN103902445A (en) | Regression test object determination method and device | |
CN106933626B (en) | Application association method and device | |
CN115098468A (en) | Flexible data migration method and device, storage medium and electronic equipment | |
CN108073461B (en) | Memory leakage debugging method and device | |
CN105991729A (en) | Installation package downloading method and server | |
CN106484625A (en) | A kind of method based on universal test Software Development Platform test subsystems |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |