Re: Optimization issue in RISC-V BSP

2017-08-02 Thread Hesham Almatary
Looks like it works fine for me. Congratulations! I wonder how feasible it will be if you tried again with sample ticker (instead of low memory one). On Wed, Aug 2, 2017 at 6:54 PM, Denis Obrezkov wrote: >> > + Special registers >> Yes, this might be the issue, specifically if the port is using

Re: Optimization issue in RISC-V BSP

2017-08-02 Thread Gedare Bloom
On Wed, Aug 2, 2017 at 4:54 AM, Denis Obrezkov wrote: >> > + Special registers >> Yes, this might be the issue, specifically if the port is using >> interrupts. For example, mstatus/mcause/mepc might need to be saved >> and/or reset. >> >> What I'm suspicious of is that the trap_entry code is the

Re: Optimization issue in RISC-V BSP

2017-08-02 Thread Denis Obrezkov
> > > + Special registers > Yes, this might be the issue, specifically if the port is using > interrupts. For example, mstatus/mcause/mepc might need to be saved > and/or reset. > > What I'm suspicious of is that the trap_entry code is the problem, > since it didn't have a chance to get executed/te

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Hesham Almatary
On Tue, Aug 1, 2017 at 2:15 PM, Joel Sherrill wrote: > > > On Jul 31, 2017 10:54 PM, "Hesham Almatary" > wrote: > > On Tue, Aug 1, 2017 at 10:13 AM, Denis Obrezkov > wrote: >> 2017-08-01 2:01 GMT+02:00 Hesham Almatary : >>> >>> Hi Denis, >>> >>> If you're not using interrupts (i.e. only using du

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Joel Sherrill
On Jul 31, 2017 10:54 PM, "Hesham Almatary" wrote: On Tue, Aug 1, 2017 at 10:13 AM, Denis Obrezkov wrote: > 2017-08-01 2:01 GMT+02:00 Hesham Almatary : >> >> Hi Denis, >> >> If you're not using interrupts (i.e. only using dummy clock), then >> trap_entry at start.S shouldn't be executed after bo

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Hesham Almatary
On Tue, Aug 1, 2017 at 10:13 AM, Denis Obrezkov wrote: > 2017-08-01 2:01 GMT+02:00 Hesham Almatary : >> >> Hi Denis, >> >> If you're not using interrupts (i.e. only using dummy clock), then >> trap_entry at start.S shouldn't be executed after bootstrap. That's >> why I suggested you use dummy cloc

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Denis Obrezkov
2017-08-01 2:01 GMT+02:00 Hesham Almatary : > Hi Denis, > > If you're not using interrupts (i.e. only using dummy clock), then > trap_entry at start.S shouldn't be executed after bootstrap. That's > why I suggested you use dummy clock first to figure out if the problem > is with the context switch

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Hesham Almatary
Hi Denis, If you're not using interrupts (i.e. only using dummy clock), then trap_entry at start.S shouldn't be executed after bootstrap. That's why I suggested you use dummy clock first to figure out if the problem is with the context switch code or not. I'm not getting the full context/details;

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Denis Obrezkov
2017-07-31 11:56 GMT+02:00 Denis Obrezkov : > 2017-07-31 1:08 GMT+02:00 Hesham Almatary : > >> On Mon, Jul 31, 2017 at 5:03 AM, Denis Obrezkov >> wrote: >> > 2017-07-30 20:40 GMT+02:00 Joel Sherrill : >> >> >> >> >> >> >> >> On Jul 30, 2017 12:19 PM, "Denis Obrezkov" >> >> wrote: >> >> >> >> 201

Re: Optimization issue in RISC-V BSP

2017-07-31 Thread Denis Obrezkov
2017-07-31 1:08 GMT+02:00 Hesham Almatary : > On Mon, Jul 31, 2017 at 5:03 AM, Denis Obrezkov > wrote: > > 2017-07-30 20:40 GMT+02:00 Joel Sherrill : > >> > >> > >> > >> On Jul 30, 2017 12:19 PM, "Denis Obrezkov" > >> wrote: > >> > >> 2017-07-30 3:10 GMT+02:00 Joel Sherrill : > >>> > >>> > >>> >

Re: Optimization issue in RISC-V BSP

