手臂睡眠模式的进入和退出差异WFE,WFI [英] arm sleep mode entry and exit differences WFE, WFI

查看:343
本文介绍了手臂睡眠模式的进入和退出差异WFE,WFI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于ARM体系结构,我是相当陌生的人,我正在努力唤醒唤醒机制.

I am reasonably new to the ARM architectures and I am trying to wrap my head around the wake up mechanism.

因此,首先,我发现很难找到有关此方面的好信息. ARM的文档在该主题上似乎非常简洁.

So first of all I am finding it difficult to find good info on this. ARM's documentation seems to be very terse on the topic.

我想了解的是Cortex(尤其是M0,因为我正在使用它)何时醒来.

What I'd like to understand is when the Cortex (particularly the M0 as that's what I am working with) will wake up.

作为参考,我还参考了以下内容:

For reference, I have also consulted the following:

  • What is the purpose of WFI and WFE instructions and the event signals?
  • Why does the processor enter standby when using WFE instruction but not when using WFI instruction?

WFE说明中的文档是:

The docs on the WFE instructions are:

    3.7.11. WFE
    Wait For Event.
    Syntax
    WFE
    Operation
    If the event register is 0, WFE suspends execution until 
      one of the following events occurs:
    an exception, unless masked by the exception mask registers or the current
      priority level
    an exception enters the Pending state, if SEVONPEND in the 
      System Control Register is set
    a Debug Entry request, if debug is enabled
    an event signaled by a peripheral or another processor in a 
      multiprocessor system using the SEV instruction.
    If the event register is 1, WFE clears it to 0 and completes immediately.
    For more information see Power management.
    Note
    WFE is intended for power saving only. When writing software assume 
      that WFE might behave as NOP.
    Restrictions
    There are no restrictions.
    Condition flags
    This instruction does not change the flags.
    Examples
        WFE  ; Wait for event

WFI:

    3.7.12. WFI
    Wait for Interrupt.
    Syntax
    WFI
    Operation
    WFI suspends execution until one of the following events occurs:
    an exception
    an interrupt becomes pending, which would preempt if PRIMASK was clear
    a Debug Entry request, regardless of whether debug is enabled.
    Note
    WFI is intended for power saving only. When writing software assume 
    that WFI might behave as a NOP operation.
    Restrictions
    There are no restrictions.
    Condition flags
    This instruction does not change the flags.
    Examples
        WFI ; Wait for interrupt

所以,一些问题:

1)首先,有人可以澄清一下两者之间的区别吗?

1) Firstly, can someone please clarify the difference between:

a)系统处理程序优先级寄存器

a) System Handler Priority Registers

b)中断优先级寄存器. 仅仅是b)是用于与系统无关的中断,例如pendSv吗?

b) Interrupt Priority Registers. Is it just that b) are for interrupts that aren't system related such as pendSv?

现在在某些情况下.我真的很想了解方案如何受以下因素支配: NVIC IRQ启用 NVIC待定 底妆

Now for some scenarios. Really I would like to understand how the scenarios governed by the: NVIC IRQ enable NVIC pending PRIMASK

影响WFE和WFI的进入和退出.

affect the entry and exit of WFE and WFI.

因此,这些位的各种组合会产生8种不同的情况 {NVIC_IRQ启用,NVIC待处理,PRIMASK}.

So the various combinations of these bits yields 8 different scenarios {NVIC_IRQ enable, NVIC pending, PRIMASK}.

到目前为止,我已经添加了模糊的理解.请帮我这张桌子.

I have already added my vague understanding so far. Please help me with this table.

  • 000-无法阻止WFE或WFI进入,但也没有唤醒条件
  • 001-为000
  • 010-待处理如何影响WFE和WFI进入睡眠模式?
  • 011-我想答案是010,但唤醒条件可能不同?
  • 100-我想WFE和WFI都可以进入低功耗模式并退出低功耗模式.
  • 101-与WFE和WFI功耗模式有何不同?
  • 110-不知道!
  • 111-不知道!

我在这里排除了优先级,因为我现在还不太担心异常处理顺序.

I am excluding the priorities here as I'm not too concerned about the exception handling order just yet.

不包括SEV和事件信号,如果SEVONPEND为0,WFE的行为是否与WFI相同?

Excluding SEV and the event signals, does WFE behave the same as WFI if SEVONPEND is 0?

推荐答案

在Cortex-M上看到的主要唤醒机制是中断,因此是WFI(等待中断).我看到的所有实现都会导致时钟对内核进行时钟门控,尽管如果设计支持,有时可以使用更深的睡眠/更高的延迟模式.

The primary mechanism for wake that you'll see on a Cortex-M is an interrupt, hence WFI (wait for interrupt). On all of the implementations that I've seen that results in clock-gating the core, although deeper sleep/higher latency modes are sometimes available if the design supports it.

WFE在多处理器设计中更为重要.

WFE is more relevant in multi-processor designs.

关于这些问题- 1.中断和系统处理程序在Cortex-M中非常相似,主要区别在于它们的触发方式.体系结构将它们区分开,但是实际上它们是相同的.

With regard to the questions - 1. Interrupts and System Handlers are very similar in the Cortex-M, differing primarily by how they are triggered. The architecture distinguishes between them, but in practice they are the same.

关于位表,它们实际上没有任何意义.每个Cortex-M实施对WFI期间发生的事情都有其自己的解释.从基本的时钟门控到深度睡眠模式,它可能会有所不同.请查阅您的微处理器文档以获取真实的故事.

Are for your bit tables, they don't really make sense. Each Cortex-M implementation has it's own interpretation of what happens during WFI. It can vary from basic clock gating to deep-sleep modes. Consult your microprocessor documentation for the real story.

PRIMASK不会影响从睡眠行为中唤醒.

PRIMASK doesn't affect wake from sleep behavior.

这篇关于手臂睡眠模式的进入和退出差异WFE,WFI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