CN116301292A - System on a chip, robot and operating method of the system on a chip - Google Patents
System on a chip, robot and operating method of the system on a chip Download PDFInfo
- Publication number
- CN116301292A CN116301292A CN202310297570.0A CN202310297570A CN116301292A CN 116301292 A CN116301292 A CN 116301292A CN 202310297570 A CN202310297570 A CN 202310297570A CN 116301292 A CN116301292 A CN 116301292A
- Authority
- CN
- China
- Prior art keywords
- volatile memory
- chip system
- working state
- code
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/324—Power saving characterised by the action undertaken by lowering clock frequency
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/78—Architectures of general purpose stored program computers comprising a single central processing unit
- G06F15/7807—System on chip, i.e. computer system on a single chip; System in package, i.e. computer system on one or more chips in a single package
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
技术领域technical field
本发明涉及电源技术领域,具体涉及一种芯片系统、机器人和芯片系统的运行方法。The invention relates to the technical field of power supplies, in particular to a chip system, a robot and an operation method of the chip system.
背景技术Background technique
对于SOC芯片(System on Chip)来说,会根据工作的需要设置有不同的运行状态,这些不同的运行状态中至少包含两种状态:运行状态和待机状态。SOC芯片处于运行状态时,各种模块都打开,系统时钟的频率满足SOC芯片正常工作的需求;SOC芯片处于待机状态时,会将不必要的模块关闭,降低系统时钟的频率,降低电压,使这时的SOC芯片的整体功耗远远小于运行状态下的整体功耗,起到节省能耗的作用。进入低功耗的待机状态对于单一存储器,例如MCU系统来说,是比较简单的。而对于比较复杂的SOC系统,特别是带有外部储存器DDR等这种易失性存储器的SOC系统来说,实现起来就比较难,因为如果DDR存储器在低功耗待机状态不关闭,那么功耗就不低,无法有效节省能耗。SOC芯片的大部分程序又是在DDR存储器里面,如果关闭DDR存储器,则影响大部分程序的运行;如果专门做一个守护程序,放在SOC芯片内部比较小的SRAM存储器中跑。这样做就需要维护两份代码,一份是SOC芯片正常工作时,DDR存储器运行的代码,一份是SOC芯片休眠时,SOC芯片内部的SRAM存储器运行的代码,增加开发复杂度。For the SOC chip (System on Chip), different operating states will be set according to the needs of the work, and these different operating states include at least two states: operating state and standby state. When the SOC chip is in the running state, various modules are turned on, and the frequency of the system clock meets the requirements of the normal operation of the SOC chip; At this time, the overall power consumption of the SOC chip is much smaller than the overall power consumption in the running state, which plays a role in saving energy consumption. Entering a low-power standby state is relatively simple for a single-memory system, such as an MCU system. For more complex SOC systems, especially those with volatile memories such as external memory DDR, it is more difficult to implement, because if the DDR memory is not turned off in the low-power standby state, then the power Consumption is not low, can not effectively save energy consumption. Most of the programs of the SOC chip are in the DDR memory. If the DDR memory is turned off, the operation of most programs will be affected; if a special daemon program is made, it will run in the relatively small SRAM memory inside the SOC chip. In this way, two codes need to be maintained, one is the code running on the DDR memory when the SOC chip is working normally, and the other is the code running on the SRAM memory inside the SOC chip when the SOC chip is sleeping, which increases the development complexity.
发明内容Contents of the invention
为解决上述问题,本发明提供了一种芯片系统、机器人和芯片系统的运行方法。本发明的具体技术方案如下:In order to solve the above problems, the present invention provides a chip system, a robot and an operation method of the chip system. Concrete technical scheme of the present invention is as follows:
一种芯片系统,该芯片系统包括:CPU单元,用于根据芯片系统是处于第一工作状态还是第二工作状态来决定用非易失性存储器还是易失性存储器运行代码;易失性存储器,用于在芯片系统处于第一工作状态时,从非易失性存储器中搬运代码来运行;非易失性存储器,用于存储运行代码和在芯片系统处于第二工作状态时根据目标时钟运行代码;地址重映射单元,用于在芯片系统切换存储器运行代码,重新设置运行代码的地址;其中,所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低,所述目标时钟为芯片系统在待机或者休眠时的系统时钟。所述芯片系统通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;所述芯片系统利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。A system on a chip, the system on a chip comprising: a CPU unit, configured to determine whether to use a non-volatile memory or a volatile memory to run a code according to whether the chip system is in a first working state or a second working state; the volatile memory, Used to carry codes from the non-volatile memory to run when the chip system is in the first working state; the non-volatile memory is used to store the running code and run the code according to the target clock when the chip system is in the second working state The address remapping unit is used to switch the memory running code in the chip system and reset the address of the running code; wherein, the power consumption of the running code of the non-volatile memory is lower than that of the running code of the volatile memory, so The target clock mentioned above is the system clock when the chip system is in standby or sleep. The chip system stores and runs codes through two different memories, and switches the mode of running and storing through address remapping, so as to solve the problem of code execution switching under different working states; The power consumption of the running code of the non-volatile memory is lower than the power consumption of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the chip system can be reduced in the second working state. The power consumption is low, and the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient.
进一步地,所述芯片系统还包括总线单元,所述CPU单元通过总线单元与地址重映射单元和外部设备相连,所述总线单元用于将外部设备的电信号传输给CPU单元或者将CPU单元的电信号传输给地址重映射单元。CPU单元通过总线单元即可进行信息的接收和发送,结构简单,有效减少芯片系统的面积。Further, the chip system further includes a bus unit, the CPU unit is connected to the address remapping unit and the external device through the bus unit, and the bus unit is used to transmit the electrical signal of the external device to the CPU unit or transmit the electrical signal of the CPU unit to the CPU unit. The electrical signal is transmitted to the address remapping unit. The CPU unit can receive and send information through the bus unit, which has a simple structure and effectively reduces the area of the chip system.
进一步地,所述芯片系统从第一工作状态切换到第二工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,关闭所述易失性存储器,启用所述非易失性存储器,并将所述非易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,然后降低系统的时钟的频率,使所述非易失性存储器根据降低频率后的系统时钟运行代码来实现低功耗。将运行代码存储到非易失性存储器中,使运行代码在非易失性存储器掉电后不会丢失,并且通过地址映射的方式进行代码地址的切换,只需一份运行代码就可以实现存储器的切换,降低运行代码的开发和维护难度。第二工作状态时,通过功耗更低的非易失性存储器来运行代码,降低芯片系统在第二工作状态的运行功耗。Further, when the chip system is switched from the first working state to the second working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit closes all the volatile memory, enable the non-volatile memory, and map the code initial running address of the non-volatile memory to the storage initial address of the code stored in the non-volatile memory, and then reduce the system The frequency of the clock enables the non-volatile memory to run codes according to the reduced frequency system clock to achieve low power consumption. Store the running code in the non-volatile memory, so that the running code will not be lost after the non-volatile memory is powered off, and switch the code address through the address mapping method, only one copy of the running code can realize the memory Switching to reduce the difficulty of developing and maintaining the running code. In the second working state, the code is run through the non-volatile memory with lower power consumption, thereby reducing the operating power consumption of the chip system in the second working state.
进一步地,所述芯片系统从第二工作状态切换到第一工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,启用所述易失性存储器,将所述易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,使所述易失性存储器在芯片系统处于第一工作状态时,从所述非易失性存储器中搬运代码来运行。正常工作时,通过易失性存储器从所述非易失性存储器中搬运代码来运行,来提高芯片系统中断后,芯片系统再次工作时的响应速度。Further, when the chip system switches from the second working state to the first working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit enables all The volatile memory, mapping the initial running address of the code of the volatile memory to the storage initial address of the code stored in the non-volatile memory, so that the volatile memory is in the first working state in the chip system When, the code is carried from the non-volatile memory to run. When working normally, the volatile memory is used to carry codes from the non-volatile memory to run, so as to improve the response speed when the chip system is interrupted and the chip system works again.
一种移动机器人,所述移动机器人包括上述的芯片系统。移动机器人具有的所述芯片系统,通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。第二工作状态时,通过功耗更低的非易失性存储器来运行代码,降低芯片系统在第二工作状态的运行功耗。A mobile robot includes the above chip system. The chip system possessed by the mobile robot stores and runs codes through two different memories, and switches the mode of running and storing through address remapping, so as to solve the problem of code execution switching under different working conditions; The power consumption of the running code of the non-volatile memory is lower than the power consumption of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the chip system can be reduced in the second working time. The power consumption of the state, and the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient. In the second working state, the code is run through the non-volatile memory with lower power consumption, thereby reducing the operating power consumption of the chip system in the second working state.
一种芯片系统的运行方法,该运行方法用于使上述的芯片系统运行,所述运行方法包括以下步骤:所述CPU通过总线单元接收工作状态指令后,判断芯片系统是否进行工作状态切换;若所述芯片系统进行工作状态切换,则所述CPU单元通过地址重映射单元重新设置运行代码的地址;若所述芯片系统切换为第一工作状态,则所述易失性存储器从所述非易失性存储器中搬运代码来运行;若所述芯片系统切换为第二工作状态,则所述非易失性存储器根据目标时钟直接运行代码;其中,所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低,所述目标时钟为芯片系统在待机或者休眠时的系统时钟。所述芯片系统通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。An operation method of a chip system, the operation method is used to make the above-mentioned chip system run, and the operation method includes the following steps: After the CPU receives a working state instruction through a bus unit, it judges whether the chip system performs working state switching; if When the chip system switches the working state, the CPU unit resets the address of the running code through the address remapping unit; if the chip system is switched to the first working state, the volatile memory starts The code is carried in the volatile memory to run; if the chip system is switched to the second working state, the non-volatile memory directly runs the code according to the target clock; wherein, the power consumption of the non-volatile memory running code The power consumption of running code is lower than that of the volatile memory, and the target clock is the system clock when the chip system is in standby or sleep. The chip system uses two different memories to store and run code, and through address remapping, switch the way of running and storing, so as to solve the problem of code execution switching under different working conditions; The power consumption of the running code of the volatile memory is lower than that of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the power consumption of the chip system in the second working state is reduced. Moreover, the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient.
进一步地,所述CPU单元通过总线单元接收工作状态指令后,判断芯片系统是否进行工作状态切换,包括以下步骤:所述芯片系统通过总线单元接收工作状态指令后,判断工作状态指令是第一工作状态运行指令还是第二工作状态运行指令;所述芯片系统根据当前自身所处的工作状态和工作状态指令判断自身是否需要切换工作状态;若所述芯片系统当前自身处于第一工作状态,则所述芯片系统接收到第二工作状态运行指令后,芯片系统切换为第二工作状态;若所述芯片系统当前自身处于第二工作状态,则所述芯片系统接收到第一工作状态运行指令后,芯片系统切换为第一工作状态。所述芯片系统根据工作状态指令来决定自身的工作状态是否需要切换,使芯片系统可以快速进入不同的工作状态,实用性较高。Further, after the CPU unit receives the work state instruction through the bus unit, it judges whether the chip system switches the work state, including the following steps: after the chip system receives the work state instruction through the bus unit, it judges that the work state instruction is the first work state operation instruction or the second working state operation instruction; the chip system judges whether it needs to switch the working state according to the current working state and the working state instruction; if the chip system itself is currently in the first working state, then the After the chip system receives the second working state operation instruction, the chip system switches to the second working state; if the chip system itself is currently in the second working state, after the chip system receives the first working state operation instruction, The chip system switches to the first working state. The chip system determines whether its own working state needs to be switched according to the working state instruction, so that the chip system can quickly enter different working states, and has high practicability.
进一步地,所述芯片系统从第一工作状态切换到第二工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,关闭所述易失性存储器,启用所述非易失性存储器,并将所述非易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,然后降低系统的时钟的频率,使所述非易失性存储器根据降低频率后的系统时钟运行代码来实现低功耗,其中,所述降低频率后的系统时钟为芯片系统在待机或者休眠时的系统时钟。将运行代码存储到非易失性存储器中,使运行代码在非易失性存储器掉电后不会丢失,并且通过地址映射的方式进行代码地址的切换,只需一份运行代码就可以实现存储器的切换,降低运行代码的开发和维护难度。第二工作状态时,通过功耗更低的非易失性存储器来运行代码,降低芯片系统在第二工作状态的运行功耗。Further, when the chip system is switched from the first working state to the second working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit closes all the volatile memory, enable the non-volatile memory, and map the code initial running address of the non-volatile memory to the storage initial address of the code stored in the non-volatile memory, and then reduce the system The frequency of the clock enables the non-volatile memory to run code according to a system clock with a reduced frequency to achieve low power consumption, wherein the system clock with a reduced frequency is the system clock when the chip system is in standby or sleep. Store the running code in the non-volatile memory, so that the running code will not be lost after the non-volatile memory is powered off, and switch the code address through the address mapping method, only one copy of the running code can realize the memory Switching to reduce the difficulty of developing and maintaining the running code. In the second working state, the code is run through the non-volatile memory with lower power consumption, thereby reducing the operating power consumption of the chip system in the second working state.
进一步地,所述芯片系统从第二工作状态切换到第一工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,启用所述易失性存储器,将所述易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,使所述易失性存储器在芯片系统处于第一工作状态时,从所述非易失性存储器中搬运代码来运行。正常工作时,通过易失性存储器从所述非易失性存储器中搬运代码来运行,来提高芯片系统中断后,芯片系统再次工作时的响应速度。Further, when the chip system switches from the second working state to the first working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit enables all The volatile memory, mapping the initial running address of the code of the volatile memory to the storage initial address of the code stored in the non-volatile memory, so that the volatile memory is in the first working state in the chip system When, the code is carried from the non-volatile memory to run. When working normally, the volatile memory is used to carry codes from the non-volatile memory to run, so as to improve the response speed when the chip system is interrupted and the chip system works again.
进一步地,所述CPU单元判断工作状态指令是第一工作状态运行指令还是第二工作状态运行指令,包括以下步骤:所述CPU单元在接收到外部设备的信息后,开始计时;若在设定时间内,CPU单元没有再次接收到外部设备发送的信息后,则CPU单元判断自身接收到第二工作状态运行指令,进入第二工作状态;若在设定时间内,CPU单元再次接收到外部设备发送的信息后,则CPU单元将计时清零,并重新开始计时;若所述CPU单元没有接收到第二工作状态运行指令,则CPU单元判断自身接收到第一工作状态运行指令。通过周期性的计算方法来使芯片系统在不工作时,进入第二工作状态,降低芯片系统的运行功耗。Further, the CPU unit judges whether the working state command is the first working state running command or the second working state running command, including the following steps: the CPU unit starts timing after receiving the information of the external device; If the CPU unit does not receive the information sent by the external device again within the specified time, the CPU unit judges that it has received the second working state operation command and enters the second working state; if within the set time, the CPU unit receives the external device again After the information is sent, the CPU unit resets the timing and restarts timing; if the CPU unit does not receive the second working state running command, the CPU unit judges that it has received the first working state running command. The periodic calculation method is used to enable the chip system to enter the second working state when it is not working, so as to reduce the operating power consumption of the chip system.
进一步地,所述CPU单元在采用易失性存储器运行代码时,会检测易失性存储器是否正常;若易失性存储器正常,则易失性存储器继续运行代码;若易失性存储器不正常,则CPU单元发出工作异常指令,并切换非易失性存储器来运行代码。当检测到正在运行代码的存储器异常时,切换到另一个正常的的存储器来运行代码,保证芯片系统可以正常工作。Further, when the CPU unit uses the volatile memory to run the code, it will detect whether the volatile memory is normal; if the volatile memory is normal, the volatile memory continues to run the code; if the volatile memory is not normal, Then the CPU unit issues an abnormal operation instruction, and switches the non-volatile memory to run the code. When an abnormality is detected in the memory where the code is running, switch to another normal memory to run the code to ensure that the chip system can work normally.
进一步地,所述CPU单元在采用非易失性存储器运行代码时,会检测非易失性存储器是否正常;若非易失性存储器正常,则非易失性存储器继续低功耗运行代码;若非易失性存储器不正常,则CPU单元发出工作异常指令,并唤醒易失性存储器,然后从非易失性存储器中搬运代码到易失性存储器中,使易失性存储器根据目标时钟来运行。当检测到正在运行代码的存储器异常时,切换到另一个正常的的存储器来运行代码,保证芯片系统可以正常工作。Further, when the CPU unit uses the non-volatile memory to run the code, it will detect whether the non-volatile memory is normal; if the non-volatile memory is normal, the non-volatile memory continues to run the code with low power consumption; If the volatile memory is abnormal, the CPU unit issues an abnormal operation command, wakes up the volatile memory, and then transfers the code from the non-volatile memory to the volatile memory, so that the volatile memory operates according to the target clock. When an abnormality is detected in the memory where the code is running, switch to another normal memory to run the code to ensure that the chip system can work normally.
附图说明Description of drawings
图1为本发明一种实施例所述芯片系统的结构示意图。FIG. 1 is a schematic structural diagram of a chip system according to an embodiment of the present invention.
图2为本发明一种实施例所述芯片系统的运行流程示意图。Fig. 2 is a schematic diagram of the operation flow of the chip system according to an embodiment of the present invention.
实施方式Implementation
在下面的描述中,给出具体细节以提供对实施例的透彻理解。然而,本领域的普通技术人员将理解,可以在没有这些具体细节的情况下实施实施例。例如,电路可以在框图中显示,以便不在不必要的细节中使实施例模糊。在其他情况下,为了不混淆实施例,可以不详细显示公知的电路、结构和技术。In the following description, specific details are given to provide a thorough understanding of the embodiments. However, one of ordinary skill in the art would understand that the embodiments may be practiced without these specific details. For example, circuits may be shown in block diagrams in order not to obscure the embodiments in unnecessary detail. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the embodiments.
在本说明书的描述中,参考术语“一个实施例”、 “一些实施例”、 “示例”、 “具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, reference to the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" means that specific features described in connection with the embodiment or example , structure, material or characteristic is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
如在本申请中所使用的那样,术语“如果”可以依据上下文被解释为“当…时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this application, the term "if" may be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined" or "in response to the determination" or "once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
对于SOC芯片(System on Chip)来说,会根据工作的需要设置有不同的运行状态,这些不同的运行状态中至少包含两种状态:运行状态和待机状态。SOC芯片处于运行状态时,各种模块都打开,系统时钟的频率满足SOC芯片正常工作的需求;SOC芯片处于待机状态时,会将不必要的模块关闭,降低系统时钟的频率,降低电压,使这时的SOC芯片的整体功耗远远小于运行状态下的整体功耗,起到节省能耗的作用。本文中的第一工作状态为芯片系统的正常运行状态,第二工作状态为芯片系统的待机状态或者休眠状态,目标时钟为芯片系统在待机或者休眠时的系统时钟,芯片系统在第一工作状态和第二工作状态的系统时钟的频率的具体数值由在第一工作状态和第二工作状态下CPU单元的工作频率决定,第一工作状态时,各种模块都工作,CPU单元的工作频率较高,系统时钟的频率也较高,第二工作状态时,不必要的模块关闭,CPU单元的工作频率较低,系统时钟的频率也比较低。For the SOC chip (System on Chip), different operating states will be set according to the needs of the work, and these different operating states include at least two states: operating state and standby state. When the SOC chip is in the running state, various modules are turned on, and the frequency of the system clock meets the requirements of the normal operation of the SOC chip; At this time, the overall power consumption of the SOC chip is much smaller than the overall power consumption in the running state, which plays a role in saving energy consumption. The first working state in this paper is the normal operation state of the chip system, the second working state is the standby state or sleep state of the chip system, the target clock is the system clock when the chip system is in standby or sleep, and the chip system is in the first working state The specific value of the frequency of the system clock in the second working state is determined by the operating frequency of the CPU unit in the first working state and the second working state. In the first working state, various modules are working, and the operating frequency of the CPU unit is higher High, the frequency of the system clock is also high, in the second working state, unnecessary modules are turned off, the working frequency of the CPU unit is low, and the frequency of the system clock is also relatively low.
如图1所示,一种芯片系统,该芯片系统包括CPU单元(即图中的CPU)、总线单元(即图中的总线)、地址重映射单元、非易失性存储器和易失性存储器,即非易失性存储器为图中的存储1,易失性存储器为图中的存储2,所述CPU单元通过总线单元与地址重映射单元相连,所述CPU单元通过总线单元与外部设备相连,外部设备可以是电脑、手机、移动机器人等等采用智能芯片的电子设备;所述地址重映射单元分别与非易失性存储器和易失性存储器相连;所述CPU单元根据芯片系统是处于第一工作状态还是第二工作状态来决定用非易失性存储器还是易失性存储器运行代码;所述易失性存储器用于在芯片系统处于第一工作状态时,从所述非易失性存储器中搬运代码来运行;所述非易失性存储器用于在芯片系统处于第二工作状态时,根据目标时钟直接运行代码来实现低功耗;所述总线单元用于将外部设备的电信号传输给CPU单元或者将CPU单元的电信号传输给地址重映射单元;所述地址重映射单元用于在芯片系统进入第二工作状态前,对所述非易失性存储器和易失性存储器之间的代码搬运地址进行设置,使所述易失性存储器在芯片系统进入第一工作状态后,从所述非易失性存储器中搬运代码来运行(地址重映射:地址映射就是地址一一对应的意思。重映射就是重新分配这种一一对应的关系。把存储器看成一个具有输出和输入口的黑盒子,输入量是地址,输出的是对应地址上存储的数据。数据的存储单位一般是字节。每个字节的存储单元对应一个地址,当一个合法地址从存储器的地址总线输入后,该地址对应的存储单元上存储的数据就会出现在数据总线上面);其中,所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低,所述目标时钟为芯片系统在待机或者休眠时的系统时钟。所述芯片系统通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;所述芯片系统利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。As shown in Figure 1, a chip system includes a CPU unit (that is, the CPU in the figure), a bus unit (that is, the bus in the figure), an address remapping unit, a non-volatile memory, and a volatile memory , that is, the non-volatile memory is storage 1 in the figure, and the volatile memory is storage 2 in the figure, the CPU unit is connected to the address remapping unit through the bus unit, and the CPU unit is connected to the external device through the bus unit , the external device can be a computer, a mobile phone, a mobile robot, etc., which use smart chips; the address remapping unit is connected to the nonvolatile memory and the volatile memory respectively; the CPU unit is in the first The first working state or the second working state determines whether to use the non-volatile memory or the volatile memory to run the code; the volatile memory is used to read from the non-volatile memory when the chip system is in the first working state The non-volatile memory is used to run the code directly according to the target clock when the chip system is in the second working state to achieve low power consumption; the bus unit is used to transmit the electrical signal of the external device to the CPU unit or to transmit the electrical signal of the CPU unit to the address remapping unit; The code transfer address is set so that the volatile memory can transfer the code from the non-volatile memory to run after the chip system enters the first working state (address remapping: address mapping is one-to-one correspondence between addresses Meaning. Remapping is to redistribute this one-to-one relationship. Think of the memory as a black box with output and input ports, the input is the address, and the output is the data stored on the corresponding address. The storage unit of the data is generally byte. The storage unit of each byte corresponds to an address, when a legal address is input from the address bus of the memory, the data stored in the storage unit corresponding to the address will appear on the data bus); wherein, the non The power consumption of running codes in the volatile memory is lower than that of running codes in the volatile memory, and the target clock is a system clock when the chip system is in standby or sleep. The chip system stores and runs codes through two different memories, and switches the mode of running and storing through address remapping, so as to solve the problem of code execution switching under different working states; The power consumption of the running code of the non-volatile memory is lower than the power consumption of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the chip system can be reduced in the second working state. The power consumption is low, and the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient.
作为其中一种实施例,所述芯片系统还包括总线单元,所述CPU单元通过总线单元与地址重映射单元和外部设备相连,所述总线单元用于将外部设备的电信号传输给CPU单元或者将CPU单元的电信号传输给地址重映射单元。CPU单元通过总线单元即可进行信息的接收和发送,结构简单,有效减少芯片系统的面积。所述CPU单元在确定芯片系统进行工作状态切换后,可以通过总线单元发送相应的使能信号给存储器来启用相应的存储器。CPU单元通过总线单元即可进行信息的接收和发送,结构简单,有效减少芯片系统的面积。As one of the embodiments, the chip system further includes a bus unit, the CPU unit is connected to the address remapping unit and the external device through the bus unit, and the bus unit is used to transmit the electrical signal of the external device to the CPU unit or Transmits the electrical signal of the CPU unit to the address remapping unit. The CPU unit can receive and send information through the bus unit, which has a simple structure and effectively reduces the area of the chip system. After the CPU unit determines that the chip system switches the working state, it can send a corresponding enable signal to the memory through the bus unit to enable the corresponding memory. The CPU unit can receive and send information through the bus unit, which has a simple structure and effectively reduces the area of the chip system.
作为其中一种实施例,所述芯片系统从第一工作状态切换到第二工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,关闭所述易失性存储器,启用所述非易失性存储器,并将所述非易失性存储器的代码初始运行地址映射到非易失性存储器中存储的运行代码的存储初始地址处,然后降低系统的时钟的频率,使所述非易失性存储器根据降低频率后的系统时钟运行代码来实现低功耗。将运行代码存储到非易失性存储器中,使运行代码在非易失性存储器掉电后不会丢失,并且通过地址映射的方式进行代码地址的切换,只需一份运行代码就可以实现存储器的切换,降低运行代码的开发和维护难度。As one of the embodiments, when the chip system is switched from the first working state to the second working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit receives the enable signal Afterwards, close the volatile memory, enable the non-volatile memory, and map the code initial running address of the non-volatile memory to the storage initial address of the running code stored in the non-volatile memory , and then reduce the frequency of the system clock, so that the non-volatile memory runs codes according to the reduced frequency of the system clock to achieve low power consumption. Store the running code in the non-volatile memory, so that the running code will not be lost after the non-volatile memory is powered off, and switch the code address through the address mapping method, only one copy of the running code can realize the memory Switching to reduce the difficulty of developing and maintaining the running code.
作为其中一种实施例,所述芯片系统从第二工作状态切换到第一工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,启用所述易失性存储器,将所述易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,使所述易失性存储器在芯片系统处于第一工作状态时,从所述非易失性存储器中搬运代码来运行。正常工作时,通过易失性存储器从所述非易失性存储器中搬运代码来运行,来提高芯片系统中断后,芯片系统再次工作时的响应速度。As one of the embodiments, when the chip system switches from the second working state to the first working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit receives the enable signal Afterwards, the volatile memory is enabled, the code initial running address of the volatile memory is mapped to the storage initial address of the code stored in the non-volatile memory, so that the volatile memory is in the chip system In the first working state, the code is transferred from the non-volatile memory to run. When working normally, the volatile memory is used to carry codes from the non-volatile memory to run, so as to improve the response speed when the chip system is interrupted and the chip system works again.
存储器(Memory)是单片机最重要的功能单元之一,是众多存储单元的集合,而存储器(Memory)本身并不具有地址信息,那么CPU(例如,ARM Cortex-M4内核)要准确的找到存储某个信息的存储单元,就必须为这些单元分配一个相互区别的标识,这个标识就是我们通常所说的地址编码。例如在STM32微控制器(MCU)STM32F407中,集成了多种类型的Memory,同一类型的 Memory 为一个 Memory Block(block 0 ~ block 7),每一个都被分配一个数值连续、存储单元数相等、以16进制表示的自然数集合作为 Memory Block 的地址编码。这种自然数集合与 Memory Block 的对应关系,就是 Memory Map(存储器映射),有时也叫 Address Map(地址映射)。正常工作时,通过易失性存储器从所述非易失性存储器中搬运代码来运行,来提高芯片系统中断后,芯片系统再次工作时的响应速度。第二工作状态时,为了降低芯片系统的功耗,会将易失性存储器关闭,易失性存储器保存的代码和数据都会丢失,而为了提高芯片系统的响应速度,使芯片系统第一工作状态时,需要通过易失性存储器运行代码,所以芯片系统从第二工作状态进入到第一工作状态时,要在非易失性存储器的代码存储地址和易失性存储器的代码存储地址之间建立映射关系,将易失性存储器的运行代码的初始地址对应到非易失性存储器中存储的运行代码的初始地址,芯片系统正常工作时,芯片系统访问易失性存储器的运行代码的初始地址,实际上是访问非易失性存储器的运行代码的初始地址中的代码,非易失性存储器中代码在芯片系统正常工作下被易失性存储器通过代码对应的存储地址调用,以实现搬运相应代码操作,从而达到地址映射的目的。而非易失性存储器掉电不会丢失数据,所以运行代码保存在非易失性存储器中,芯片系统从第一工作状态进入到第二工作状态时,芯片系统关闭易失性存储器,降低系统时钟,然后使所述非易失性存储器的代码初始运行地址与非易失性存储器中存储的运行代码的存储初始地址建立映射关系,然后从非易失性存储器的代码初始运行地址处开始运行,而非易失性存储器不需要从易失性存储器中搬运代码来运行。The memory (Memory) is one of the most important functional units of the single-chip microcomputer. If there is a storage unit of information, it is necessary to assign a distinctive identifier to these units. This identifier is what we usually call an address code. For example, in the STM32 microcontroller (MCU) STM32F407, multiple types of Memory are integrated. The same type of Memory is a Memory Block (block 0 ~ block 7), each of which is assigned a continuous value, equal number of storage cells, The set of natural numbers expressed in hexadecimal is used as the address encoding of the Memory Block. The corresponding relationship between this natural number set and Memory Block is Memory Map (memory mapping), sometimes also called Address Map (address mapping). When working normally, the volatile memory is used to carry codes from the non-volatile memory to run, so as to improve the response speed when the chip system is interrupted and the chip system works again. In the second working state, in order to reduce the power consumption of the chip system, the volatile memory will be turned off, and the code and data stored in the volatile memory will be lost. In order to improve the response speed of the chip system, the first working state of the chip system will be , the code needs to be run through the volatile memory, so when the chip system enters the first working state from the second working state, it is necessary to establish between the code storage address of the nonvolatile memory and the code storage address of the volatile memory The mapping relationship corresponds the initial address of the running code in the volatile memory to the initial address of the running code stored in the non-volatile memory. When the chip system is working normally, the chip system accesses the initial address of the running code in the volatile memory. In fact, it is the code in the initial address of the running code that accesses the non-volatile memory. The code in the non-volatile memory is called by the volatile memory through the storage address corresponding to the code when the chip system is working normally, so as to carry the corresponding code. operation, so as to achieve the purpose of address mapping. The non-volatile memory will not lose data when it is powered off, so the running code is stored in the non-volatile memory. When the chip system enters the second working state from the first working state, the chip system turns off the volatile memory, reducing the system clock, and then make the code initial running address of the non-volatile memory and the storage initial address of the running code stored in the non-volatile memory to establish a mapping relationship, and then start running from the code initial running address of the non-volatile memory , non-volatile memory does not require code to be moved from volatile memory to run.
作为其中一种实施例,所述非易失性存储器为Flash存储器。非易失性存储器(英语:non-volatile memory,缩写为NVM)是指当电流关掉后,所存储的数据不会消失的电脑存储器。非易失性存储器中,依存储器内的数据是否能在使用电脑时随时改写为标准,可分为二大类产品,即ROM和Flash memory。快闪存储器(英语:flash memory),是一种电子式可清除程序化只读存储器的形式,允许在操作中被多次擦或写的存储器。这种科技主要用于一般性数据存储,以及在电脑与其他数字产品间交换传输数据,如储存卡与U盘。As one of the embodiments, the non-volatile memory is a Flash memory. Non-volatile memory (English: non-volatile memory, abbreviated as NVM) refers to a computer memory whose stored data does not disappear when the current is turned off. In non-volatile memory, according to whether the data in the memory can be rewritten to the standard at any time when using the computer, it can be divided into two categories of products, namely ROM and Flash memory. Flash memory (English: flash memory) is a form of electronic erasable programmable read-only memory that allows it to be erased or written multiple times during operation. This technology is mainly used for general data storage, as well as for exchanging and transmitting data between computers and other digital products, such as memory cards and USB flash drives.
作为其中一种实施例,所述易失性存储器为DDR存储器或SRAM存储器。RAM(RandomAccess Memory)的全名为随机存取记忆体,它相当于PC机上的移动存储,用来存储和保存数据的。它在任何时候都可以读写,RAM通常是作为操作系统或其他正在运行程序的临时存储介质(可称作系统内存)。不过,当电源关闭时RAM不能保留数据,如果需要保存数据,就必须把它们写入到一个长期的存储器中(例如硬盘)。正因为如此,有时也将RAM称作"可变存储器"。RAM内存可以进一步分为静态RAM(SRAM)和动态内存(DRAM)两大类。DRAM由于具有较低的单位容量价格,所以被大量的采用作为系统的主记忆。DDR=Double Data Rate双倍速率,DDR SDRAM=双倍速率同步动态随机存储器,人们习惯称为DDR,其中,SDRAM 是Synchronous Dynamic Random Access Memory的缩写,即同步动态随机存取存储器。而DDRSDRAM是Double Data Rate SDRAM的缩写,是双倍速率同步动态随机存储器的意思。DDR内存是在SDRAM内存基础上发展而来的,仍然沿用SDRAM生产体系,因此对于内存厂商而言,只需对制造普通SDRAM的设备稍加改进,即可实现DDR内存的生产,可有效的降低成本。As one of the embodiments, the volatile memory is DDR memory or SRAM memory. The full name of RAM (Random Access Memory) is Random Access Memory, which is equivalent to mobile storage on a PC and is used to store and save data. It can be read and written at any time, and RAM is usually used as a temporary storage medium for the operating system or other running programs (it can be called system memory). However, RAM cannot retain data when the power is turned off. If data needs to be saved, they must be written to a long-term storage (such as a hard disk). Because of this, RAM is sometimes called "variable memory." RAM memory can be further divided into static RAM (SRAM) and dynamic memory (DRAM). Due to its low price per unit capacity, DRAM is widely used as the main memory of the system. DDR=Double Data Rate double rate, DDR SDRAM=double rate synchronous dynamic random access memory, people are used to call it DDR, among them, SDRAM is the abbreviation of Synchronous Dynamic Random Access Memory, that is, synchronous dynamic random access memory. DDR SDRAM is the abbreviation of Double Data Rate SDRAM, which means double rate synchronous dynamic random access memory. DDR memory is developed on the basis of SDRAM memory and still uses the SDRAM production system. Therefore, for memory manufacturers, it is only necessary to slightly improve the equipment for manufacturing ordinary SDRAM to realize the production of DDR memory, which can effectively reduce cost.
一种移动机器人,所述移动机器人包括上述的芯片系统。移动机器人具有的所述芯片系统,通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。第二工作状态时,通过功耗更低的非易失性存储器来运行代码,降低芯片系统在第二工作状态的运行功耗。A mobile robot includes the above chip system. The chip system possessed by the mobile robot stores and runs codes through two different memories, and switches the mode of running and storing through address remapping, so as to solve the problem of code execution switching under different working conditions; The power consumption of the running code of the non-volatile memory is lower than the power consumption of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the chip system can be reduced in the second working time. The power consumption of the state, and the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient. In the second working state, the code is run through the non-volatile memory with lower power consumption, thereby reducing the operating power consumption of the chip system in the second working state.
一种芯片系统的运行方法,该运行方法用于使上述的芯片系统运行,所述运行方法包括以下步骤:所述CPU通过总线单元接收工作状态指令后,判断芯片系统是否进行工作状态切换;若所述芯片系统进行工作状态切换,则所述CPU单元通过地址重映射单元重新设置运行代码的地址;若所述芯片系统切换为第一工作状态,则所述易失性存储器从所述非易失性存储器中搬运代码来运行;若所述芯片系统切换为第二工作状态,则所述非易失性存储器根据目标时钟直接运行代码;其中,所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低,所述目标时钟为芯片系统在待机或者休眠时的系统时钟。所述芯片系统通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;利用在目标时钟下所述非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低的特性,通过在目标时钟状态下,采用非易失性存储器运行代码,来降低芯片系统在第二工作状态的功耗,而且一份相同的运行代码就可以实现不同的工作状态切换和运行,结构简单,实现方便。An operation method of a chip system, the operation method is used to make the above-mentioned chip system run, and the operation method includes the following steps: After the CPU receives a working state instruction through a bus unit, it judges whether the chip system performs working state switching; if When the chip system switches the working state, the CPU unit resets the address of the running code through the address remapping unit; if the chip system is switched to the first working state, the volatile memory starts The code is carried in the volatile memory to run; if the chip system is switched to the second working state, the non-volatile memory directly runs the code according to the target clock; wherein, the power consumption of the non-volatile memory running code The power consumption of running code is lower than that of the volatile memory, and the target clock is the system clock when the chip system is in standby or sleep. The chip system uses two different memories to store and run code, and through address remapping, switch the way of running and storing, so as to solve the problem of code execution switching under different working conditions; The power consumption of the running code of the volatile memory is lower than that of the running code of the volatile memory. By using the non-volatile memory to run the code in the target clock state, the power consumption of the chip system in the second working state is reduced. Moreover, the same running code can realize switching and running of different working states, the structure is simple, and the implementation is convenient.
作为其中一种实施例,所述CPU单元通过总线单元接收工作状态指令后,判断芯片系统是否进行工作状态切换,包括以下步骤:所述芯片系统通过总线单元接收工作状态指令后,判断工作状态指令是第一工作状态运行指令还是第二工作状态运行指令;所述芯片系统根据当前自身所处的工作状态和工作状态指令判断自身是否需要切换工作状态;若所述芯片系统当前自身处于第一工作状态,则所述芯片系统接收到第二工作状态运行指令后,芯片系统切换为第二工作状态;若所述芯片系统当前自身处于第二工作状态,则所述芯片系统接收到第一工作状态运行指令后,芯片系统切换为第一工作状态。所述芯片系统根据工作状态指令来决定自身的工作状态是否需要切换,使芯片系统可以快速进入不同的工作状态,实用性较高。CPU单元通过总线单元接收到第一工作状态运行指令后,所述CPU单元判断芯片系统当前的工作状态;若所述CPU单元判断芯片系统当前处于第一工作状态,则芯片系统不切换工作状态,使所述CPU单元继续通过易失性存储器运行代码;若所述CPU单元判断芯片系统当前处于第二工作状态,则芯片系统切换为第一工作状态,所述CPU单元唤醒芯片系统,然后使所述易失性存储器在芯片系统进入第一工作状态后,从所述非易失性存储器中搬运代码来运行。CPU单元通过总线单元接收到第二工作状态运行指令后,所述CPU单元判断芯片系统当前的工作状态;若所述CPU单元判断芯片系统当前处于第一工作状态,则芯片系统切换为第二工作状态,所述CPU单元配置地址重映射单元,使所述地址重映射单元对代码的运行地址和代码的存储地址重新建立映射关系,降低系统时钟的频率,关闭易失性存储器,使非易失性存储器根据目标时钟直接运行代码;若所述CPU单元判断芯片系统当前处于第二工作状态,则芯片系统不切换工作状态,使所述CPU单元继续通过非易失性存储器根据目标时钟直接运行代码来实现低功耗。As one of the embodiments, after the CPU unit receives the working state instruction through the bus unit, it judges whether the chip system switches the working state, including the following steps: after the chip system receives the working state instruction through the bus unit, it judges the working state instruction Is it the first working state operation instruction or the second working state operation instruction; the chip system judges whether it needs to switch the working state according to its current working state and the working state instruction; if the chip system itself is currently in the first working state state, after the chip system receives the second working state operation command, the chip system switches to the second working state; if the chip system itself is currently in the second working state, the chip system receives the first working state After the instruction is executed, the chip system switches to the first working state. The chip system determines whether its own working state needs to be switched according to the working state instruction, so that the chip system can quickly enter different working states, and has high practicability. After the CPU unit receives the operation instruction in the first working state through the bus unit, the CPU unit judges the current working state of the chip system; if the CPU unit judges that the chip system is currently in the first working state, the chip system does not switch the working state, Make the CPU unit continue to run the code through the volatile memory; if the CPU unit judges that the chip system is currently in the second working state, the chip system switches to the first working state, the CPU unit wakes up the chip system, and then makes the chip system After the volatile memory enters the first working state, the code is transferred from the non-volatile memory to run. After the CPU unit receives the second working state operation instruction through the bus unit, the CPU unit judges the current working state of the chip system; if the CPU unit judges that the chip system is currently in the first working state, the chip system switches to the second working state. state, the CPU unit is configured with an address remapping unit, so that the address remapping unit re-establishes the mapping relationship between the running address of the code and the storage address of the code, reduces the frequency of the system clock, closes the volatile memory, and makes the nonvolatile The non-volatile memory directly runs the code according to the target clock; if the CPU unit judges that the chip system is currently in the second working state, the chip system does not switch the working state, so that the CPU unit continues to directly run the code according to the target clock through the non-volatile memory to achieve low power consumption.
作为其中一种实施例,所述芯片系统从第一工作状态切换到第二工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,关闭所述易失性存储器,启用所述非易失性存储器,并将所述非易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,然后降低系统的时钟的频率,使所述非易失性存储器根据降低频率后的系统时钟运行代码来实现低功耗待机,其中,所述降低频率后的系统时钟为芯片系统在待机或者休眠时的系统时钟。将运行代码存储到非易失性存储器中,使运行代码在非易失性存储器掉电后不会丢失,并且通过地址映射的方式进行代码地址的切换,只需一份运行代码就可以实现存储器的切换,降低运行代码的开发和维护难度。第二工作状态时,通过功耗更低的非易失性存储器来运行代码,降低芯片系统在第二工作状态的运行功耗。As one of the embodiments, when the chip system is switched from the first working state to the second working state, the CPU unit sends enable to the address remapping unit through the bus unit, and the address remapping unit receives the enable signal Afterwards, closing the volatile memory, enabling the non-volatile memory, and mapping the initial running address of the code of the non-volatile memory to the storage initial address of the code stored in the non-volatile memory, Then reduce the frequency of the clock of the system, so that the non-volatile memory runs the code according to the system clock after the frequency reduction to realize low power consumption standby, wherein the system clock after the frequency reduction is when the chip system is in standby or sleep system clock. Store the running code in the non-volatile memory, so that the running code will not be lost after the non-volatile memory is powered off, and switch the code address through the address mapping method, only one copy of the running code can realize the memory Switching to reduce the difficulty of developing and maintaining the running code. In the second working state, the code is run through the non-volatile memory with lower power consumption, thereby reducing the operating power consumption of the chip system in the second working state.
作为其中一种实施例,芯片系统从第二工作状态切换到第一工作状态时,所述CPU单元通过总线单元发送使能给地址重映射单元,所述地址重映射单元接收使能信号后,启用所述易失性存储器,将所述易失性存储器的代码初始运行地址映射到非易失性存储器中存储的代码的存储初始地址处,使所述易失性存储器在芯片系统处于第一工作状态时,从所述非易失性存储器中搬运代码来运行。正常工作时,通过易失性存储器从所述非易失性存储器中搬运代码来运行,来提高芯片系统中断后,芯片系统再次工作时的响应速度。As one of the embodiments, when the chip system switches from the second working state to the first working state, the CPU unit sends an enable to the address remapping unit through the bus unit, and after the address remapping unit receives the enable signal, Enable the volatile memory, map the code initial running address of the volatile memory to the storage initial address of the code stored in the non-volatile memory, make the volatile memory in the first In the working state, the code is carried from the non-volatile memory to run. When working normally, the volatile memory is used to carry codes from the non-volatile memory to run, so as to improve the response speed when the chip system is interrupted and the chip system works again.
作为其中一种实施例,所述CPU单元判断工作状态指令是第一工作状态运行指令还是第二工作状态运行指令,包括以下步骤:所述CPU单元在接收到外部设备的信息后,开始计时;若在设定时间内,CPU单元没有再次接收到外部设备发送的信息后,则CPU单元判断自身接收到第二工作状态运行指令,进入第二工作状态;若在设定时间内,CPU单元再次接收到外部设备发送的信息后,则CPU单元将计时清零,并重新开始计时;若CPU单元没有接收到第二工作状态运行指令,则CPU单元判断自身接收到第一工作状态运行指令。通过周期性的计算方法来使芯片系统在不工作时,进入第二工作状态,降低芯片系统的运行功耗。As one of the embodiments, the CPU unit judging whether the working state command is the first working state running command or the second working state running command includes the following steps: the CPU unit starts timing after receiving the information of the external device; If within the set time, the CPU unit does not receive the information sent by the external device again, the CPU unit judges that it has received the second working state operation command and enters the second working state; if within the set time, the CPU unit again After receiving the information sent by the external device, the CPU unit resets the timing and restarts the timing; if the CPU unit does not receive the second working state operation command, the CPU unit judges that it has received the first working state running command. The periodic calculation method is used to enable the chip system to enter the second working state when it is not working, so as to reduce the operating power consumption of the chip system.
作为其中一种实施例,所述芯片系统在工作前,先检测非易失性存储器和易失性存储器是否正常;若非易失性存储器和易失性存储器均正常,则芯片系统正常工作;若非易失性存储器和易失性存储器均不正常,则芯片系统发出工作异常指令,并停止工作;若非易失性存储器和易失性存储器中有一个不正常,则芯片系统发出工作异常指令,并在第一工作状态和第二工作状态时,都通过正常的存储器运行代码。芯片系统在工作前检测存储器的状态,防止存储器出现问题,芯片系统无法正常工作。即使有一个存储器损坏,芯片系统也可以运行不同的工作状态。As one of the embodiments, before the chip system works, it detects whether the non-volatile memory and the volatile memory are normal; if the non-volatile memory and the volatile memory are normal, the chip system works normally; If both the volatile memory and the volatile memory are abnormal, the system-on-a-chip will issue an abnormal operation command and stop working; if one of the non-volatile memory and the volatile memory is abnormal, the system-on-a-chip will issue an abnormal operation command and In both the first working state and the second working state, the code is run through the normal memory. The chip system detects the status of the memory before working to prevent problems in the memory and the chip system cannot work normally. Even if one memory is damaged, the system-on-a-chip can run in a different working state.
作为其中一种实施例,所述CPU单元在采用易失性存储器运行代码时,会检测易失性存储器是否正常;若易失性存储器正常,则易失性存储器继续运行代码;若易失性存储器不正常,则CPU单元发出工作异常指令,并切换非易失性存储器来运行代码。当检测到正在运行代码的存储器异常时,切换到另一个正常的的存储器来运行代码,保证芯片系统可以正常工作。As one of the embodiments, when the CPU unit uses the volatile memory to run the code, it will detect whether the volatile memory is normal; if the volatile memory is normal, the volatile memory continues to run the code; If the memory is abnormal, the CPU unit will issue an abnormal operation command and switch the non-volatile memory to run the code. When an abnormality is detected in the memory where the code is running, switch to another normal memory to run the code to ensure that the chip system can work normally.
作为其中一种实施例,所述CPU单元在采用非易失性存储器运行代码时,会检测非易失性存储器是否正常;若非易失性存储器正常,则非易失性存储器继续低功耗运行代码;若非易失性存储器不正常,则CPU单元发出工作异常指令,并唤醒易失性存储器,然后从非易失性存储器中搬运代码到易失性存储器中,使易失性存储器根据目标时钟来运行代码。当检测到正在运行代码的存储器异常时,切换到另一个正常的的存储器来运行代码,保证芯片系统可以正常工作。As one of the embodiments, when the CPU unit uses the non-volatile memory to run the code, it will detect whether the non-volatile memory is normal; if the non-volatile memory is normal, the non-volatile memory continues to operate with low power consumption code; if the non-volatile memory is abnormal, the CPU unit will issue an abnormal operation command, and wake up the volatile memory, and then transfer the code from the non-volatile memory to the volatile memory, so that the volatile memory will be clocked according to the target clock to run the code. When an abnormality is detected in the memory where the code is running, switch to another normal memory to run the code to ensure that the chip system can work normally.
与现有技术相比,本发明的有益效果在于:本申请所述的芯片系统通过两个不同的存储器来进行代码存储和运行,并通过地址重映射,切换运行存储的方式,解决不同工作状态下代码执行切换的问题;当检测到正在运行代码的存储器异常时,切换到另一个正常的的存储器来运行代码,保证基本功能;在目标时钟状态线,非易失性存储器运行代码的功耗比易失性存储器运行代码的功耗低,降低芯片系统在低功耗运行的功耗。Compared with the prior art, the beneficial effect of the present invention is that: the chip system described in this application uses two different memories to store and run codes, and through address remapping, the mode of running and storing can be switched to solve different working states. The following code execution switching problem; when an abnormality is detected in the memory that is running the code, switch to another normal memory to run the code to ensure the basic functions; on the target clock status line, the power consumption of the non-volatile memory to run the code The power consumption of running code is lower than that of volatile memory, which reduces the power consumption of the chip system running at low power consumption.
显然,上述的实施例仅仅是本发明一部分实施例,而不是全部的实施例,各个实施例之间的技术方案可以相互结合。此外,如果实施例中出现“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等术语,其指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位或以特定的方位构造和操作,因此不能理解为对本发明的限制。如果实施例中出现“第一”、“第二”、“第三”等术语,是为了便于相关特征的区分,不能理解为指示或暗示其相对重要性、次序的先后或者技术特征的数量。Apparently, the above-mentioned embodiments are only a part of the embodiments of the present invention, rather than all the embodiments, and the technical solutions of the various embodiments can be combined with each other. In addition, if terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" appear in the embodiments, the directions indicated Or the positional relationship is based on the orientation or positional relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation. , and therefore cannot be construed as a limitation of the present invention. If terms such as "first", "second", and "third" appear in the embodiments, they are for the convenience of distinguishing related features, and cannot be understood as indicating or implying their relative importance, sequence or quantity of technical features.
另外,在本发明的描述中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In addition, in the description of the present invention, unless otherwise clearly stipulated and limited, the terms "installation", "connection" and "connection" should be interpreted in a broad sense, for example, it can be a fixed connection or a detachable connection, or Integral connection; it can be mechanical connection or electrical connection; it can be direct connection or indirect connection through an intermediary, and it can be the internal communication of two components. Those of ordinary skill in the art can understand the specific meanings of the above terms in the present invention in specific situations.
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同限定以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Although the embodiments of the present invention have been shown and described, those skilled in the art can understand that various changes, modifications and substitutions can be made to these embodiments without departing from the principle and spirit of the present invention. and variants, the scope of the present invention is defined by the appended claims and their equivalents. changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310297570.0A CN116301292A (en) | 2023-03-24 | 2023-03-24 | System on a chip, robot and operating method of the system on a chip |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310297570.0A CN116301292A (en) | 2023-03-24 | 2023-03-24 | System on a chip, robot and operating method of the system on a chip |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116301292A true CN116301292A (en) | 2023-06-23 |
Family
ID=86779576
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310297570.0A Pending CN116301292A (en) | 2023-03-24 | 2023-03-24 | System on a chip, robot and operating method of the system on a chip |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116301292A (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5504910A (en) * | 1994-02-02 | 1996-04-02 | Advanced Micro Devices, Inc. | Power management unit including software configurable state register and time-out counters for protecting against misbehaved software |
| CN104885034A (en) * | 2012-12-22 | 2015-09-02 | 高通股份有限公司 | Reducing power consumption of volatile memory via use of non-volatile memory |
| US20180150254A1 (en) * | 2015-07-30 | 2018-05-31 | Huawei Technologies Co., Ltd. | Hybrid storage device, computer, control device, and power consumption reduction method |
| CN220526328U (en) * | 2023-03-24 | 2024-02-23 | 珠海一微半导体股份有限公司 | Chip system and mobile robot |
-
2023
- 2023-03-24 CN CN202310297570.0A patent/CN116301292A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5504910A (en) * | 1994-02-02 | 1996-04-02 | Advanced Micro Devices, Inc. | Power management unit including software configurable state register and time-out counters for protecting against misbehaved software |
| CN104885034A (en) * | 2012-12-22 | 2015-09-02 | 高通股份有限公司 | Reducing power consumption of volatile memory via use of non-volatile memory |
| US20180150254A1 (en) * | 2015-07-30 | 2018-05-31 | Huawei Technologies Co., Ltd. | Hybrid storage device, computer, control device, and power consumption reduction method |
| CN220526328U (en) * | 2023-03-24 | 2024-02-23 | 珠海一微半导体股份有限公司 | Chip system and mobile robot |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103810113B (en) | A kind of fusion memory system of nonvolatile storage and dynamic random access memory | |
| CN103123579B (en) | There is the work for subsequent use of additional microcontroller | |
| US8892831B2 (en) | Memory subsystem hibernation | |
| CN105556416B (en) | Power outage protection and recovery utilizing low power states in data storage devices/systems | |
| US20230244500A1 (en) | Serial NAND Flash With XIP Capability | |
| CN102037428A (en) | Integrated circuit and method with secondary memory controller for providing sleep states with reduced power consumption | |
| CN105702300A (en) | NAND Flash fault tolerant system based on FPGA (Field Programmable Gate Array) | |
| CN108470007A (en) | Apparatus and method for providing cache memory movement with a non-volatile mass memory system | |
| TW202132970A (en) | Memory module, method for managing operational state data in said memory module, and host device | |
| US20120011299A1 (en) | Memory device with dynamic controllable physical logical mapping table loading | |
| KR101936765B1 (en) | Electronic device, micro controller and method for controlling thereof | |
| CN113383317B (en) | A processing device, method and related equipment | |
| CN111399752B (en) | Control devices and methods for different types of storage units | |
| CN103927145B (en) | Method and device for system sleep and wake-up based on hybrid memory | |
| WO2022227473A1 (en) | Spi access control method and system, and computing device and storage medium | |
| CN220526328U (en) | Chip system and mobile robot | |
| WO2024036452A1 (en) | Processing apparatus, and related control method for low-power-consumption standby | |
| US20170262208A1 (en) | Memory device, host device, and information processing device | |
| CN116301292A (en) | System on a chip, robot and operating method of the system on a chip | |
| CN118796293B (en) | Multi-system hibernation method, device and storage medium | |
| WO2019041903A1 (en) | Nonvolatile memory based computing device and use method therefor | |
| CN105761756A (en) | Scheme for improving performance and reliability of mass solid state disc by utilizing high-performance non-volatile solid-state memory | |
| CN113370826B (en) | Control method, control device and charging system of charging pile | |
| CN117594076A (en) | memory device | |
| TW202427206A (en) | Method for handling configuration data for an interconnection protocol within hibernate operation, controller and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: 519000 Guangdong Province Zhuhai City Hengqin New District Zhi Shui Road 88 Office 1508 Applicant after: Zhuhai Yiwei Semiconductor Co.,Ltd. Address before: 519000 2706, No. 3000, Huandao East Road, Hengqin new area, Zhuhai, Guangdong Applicant before: Zhuhai Yiwei Semiconductor Co.,Ltd. Country or region before: China |
|
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: 519000 Guangdong Province Zhuhai City Hengqin New District Zhi Shui Road 88 Office 1508 Applicant after: Zhuhai Yiwei Technology Co., Ltd. Address before: 519000 Guangdong Province Zhuhai City Hengqin New District Zhi Shui Road 88 Office 1508 Applicant before: Zhuhai Yiwei Semiconductor Co.,Ltd. Country or region before: China |