Getting input and shell to actually be usable with TSIM2

Mohammed Khoory mkhoory at eiast.ae
Mon Feb 18 00:38:21 UTC 2013


Hi,

TSIM2-eval has a strange issue that occurs whenever RTEMS enters the IDLE
task. What basically happens is that the IDLE task puts the CPU into a low
power state, and that causes the simulator to go much faster than normal,
making it terminate in less than a second. This makes things like shells and
user input unusable. I just wanted to share my solution somewhere to this
issue, and wanted to know if anyone had any better solutions because this
one involves changing the RTEMS source itself.

In my case, I'm using the LEON3 BSP, but this also occurs for LEON2 and some
other CPUs. The IDLE task code for LEON3 is located at
c/src/lib/libbsp/sparc/leon3/startup/bspidle.S .. replace the "mov   %g0,
%asr19" line with a "nop", and recompile. It works now :) This makes the
simulator much more usable now, although because it still uses a 32bit
counter to count cycles, the code still only runs for around 40-50 seconds
(depending on your CPU).. but it's still much better than 2! The full
version has a 64-bit counter, which means it won't have this issue.. but
most people don't have that.

Initially I was trying to see if it was possible to actually replace the
IDLE task body with a user-defined function, as mentioned in the manual
using CONFIGURE_IDLE_TASK_BODY, but I couldn't get that to work for some
reason. 

If anyone has any better suggestions or improvements on this workaround let
me know.

Thanks,
Mohammed  Khoory




More information about the users mailing list