pulp-platform / hero-sdk

⛔ DEPRECATED ⛔ HERO Software Development Kit
https://www.pulp-platform.org/hero
Apache License 2.0
20 stars 6 forks source link

HERO Timers to `libhero-target` #38

Closed alessandrocapotondi closed 6 years ago

alessandrocapotondi commented 6 years ago

Dear @accuminium, I added some additional API to the libhero-target to control the PULP timers.

New API

/** Start the processor cycle counter.

    Start to commute the cycle counter. Note, at boot, the starting value is unpredictable because the counter is not automatically resetted during the `hero_rt_start_cycle_cnt` function. Reset must be manually controlled by the user. Following, the correct initialization sequence for the cycle counter:
hero_rt_reset_cycle_cnt();
hero_rt_start_cycle_cnt();
```

\return void. */ void hero_rt_start_cycle_cnt();

/** Reset the processor cycle counter.

Reset to 0 the processor cycle counter value.

\return void. */ void hero_rt_reset_cycle_cnt();

/** Stop the processor cycle counter.

Stop the processor cycle counter commutation. The cycle counter value can be readed using the function `hero_rt_get_cycles()`. The cycles counting can be resumed using the function `hero_rt_start_cycles_cnt()`.

Note. The counter value must be resetted manually by the user.

\return void. */ void hero_rt_stop_cycle_cnt();

/** Get the processor cycle counter value.

\return the current cycle counter value, or 0 if unavailable. */ int hero_rt_get_cycles();



*WIP: because i did not test it yet. I will let you know when we can merge it.*
alessandrocapotondi commented 6 years ago

@accuminium, I tested and now it is ready to merge.