Renesas RL78 port

ChibiOS public support forum for topics related to the Renesas RL78 family of micro-controllers.

Moderators: lbednarz, DeusExMachina

lbednarz
Posts: 32
Joined: Sat Dec 18, 2010 11:36 am
Location: Poland

Re: Renesas RL78 port

Postby lbednarz » Sun Jan 12, 2014 8:08 pm

Just tested with -O3 optimization, results are a little better.

Code: Select all

*** ChibiOS/RT test suite
***
*** Kernel:       2.6.2
*** Compiled:     Jan 12 2014 - 19:57:51
*** Compiler:     GCC 4.8-GNURL78_v13.02 20131003 (MP1) (Red Hat/devo) [trunk revision 194496]
*** Architecture: RL78
*** Test Board:   Renesas YRPBRL78G13

----------------------------------------------------------------------------
--- Test Case 1.1 (Threads, enqueuing test #1)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.2 (Threads, enqueuing test #2)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.3 (Threads, priority change)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.4 (Threads, delays)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.1 (Semaphores, enqueuing)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.2 (Semaphores, timeout)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.3 (Semaphores, atomic signal-wait)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.4 (Binary Semaphores, functionality)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.1 (Mutexes, priority enqueuing test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.2 (Mutexes, priority inheritance, simple case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.3 (Mutexes, priority inheritance, complex case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.4 (Mutexes, priority return)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.5 (Mutexes, status)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.6 (CondVar, signal test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.7 (CondVar, broadcast test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.8 (CondVar, boost test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.1 (Messages, loop)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 5.1 (Mailboxes, queuing and timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.1 (Events, registration and dispatch)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.2 (Events, wait and broadcast)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.3 (Events, timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.1 (Queues, input queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.2 (Queues, output queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 21876 msgs/S, 43752 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 1915 msgs/S, 3830 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 1915 msgs/S, 3830 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 296448 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 55103 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 75783 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)
--- Score : 22676 reschedules/S, 136056 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 167700 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 211644 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 224684 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 418428 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 252712 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)
--- System: 310 bytes
--- Thread: 36 bytes
--- Timer : 10 bytes
--- Semaph: 6 bytes
--- EventS: 2 bytes
--- EventL: 6 bytes
--- Mutex : 8 bytes
--- CondV.: 4 bytes
--- Queue : 18 bytes
--- MailB.: 20 bytes
--- Result: SUCCESS
----------------------------------------------------------------------------

Final result: SUCCESS

User avatar
Giovanni
Site Admin
Posts: 11386
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 430 times
Been thanked: 363 times
Contact:

Re: Renesas RL78 port

Postby Giovanni » Sun Jan 12, 2014 8:22 pm

Uhm, the strange results have something in common, the thread is created at higher priority, the only thing I can think is that the compiler bug is triggered in chThdWakeupS(), in that function there are two code paths depending if the target thread is at a lower or higher priority.

Could you try with low optimizations and by setting CH_OPTIMIZE_SPEED to FALSE? (disables enforced inlining)

Giovanni

lbednarz
Posts: 32
Joined: Sat Dec 18, 2010 11:36 am
Location: Poland

Re: Renesas RL78 port

Postby lbednarz » Sun Jan 12, 2014 8:33 pm

Good suggestions Giovanni :)
With -O2 and CH_OPTIMIZE_SPEED to FALSE results are:

Code: Select all

*** ChibiOS/RT test suite
***
*** Kernel:       2.6.2
*** Compiled:     Jan 12 2014 - 20:28:53
*** Compiler:     GCC 4.8-GNURL78_v13.02 20131003 (MP1) (Red Hat/devo) [trunk revision 194496]
*** Architecture: RL78
*** Test Board:   Renesas YRPBRL78G13

----------------------------------------------------------------------------
--- Test Case 1.1 (Threads, enqueuing test #1)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.2 (Threads, enqueuing test #2)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.3 (Threads, priority change)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.4 (Threads, delays)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.1 (Semaphores, enqueuing)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.2 (Semaphores, timeout)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.3 (Semaphores, atomic signal-wait)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.4 (Binary Semaphores, functionality)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.1 (Mutexes, priority enqueuing test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.2 (Mutexes, priority inheritance, simple case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.3 (Mutexes, priority inheritance, complex case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.4 (Mutexes, priority return)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.5 (Mutexes, status)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.6 (CondVar, signal test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.7 (CondVar, broadcast test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.8 (CondVar, boost test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.1 (Messages, loop)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 5.1 (Mailboxes, queuing and timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.1 (Events, registration and dispatch)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.2 (Events, wait and broadcast)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.3 (Events, timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.1 (Queues, input queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.2 (Queues, output queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 13242 msgs/S, 26484 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 61711 msgs/S, 123422 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 61711 msgs/S, 123422 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 287112 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 49160 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 70742 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)
--- Score : 18712 reschedules/S, 112272 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 165100 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 221948 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 224682 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 353516 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 254732 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)
--- System: 310 bytes
--- Thread: 36 bytes
--- Timer : 10 bytes
--- Semaph: 6 bytes
--- EventS: 2 bytes
--- EventL: 6 bytes
--- Mutex : 8 bytes
--- CondV.: 4 bytes
--- Queue : 18 bytes
--- MailB.: 20 bytes
--- Result: SUCCESS
----------------------------------------------------------------------------

Final result: SUCCESS


So a bug seems to be compiler related.

User avatar
Giovanni
Site Admin
Posts: 11386
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 430 times
Been thanked: 363 times
Contact:

Re: Renesas RL78 port

Postby Giovanni » Sun Jan 12, 2014 8:36 pm

Uhm yes, related to inlining apparently.

What is the operating frequency?

giovanni

lbednarz
Posts: 32
Joined: Sat Dec 18, 2010 11:36 am
Location: Poland

Re: Renesas RL78 port

Postby lbednarz » Sun Jan 12, 2014 8:46 pm

Clock is at 32MHz.

User avatar
Giovanni
Site Admin
Posts: 11386
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 430 times
Been thanked: 363 times
Contact:

Re: Renesas RL78 port

Postby Giovanni » Sun Jan 12, 2014 9:20 pm

Very good scores for an 8 bits.

Giovanni

lbednarz
Posts: 32
Joined: Sat Dec 18, 2010 11:36 am
Location: Poland

Re: Renesas RL78 port

Postby lbednarz » Sun Jan 12, 2014 9:44 pm

It is 16-bit.

lbednarz
Posts: 32
Joined: Sat Dec 18, 2010 11:36 am
Location: Poland

Re: Renesas RL78 port

Postby lbednarz » Sun Jan 12, 2014 11:22 pm

Sources are available at http://svn.code.sf.net/p/chibios/svn/branches/rl78_dev.

Notes:
- tick timer is hardcoded at 1KHz
- serial driver works only in tx mode at the moment, rx part is not implemented yet
- only UART1 (SD2) is available with hardcoded 8N1 9600bps at 32MHz cpu clock
- there are no makefiles, just Code::Blocks demo project
- GCC toolchain is at http://www.kpitgnutools.com

lb

User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: Renesas RL78 port

Postby DeusExMachina » Mon Jan 13, 2014 12:33 am

looks great! SUCCESS at the end of testing looks encouraging :)

User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: Renesas RL78 port

Postby DeusExMachina » Fri Feb 07, 2014 6:17 am

lbednarz, how you debug your project in C::B? I is interesting to use onboard debugger in Eclipse or Codeblocks.


Return to “RL78 Support”

Who is online

Users browsing this forum: No registered users and 1 guest