2017-07-30 Thread Hesham Almatary
On Mon, Jul 31, 2017 at 5:03 AM, Denis Obrezkov wrote: > 2017-07-30 20:40 GMT+02:00 Joel Sherrill : >> >> >> >> On Jul 30, 2017 12:19 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-30 3:10 GMT+02:00 Joel Sherrill : >>> >>> >>> >>> On Jul 29, 2017 8:02 PM, "Denis Obrezkov" >>> wrote: >>> >>> >>> >>

Re: Optimization issue in RISC-V BSP

2017-07-30 Thread Denis Obrezkov
2017-07-30 20:40 GMT+02:00 Joel Sherrill : > > > On Jul 30, 2017 12:19 PM, "Denis Obrezkov" > wrote: > > 2017-07-30 3:10 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 29, 2017 8:02 PM, "Denis Obrezkov" >> wrote: >> >> >> >> 2017-07-30 2:34 GMT+02:00 Joel Sherrill : >> >>> >>> Sorry to top post but

Re: Optimization issue in RISC-V BSP

2017-07-30 Thread Joel Sherrill
On Jul 30, 2017 12:19 PM, "Denis Obrezkov" wrote: 2017-07-30 3:10 GMT+02:00 Joel Sherrill : > > > On Jul 29, 2017 8:02 PM, "Denis Obrezkov" wrote: > > > > 2017-07-30 2:34 GMT+02:00 Joel Sherrill : > >> >> Sorry to top post but this thread is very deep to answer on a phone. >> >> Try looking at

Re: Optimization issue in RISC-V BSP

2017-07-30 Thread Denis Obrezkov
2017-07-30 3:10 GMT+02:00 Joel Sherrill : > > > On Jul 29, 2017 8:02 PM, "Denis Obrezkov" wrote: > > > > 2017-07-30 2:34 GMT+02:00 Joel Sherrill : > >> >> Sorry to top post but this thread is very deep to answer on a phone. >> >> Try looking at the same code on the erc32 bsp and see how it is don

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Joel Sherrill
On Jul 29, 2017 8:02 PM, "Denis Obrezkov" wrote: 2017-07-30 2:34 GMT+02:00 Joel Sherrill : > > Sorry to top post but this thread is very deep to answer on a phone. > > Try looking at the same code on the erc32 bsp and see how it is done. > > Also you could disable the atexit() call and see how

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Denis Obrezkov
2017-07-30 2:34 GMT+02:00 Joel Sherrill : > > Sorry to top post but this thread is very deep to answer on a phone. > > Try looking at the same code on the erc32 bsp and see how it is done. > > Also you could disable the atexit() call and see how.much further you get. > > > Ok, I will look at erc32

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Joel Sherrill
Sorry to top post but this thread is very deep to answer on a phone. Try looking at the same code on the erc32 bsp and see how it is done. Also you could disable the atexit() call and see how.much further you get. On Jul 29, 2017 7:03 PM, "Denis Obrezkov" wrote: 2017-07-30 1:35 GMT+02:00 Denis

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Denis Obrezkov
2017-07-30 1:35 GMT+02:00 Denis Obrezkov : > 2017-07-29 19:14 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 29, 2017 4:04 AM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 3:45 GMT+02:00 Joel Sherrill : >> >>> >>> >>> On Jul 28, 2017 7:11 PM, "Denis Obrezkov" >>> wrote: >>> >>> 2017-07-29 1:41 GMT+0

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Denis Obrezkov
2017-07-29 19:14 GMT+02:00 Joel Sherrill : > > > On Jul 29, 2017 4:04 AM, "Denis Obrezkov" wrote: > > 2017-07-29 3:45 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 7:11 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 1:41 GMT+02:00 Joel Sherrill : >> >>> >>> >>> On Jul 28, 2017 6:39 PM, "

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Joel Sherrill
On Jul 29, 2017 4:04 AM, "Denis Obrezkov" wrote: 2017-07-29 3:45 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 7:11 PM, "Denis Obrezkov" wrote: > > 2017-07-29 1:41 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 6:39 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 1:28 GMT+02:00 Joel Sh

Re: Optimization issue in RISC-V BSP

