"

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sleep and Power Saving Features

Hello,
I am developing a solution and it requires a power saving feature. I am using FreeRTOS, so I want to use the vApplicationHook() or the Tickless Low Power (http://www.freertos.org/low-power-tickless-rtos.html) modes.
Is there a sleep function for ARC processors? If so, can you provide an example using them?
Thank you!

Comments

  • rlino said:

    Hello,
    I am developing a solution and it requires a power saving feature. I am using FreeRTOS, so I want to use the vApplicationHook() or the Tickless Low Power (http://www.freertos.org/low-power-tickless-rtos.html) modes.
    Is there a sleep function for ARC processors? If so, can you provide an example using them?
    Thank you!

    Hi rlino,
    Are you trying to run on EMSK for EM processor?
    elliot
  • edited December 2015
    Hi rlino,
    There does exist a SLEEP instruction which puts the processor into a sleep state, and after this the processor could only be waken up by an interrrupt or a restart by a host. The easiest way is to use "_sleep(0);" in your c code, like:
    int main(){
    //other procedures
    //need to set interrupt priority and interrupt enable bits
    _sleep(0);
    //other routines
    }
    This _sleep(0) won't change int level or enable. With a different value it will have effects on these control bits.
    Please let me know if you need more info, thanks.
    elliot
  • Hi elliotc,
    Yes, I'm running on an EMSK for EM processor.
    I mesured the current draw over USB while running an example application (the EMSK board is powerd only through USB).
    While the processor is busy with an exaustive computation task, the current is about 490mA.
    After the call of the _arc_sleep(0) instruction (and a cpu_lock() to ensure that the processor will not wake up for any interruption) the current drops to ~ 470mA.
    So, the processor is not the main power consumer in the EMSK. Is this correct? What is drawing this relatively large amount of current?
  • edited January 2016
    That's a good point! ARC is a low power processor so in actual Soc it consumes a small amout of energy, most of power consumptions are from bus transactions, clock toggles on memory, peripheral communications etc. To be frank I don't have detailed current/power values for all those EM configs on EMSK(power consumption depends on what the core is doing), and in chip design there're more accurate values from power simulations. But you did give us some ideas that might be helpful to show ARC's energy efficiency,even it's just on FPGAs.
    Did you measure the total current supply to EMSK,i.e measure at the power line? What's your configuration? Are peripherals working or hibernating? Maybe I could do some tests as yours if you could give me more instructions?
  • I am powering the EMSK board only with the USB cable (power supply is disconnected). I connected an ammeter to +5V USB wire to mesure the current flowing from computer to EMSK. So, the mentioned values (490mA while processing and 470mA at idle state) are the total current supply.
    I am using the EMSK v2.1, running my application with the ARC EM 7D image provided with the kit. There is no additional peripherals connected to the board.
    The application consists of a very simple search of prime numbers (only to stress the processor), followed by the _arc_sleep(0) and cpu_lock() instructions. I am using the FreeRTOS environment, and the application was build over the emsk_freertos_demo provided with embARC.
    While searching for prime numbers, the total current reaches ~ 490mA, then drops to ~470mA after _arc_sleep(0).
    Serial interface is connected during all time.

    #include "embARC.h"
    #include "embARC_debug.h"
    #include "stdio.h"
    #include "arc_builtin.h"

    int main(void)
    {
    uint32_t n, div;
    int isPrime;

    cpu_lock();
    board_init();
    os_hal_exc_init();
    cpu_unlock();

    //490mA while processing....
    for (n = 3; n < MAX_NUM; n = n + 2) {
    isPrime = 1;
    for (div = 2; div < n && isPrime; div++) {
    if (n % div == 0) isPrime = 0;
    }
    }

    //470mA while sleeping....
    cpu_lock();
    _arc_sleep(0);


    return 0;
    }
  • Hi rlino, was super busy these days:)That "_arc_sleep(0)" statement is indeed a "SLEEP" instruction, and _arc_sleep(0) equals "SLEEP 0", which changes not the STATUS register and puts the core into sleep mode (0)-a most basic sleep mode when core is sleep, timers and real time clocks are on. Internal ARC core is divided into several power domains and some are always on, some are powered off in sleep mode. Will get back to you with my test results, thanks.
  • Hi rlino, I got some specific notes about EMSK images. The core image on EMSK is built with clock enables, the clock tree is still toggling when core is in sleep mode, while in real processor clocks will be gated off, thus reducing power consumption. So the test on FPGA cannot reflect actual power saving features, making the test irrelevant. Hope this clears your questions about this current drop and please let me know when you have more questions, thanks.
  • Hi elliotc! Thank you very much.
    Do you have any information about power consumption on real EM processors?
  • Hi rlino, ARC processors are configurable which means with each different configuration the processor consists of various different components, and execution clocks would also incur varying power consumptions. It's often more advisable to take into consideration "power efficiency" instead of absolute power consumption in embeded processors. ARC EM processor typical configuration publishes a 1.81 DMPIS/MHz score for Dhrystone benchmark, power efficiency comes at as little as 2uw/MHz (28HPM typical). ARC processor provides maximum power and area efficiency (DMIPS/MHz, DMIPS/mm2) for embeded applications. Here's a link to get an overall view of ARC:
    https://www.synopsys.com/dw/doc.php/ds/cc/dw-processor-solutions.pdf
    Here's also a collection of papers/presenstations that were on show in last year's ARC Processor Summit, you could see slides from industry parterns and synopsys about real examples:
    http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/arc-processor-summit-2015.aspx
    You could also have access to EM processor via evaluation process after you register on the following link:
    https://www.synopsys.com/cgi-bin/dwarcem/reg1.cgi
    Hope all this could help, thanks.
  • Hello elliotc,
    This was very useful, thank you!
Sign In or Register to comment.