SIS RT Clockspeed

Is there a way control the simulator speed. out of the box rtems erc32 bsp reports 100 ticks per second and a the simulator completes 1000 ticks in less than a second.

I assume that what you see is related to the CLOCK_DRIVER_USE_FAST_IDLE BSP option. That option increases the clock speed while the IDLE thread is executing. See the description here:

https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/main/spec/build/bsps/optclkfastidle.yml#L28

To avoid that behavior: Set CLOCK_DRIVER_USE_FAST_IDLE = False in the config.ini when compiling the BSP.

Best regards

Christian

1 Like

That feels right, but I need another push. And some tips for using RSB.

so from my newbie understanding:

  • config.ini are used by waf
  • bsp are built by RSB (which use waf under the hood)

So I tried re-running to rebuild the BSP:

source-builder/sb-set-builder --prefix=$PREFIX --target=sparc-rtems6 --with-rtems-bsp=sparc/erc32 6/rtems-kernel --no-clean

I used --no-clean so that could inspect the rtem source within the build folder.

in the build/rtems-kernel-bsps-1 i found a RTEMS repo, waf, and config.ini.

I added the CLOCK_DRIVER_USE_FAST_IDLE = False there and tried reconfigureing waf, but get and unknown option error

Setting top to                           : /home/hpfeiffer/work/rtems/standlone/build/rtems-kernel-bsps-1/rtems-kernel-bsps-1-6335d7e48a692e4c4fe0577b6bba44ff0f64aefc/rtems-6335d7e48a692e4c4fe0577b6bba44ff0f64aefc
Setting out to                           : /home/hpfeiffer/work/rtems/standlone/build/rtems-kernel-bsps-1/rtems-kernel-bsps-1-6335d7e48a692e4c4fe0577b6bba44ff0f64aefc/rtems-6335d7e48a692e4c4fe0577b6bba44ff0f64aefc/build
Configure RTEMS version                  : 6.0.f4a015b62af9d9b6a11a844317d43e43cd897e9e
Configure board support package (BSP)    : sparc/erc32
Checking for program 'sparc-rtems6-gcc'  : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-gcc
Checking for program 'sparc-rtems6-g++'  : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-g++
Checking for program 'sparc-rtems6-ar'   : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ar
Checking for program 'sparc-rtems6-ld'   : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ld
Checking for program 'ar'                : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ar
Checking for program 'g++, c++'          : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-g++
Checking for program 'ar'                : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ar
Checking for program 'gas, gcc'          : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-gcc
Checking for program 'ar'                : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ar
Checking for program 'gcc, cc'           : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-gcc
Checking for program 'ar'                : /home/hpfeiffer/work/rtems/standlone/rtems_prefix/bin/sparc-rtems6-ar
Checking for asm flags '-MMD'            : yes
Checking for c flags '-MMD'              : yes
Checking for cxx flags '-MMD'            : yes
Unknown configuration option             : CLOCK_DRIVER_USE_FAST_IDLE
'configure' finished successfully (0.207s)

Do I have the right mental model, or am I looking in the wrong place?
Is there a better way to use RSB?

After using --no-clean, you must remove the build directory to ensure that the leftover files do not conflict with additional builds. To provide your own config.ini in a RSB build, you can add the command line option: --with-rtems-bsp-config=/path/to/your/custom/config.ini.

1 Like

RSB will always replace contents of the build directory when starting up to ensure reproducible builds, so telling it not to clean and then placing your own files in the build directory will only break the build and not incorporate your changes.

Thanks, that flag is way better than the hacky thing i was doing.

I’m still getting waf configure complaining that

Unknown configuration option             : CLOCK_DRIVER_USE_FAST_IDLE 

but now within the RSB log.

my understanding of RTEMS work flow from reading quick start is:

  • subrepo in RSB
  • RSB build tool set
    • source-builder/sb-set-builder --prefix=$PREFIX 6/rtems-sparc
  • RSB build BSP and Kernel
    • source-builder/sb-set-builder --prefix=$PREFIX --target=sparc-rtems6 --with-rtems-bsp-config=$PWD/config.ini 6/rtems-kernel
  • write application code
  • write wscript
  • waf configure
    • ./waf configure --rtems=$PREFIX --rtems-tools=$PREFIX --rtems-bsp=sparc/erc32
  • waf build
    • ./waf
  • test with sim
    • ./rtems_prefix/bin/rtems-run --rtems-bsp=erc32-sis build/sparc-rtems6-erc32/3task_sleep_demo.exe

I have a single config.ini sitting at top of project:

[DEFAULT]
RTEMS_POSIX_API = True
RTEMS_SMP = False
BUILD_TESTS = False
BUILD_SAMPLES = True

[sparc/erc32]
CLOCK_DRIVER_USE_FAST_IDLE = False

Im on RTEMS 6.2 tag.

Another general question is where do i go to find the available config.ini options?

You can execute a ./waf bspdefaults > defaults.ini in the RTEMS repository. This will generate defaults for all BSPs. Or you can filter that output for one BSP with ./waf bspdefaults --rtems-bsps=sparc/erc32 > defaults_erc32.ini

1 Like

Ok I have things working.

with that list defaults command @c-mauderer mentioned I found that the
CLOCK_DRIVER_USE_FAST_IDLE = False flag was not available for erc32.

So instead I rebuilt for arm/xilinx_zynq_a9_qemu.

At first I was confused that the simulator was not running, but realized RSB does not build qemu.

The readme in that bsp’s folder is a bit outdated. The qemu repo address is broken and the referenced commit builds using python2 which was surprisingly difficult to install on current ubuntu. Instead I apt installed packages
qemu-system-arm qemu-utils

Simulation then worked with Real time-ish behavior.

Thank you again everyone for your help.

The readmes in the BSPs are outdated. Usually, they are still there when they haven’t been converted to the user manual yet. For example, for the Zynq, everything should be here:

If you find something outdated, it would be great to add a patch to the manual to update it. Thanks.