2017-07-29 Thread Denis Obrezkov
2017-07-29 3:45 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 7:11 PM, "Denis Obrezkov" wrote: > > 2017-07-29 1:41 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 6:39 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 1:28 GMT+02:00 Joel Sherrill : >> >>> >>> >>> On Jul 28, 2017 6:14 PM, "D

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Jul 28, 2017 7:11 PM, "Denis Obrezkov" wrote: 2017-07-29 1:41 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 6:39 PM, "Denis Obrezkov" wrote: > > 2017-07-29 1:28 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 6:14 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 0:57 GMT+02:00 Joel Sh

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-29 1:41 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 6:39 PM, "Denis Obrezkov" wrote: > > 2017-07-29 1:28 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 6:14 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-29 0:57 GMT+02:00 Joel Sherrill : >> >>> >>> >>> On Jul 28, 2017 5:55 PM, "D

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Jul 28, 2017 6:39 PM, "Denis Obrezkov" wrote: 2017-07-29 1:28 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 6:14 PM, "Denis Obrezkov" wrote: > > 2017-07-29 0:57 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 5:55 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-28 22:36 GMT+02:00 Joel S

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-29 1:28 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 6:14 PM, "Denis Obrezkov" wrote: > > 2017-07-29 0:57 GMT+02:00 Joel Sherrill : > >> >> >> On Jul 28, 2017 5:55 PM, "Denis Obrezkov" >> wrote: >> >> 2017-07-28 22:36 GMT+02:00 Joel Sherrill : >> >>> Can you check the memory immediate

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Jul 28, 2017 6:14 PM, "Denis Obrezkov" wrote: 2017-07-29 0:57 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 5:55 PM, "Denis Obrezkov" wrote: > > 2017-07-28 22:36 GMT+02:00 Joel Sherrill : > >> Can you check the memory immediately after a download'? >> >> Then after the loop that copies ini

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-29 0:57 GMT+02:00 Joel Sherrill : > > > On Jul 28, 2017 5:55 PM, "Denis Obrezkov" wrote: > > 2017-07-28 22:36 GMT+02:00 Joel Sherrill : > >> Can you check the memory immediately after a download'? >> >> Then after the loop that copies initialized data into place? >> >> I suspect something

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Jul 28, 2017 5:55 PM, "Denis Obrezkov" wrote: 2017-07-28 22:36 GMT+02:00 Joel Sherrill : > Can you check the memory immediately after a download'? > > Then after the loop that copies initialized data into place? > > I suspect something off there. Could be a linker script issue or the > copy g

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 22:36 GMT+02:00 Joel Sherrill : > Can you check the memory immediately after a download'? > > Then after the loop that copies initialized data into place? > > I suspect something off there. Could be a linker script issue or the > copy gone crazy. > > --joel > > On Fri, Jul 28, 2017 at 3

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
Can you check the memory immediately after a download'? Then after the loop that copies initialized data into place? I suspect something off there. Could be a linker script issue or the copy gone crazy. --joel On Fri, Jul 28, 2017 at 3:20 PM, Denis Obrezkov wrote: > 2017-07-28 22:16 GMT+02:00

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 22:16 GMT+02:00 Joel Sherrill : > > > On Fri, Jul 28, 2017 at 2:50 PM, Denis Obrezkov > wrote: > >> I can see that during task initialization I have a call: _Thread_Initialize_information (information=information@entry=0x8ad4 <_RTEMS_tasks_Information>, the_api=the_

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Fri, Jul 28, 2017 at 2:50 PM, Denis Obrezkov wrote: > >>> I can see that during task initialization I have a call: >>> _Thread_Initialize_information (information=information@entry=0x8ad4 >>> <_RTEMS_tasks_Information>, the_api=the_api@entry=OBJECTS_CLASSIC_API, >>> the_class=the_class@en

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
> > >> I can see that during task initialization I have a call: >> _Thread_Initialize_information (information=information@entry=0x8ad4 >> <_RTEMS_tasks_Information>, the_api=the_api@entry=OBJECTS_CLASSIC_API, >> the_class=the_class@entry=1, maximum=124, >> is_string=is_string@entry=false,

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Fri, Jul 28, 2017 at 10:31 AM, Denis Obrezkov wrote: > 2017-07-28 17:05 GMT+02:00 Joel Sherrill : > >> >> >> On Fri, Jul 28, 2017 at 9:23 AM, Denis Obrezkov >> wrote: >> >>> 2017-07-28 15:19 GMT+02:00 Sebastian Huber < >>> sebastian.hu...@embedded-brains.de>: >>> On 28/07/17 15:15, Denis

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 17:31 GMT+02:00 Denis Obrezkov : > 2017-07-28 17:05 GMT+02:00 Joel Sherrill : > >> >> >> On Fri, Jul 28, 2017 at 9:23 AM, Denis Obrezkov >> wrote: >> >>> 2017-07-28 15:19 GMT+02:00 Sebastian Huber < >>> sebastian.hu...@embedded-brains.de>: >>> On 28/07/17 15:15, Denis Obrezkov wro

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Gedare Bloom
On Fri, Jul 28, 2017 at 11:05 AM, Joel Sherrill wrote: > > > On Fri, Jul 28, 2017 at 9:23 AM, Denis Obrezkov > wrote: >> >> 2017-07-28 15:19 GMT+02:00 Sebastian Huber >> : >>> >>> On 28/07/17 15:15, Denis Obrezkov wrote: >>> 2017-07-28 14:56 GMT+02:00 Joel Sherrill >>>

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 17:05 GMT+02:00 Joel Sherrill : > > > On Fri, Jul 28, 2017 at 9:23 AM, Denis Obrezkov > wrote: > >> 2017-07-28 15:19 GMT+02:00 Sebastian Huber > ns.de>: >> >>> On 28/07/17 15:15, Denis Obrezkov wrote: >>> >>> 2017-07-28 14:56 GMT+02:00 Joel Sherrill >>> j...@rtems.org>>:

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Fri, Jul 28, 2017 at 9:23 AM, Denis Obrezkov wrote: > 2017-07-28 15:19 GMT+02:00 Sebastian Huber brains.de>: > >> On 28/07/17 15:15, Denis Obrezkov wrote: >> >> 2017-07-28 14:56 GMT+02:00 Joel Sherrill >> j...@rtems.org>>: >>> >>> There is a debug option near the bottom of confdefs.h whic

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 15:19 GMT+02:00 Sebastian Huber < sebastian.hu...@embedded-brains.de>: > On 28/07/17 15:15, Denis Obrezkov wrote: > > 2017-07-28 14:56 GMT+02:00 Joel Sherrill > j...@rtems.org>>: >> >> There is a debug option near the bottom of confdefs.h which you >> can enable to generate a da

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Joel Sherrill
On Fri, Jul 28, 2017 at 8:19 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 28/07/17 15:15, Denis Obrezkov wrote: > > 2017-07-28 14:56 GMT+02:00 Joel Sherrill > j...@rtems.org>>: >> >> There is a debug option near the bottom of confdefs.h which you >> can enable to g

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Sebastian Huber
On 28/07/17 15:15, Denis Obrezkov wrote: 2017-07-28 14:56 GMT+02:00 Joel Sherrill >: There is a debug option near the bottom of confdefs.h which you can enable to generate a data structure filled in with various values computed by confdefs. You can look at tha

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 14:56 GMT+02:00 Joel Sherrill : > There is a debug option near the bottom of confdefs.h which you can enable > to generate a data structure filled in with various values computed by > confdefs. You can look at that in gdb without loading it on the target. > > It is probably worth it to

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Denis Obrezkov
2017-07-28 13:11 GMT+02:00 Gedare Bloom : > On Thu, Jul 27, 2017 at 7:43 PM, Denis Obrezkov > wrote: > > I didn't want to enable optimization because I was afraid of new > mistakes. > > So, I enabled -Os and now I have: > > _Terminate (the_source=the_source@entry=INTERNAL_ERROR_CORE, > > the_erro

Re: Optimization issue in RISC-V BSP

2017-07-28 Thread Gedare Bloom
On Thu, Jul 27, 2017 at 7:43 PM, Denis Obrezkov wrote: > I didn't want to enable optimization because I was afraid of new mistakes. > So, I enabled -Os and now I have: > _Terminate (the_source=the_source@entry=INTERNAL_ERROR_CORE, > the_error=the_error@entry=3) > at > /home/reprofy/Projects/ri

Optimization issue in RISC-V BSP

2017-07-27 Thread Denis Obrezkov
I didn't want to enable optimization because I was afraid of new mistakes. So, I enabled -Os and now I have: _Terminate (the_source=the_source@entry=INTERNAL_ERROR_CORE, the_error=the_error@entry=3) at /home/reprofy/Projects/riscv/rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/sc