Re: Qemu for TC377

2024-04-24 Thread Sameer Kalliadan Poyil
Hi Bastian,

Thanks a lot. I have downloaded HighTec IDE from (
https://free-entry-toolchain.hightec-rt.com/) and tried to run the TSIM but
no success. In web, I don't see any documentation how to run it. The doc
comes along with tsim doesn't explain how to start the simulator. Could you
let me know how to start tsim for a helloworld.elf for TC3xx ? is there a
Menu in highTec IDE to start it ?  I believe it is a cmd
tool(C:\HIGHTEC\toolchains\tricore\v4.9.3.0-infineon-1.0\bin\tsim)

Regards
Sameer

On Sun, Apr 21, 2024 at 6:18 AM Bastian Koppelmann <
kbast...@mail.uni-paderborn.de> wrote:

> Hi Sameer,
>
> On Tue, Apr 16, 2024 at 02:26:10PM -0400, Sameer Kalliadan Poyil wrote:
> > Hi Bastian,
> >
> > Thanks for the information. I thought that I can do some prototyping
> before the
> > HW arrives. :)
> >
> >  Yes I am interested for your bare metal program boot_to_main run it on
> TSIM.
> > Is Infineon TSIM free? I searched it and I didn't find any download
> link. Could
> > you please give a link for that if it is from Infineon?
>
> I usually get it from the free entry toolchain [1]
>
> >
> > s it(TSIM)  trace32 simulator ?
> https://repo.lauterbach.com/download_demo.html
> > ?
> >
> > This page https://wiki.qemu.org/Documentation/Platforms/TriCore shows
> SCU is
> > under development.
>
> I should change that on the wiki. I was experimenting with a QEMU model
> for the
> SCU when I was still in University, but nothing usable resulted from that.
> Now
> my time for such developments is unfortunately limited :(.
>
> >
> > Could you let me know who is developing it ? is  it possible to take an
> > existing SCU and modify according to AURIX data sheet? I see that UART is
> > possible to for Tricore like the one developed for ARM versatile platform
> >
> > Here is the link
> https://mail.gnu.org/archive/html/qemu-devel/2016-10/msg04514.html
>
> Sure, you can add a model of the Aurix UART in QEMU. It's "just" a matter
> of
> putting in the time to implement its registers and functionality.
>
> >
> > I have aurix development trial version and able to compile a UART
> project using
> > Tasking compiler and tried to run it on qemu, but I don't see any logs
> in the
> > qemu terminal as you said there is no peripherals implemented
> >
> > qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc27x -m 6M
> -nographic
> > -kernel ASCLIN_Shell_UART_1_KIT_TC277_TFT.elf  -serial stdio -append
> "console=
> > ttyAMA0 console=ttyS0"
>
> I usually add '-d exec,cpu,nochain -D /tmp/exec.log -accel
> tcg,one-insn-per-tb=on'
> to get an execution trace to see if the binary is executing.
>
> You can also try attaching gdb by adding '-s -S' to the CLI. And then run
> in
> tricore-gdb 'target remote localhost:1234' see [2]
>
> >
> >
> > Also do you know if there is a virtual UART framework to communicate
> between
> > two Qemu instances or two TSIM instances running similar OS or different
> OS? I
> > need to do prototype testing RPMSg communication between  MCU and SOC
> using
> > external physical UART/SPI which can be tested using vritual UART using
> two
> > qemu instances.
>
> No, I don't know of something like this.
>
> Cheers,
> Bastian
>
> [1] https://free-entry-toolchain.hightec-rt.com/
> [2] https://www.qemu.org/docs/master/system/gdb.html
>


Re: Qemu for TC377

2024-04-21 Thread Bastian Koppelmann
Hi Sameer,

On Tue, Apr 16, 2024 at 02:26:10PM -0400, Sameer Kalliadan Poyil wrote:
> Hi Bastian,
>
> Thanks for the information. I thought that I can do some prototyping before 
> the
> HW arrives. :)
>
>  Yes I am interested for your bare metal program boot_to_main run it on TSIM. 
>  
> Is Infineon TSIM free? I searched it and I didn't find any download link. 
> Could
> you please give a link for that if it is from Infineon?

I usually get it from the free entry toolchain [1]

>
> s it(TSIM)  trace32 simulator ? https://repo.lauterbach.com/download_demo.html
> ?
>
> This page https://wiki.qemu.org/Documentation/Platforms/TriCore shows SCU is
> under development.

I should change that on the wiki. I was experimenting with a QEMU model for the
SCU when I was still in University, but nothing usable resulted from that. Now
my time for such developments is unfortunately limited :(.

>
> Could you let me know who is developing it ? is  it possible to take an
> existing SCU and modify according to AURIX data sheet? I see that UART is
> possible to for Tricore like the one developed for ARM versatile platform
>
> Here is the link 
> https://mail.gnu.org/archive/html/qemu-devel/2016-10/msg04514.html

Sure, you can add a model of the Aurix UART in QEMU. It's "just" a matter of
putting in the time to implement its registers and functionality.

>
> I have aurix development trial version and able to compile a UART project 
> using
> Tasking compiler and tried to run it on qemu, but I don't see any logs in the
> qemu terminal as you said there is no peripherals implemented
>
> qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc27x -m 6M -nographic
> -kernel ASCLIN_Shell_UART_1_KIT_TC277_TFT.elf  -serial stdio -append "console=
> ttyAMA0 console=ttyS0"

I usually add '-d exec,cpu,nochain -D /tmp/exec.log -accel 
tcg,one-insn-per-tb=on'
to get an execution trace to see if the binary is executing.

You can also try attaching gdb by adding '-s -S' to the CLI. And then run in
tricore-gdb 'target remote localhost:1234' see [2]

>
>
> Also do you know if there is a virtual UART framework to communicate between
> two Qemu instances or two TSIM instances running similar OS or different OS? I
> need to do prototype testing RPMSg communication between  MCU and SOC using
> external physical UART/SPI which can be tested using vritual UART using two
> qemu instances. 

No, I don't know of something like this.

Cheers,
Bastian

[1] https://free-entry-toolchain.hightec-rt.com/
[2] https://www.qemu.org/docs/master/system/gdb.html



Re: Qemu for TC377

2024-04-16 Thread Sameer Kalliadan Poyil
Hi Bastian,

Thanks for the information. I thought that I can do some prototyping before
the HW arrives. :)

 Yes I am interested for your bare metal program boot_to_main run it on
TSIM.
Is Infineon TSIM free? I searched it and I didn't find any download link.
Could you please give a link for that if it is from Infineon?

s it(TSIM)  trace32 simulator ? *https://repo.lauterbach.com/download_demo.html
<https://repo.lauterbach.com/download_demo.html> *?

This page *https://wiki.qemu.org/Documentation/Platforms/TriCore
<https://wiki.qemu.org/Documentation/Platforms/TriCore>* shows SCU is under
development.

Could you let me know who is developing it ? is  it possible to take an
existing SCU and modify according to AURIX data sheet? I see that UART is
possible to for Tricore like the one developed for ARM versatile platform

Here is the link
*https://mail.gnu.org/archive/html/qemu-devel/2016-10/msg04514.htm
<https://mail.gnu.org/archive/html/qemu-devel/2016-10/msg04514.htm>*l

I have aurix development trial version and able to compile a UART
project using Tasking compiler and tried to run it on qemu, but I don't see
any logs in the qemu terminal as you said there is no peripherals
implemented

qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc27x -m 6M
-nographic -kernel ASCLIN_Shell_UART_1_KIT_TC277_TFT.elf  -serial stdio
-append "console=ttyAMA0 console=ttyS0"


Also do you know if there is a virtual UART framework to communicate
between two Qemu instances or two TSIM instances running similar OS or
different OS? I need to do prototype testing RPMSg communication between
MCU and SOC using external physical UART/SPI which can be tested using
vritual UART using two qemu instances.



Regards,
Sameer

On Mon, Apr 15, 2024 at 7:51 AM Bastian Koppelmann <
kbast...@mail.uni-paderborn.de> wrote:

> Hi Sameer,
> On Sun, Apr 14, 2024 at 06:15:56PM +0200, Philippe Mathieu-Daudé wrote:
> > Hi Sameer,
> >
> > On 13/4/24 14:52, Sameer Kalliadan Poyil wrote:
> > > Hello All,
> > > I see that Latest qemu supports for tricore TC277 and TC377
> > > image.png
> > > But when I downloaded source code and checked for TC377 related file ,
> I
> > > didn't find anything
> > >
> > > I want to run RTOS/bare metal code on TC377 . could you please let me
> > > know how to start qemu on TC377 ?
> > > Here is the latest version of qemu i have , I didn't download 9.0
> >
> > $ qemu-system-tricore -cpu help
> > Available CPUs:
> >   tc1796
> >   tc1797
> >   tc27x
> >   tc37x
> > $
> >
> > Try 'qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc37x',
> > this should start a TC377 SoC on an AURIX board (~KIT_A2G_TC377_TRB).
>
> This is the closest you will get to TC377 board.
>
> I'm not sure if QEMU is the best choice for you, if you want run a RTOS, as
> qemu-system-tricore is lacking:
>
> - peripherals like SCU, SystemTimer that are a bare minimum to run a RTOS
>
> - Simulation of time: When your RTOS runs periodic tasks you might get
> wrong
>   results, as QEMU does not simulate time accurately. The real CPU would
>   see time pass differently than QEMU. We make a best guess using the wall
> time.
>
> I think for now Infineons TSIM is a better choice, as it does not lack the
> points above. However it has significantly less performance compared to
> QEMU.
>
> If you are only interested in running bare metal software, check out my
> 'boot_to_main' test [1]. The Makefile [2] shows you how to build it using
> tricore-gcc [3] and how to run it in QEMU. Also tricore-gdb [4] might be
> interesting for you.
>
> If you have further questions, feel free to ask me.
>
> Cheers,
> Bastian
>
> [1]
> https://gitlab.com/qemu-project/qemu/-/blob/master/tests/tcg/tricore/c/test_boot_to_main.c?ref_type=heads
> [2]
> https://gitlab.com/qemu-project/qemu/-/blob/master/tests/tcg/tricore/Makefile.softmmu-target?ref_type=heads
> [3] https://github.com/bkoppelmann/package_494
> [4] https://github.com/volumit/gdb-tricore
>


Re: Qemu for TC377

2024-04-15 Thread Bastian Koppelmann
Hi Sameer,
On Sun, Apr 14, 2024 at 06:15:56PM +0200, Philippe Mathieu-Daudé wrote:
> Hi Sameer,
> 
> On 13/4/24 14:52, Sameer Kalliadan Poyil wrote:
> > Hello All,
> > I see that Latest qemu supports for tricore TC277 and TC377
> > image.png
> > But when I downloaded source code and checked for TC377 related file , I
> > didn't find anything
> > 
> > I want to run RTOS/bare metal code on TC377 . could you please let me
> > know how to start qemu on TC377 ?
> > Here is the latest version of qemu i have , I didn't download 9.0
> 
> $ qemu-system-tricore -cpu help
> Available CPUs:
>   tc1796
>   tc1797
>   tc27x
>   tc37x
> $
> 
> Try 'qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc37x',
> this should start a TC377 SoC on an AURIX board (~KIT_A2G_TC377_TRB).

This is the closest you will get to TC377 board. 

I'm not sure if QEMU is the best choice for you, if you want run a RTOS, as
qemu-system-tricore is lacking:

- peripherals like SCU, SystemTimer that are a bare minimum to run a RTOS

- Simulation of time: When your RTOS runs periodic tasks you might get wrong
  results, as QEMU does not simulate time accurately. The real CPU would
  see time pass differently than QEMU. We make a best guess using the wall time.

I think for now Infineons TSIM is a better choice, as it does not lack the
points above. However it has significantly less performance compared to QEMU.

If you are only interested in running bare metal software, check out my
'boot_to_main' test [1]. The Makefile [2] shows you how to build it using
tricore-gcc [3] and how to run it in QEMU. Also tricore-gdb [4] might be
interesting for you.

If you have further questions, feel free to ask me.

Cheers,
Bastian

[1] 
https://gitlab.com/qemu-project/qemu/-/blob/master/tests/tcg/tricore/c/test_boot_to_main.c?ref_type=heads
[2] 
https://gitlab.com/qemu-project/qemu/-/blob/master/tests/tcg/tricore/Makefile.softmmu-target?ref_type=heads
[3] https://github.com/bkoppelmann/package_494
[4] https://github.com/volumit/gdb-tricore



Re: Qemu for TC377

2024-04-14 Thread Philippe Mathieu-Daudé

Hi Sameer,

On 13/4/24 14:52, Sameer Kalliadan Poyil wrote:

Hello All,
I see that Latest qemu supports for tricore TC277 and TC377
image.png
But when I downloaded source code and checked for TC377 related file , I 
didn't find anything


I want to run RTOS/bare metal code on TC377 . could you please let me 
know how to start qemu on TC377 ?

Here is the latest version of qemu i have , I didn't download 9.0


$ qemu-system-tricore -cpu help
Available CPUs:
  tc1796
  tc1797
  tc27x
  tc37x
$

Try 'qemu-system-tricore -machine KIT_AURIX_TC277_TRB -cpu tc37x',
this should start a TC377 SoC on an AURIX board (~KIT_A2G_TC377_TRB).

Cc'ing Bastian for further help.

Regards,

Phil.


Regards
Sameer





Qemu for TC377

2024-04-13 Thread Sameer Kalliadan Poyil
Hello All,
I see that Latest qemu supports for tricore TC277 and TC377
[image: image.png]
But when I downloaded source code and checked for TC377 related file , I
didn't find anything

I want to run RTOS/bare metal code on TC377 . could you please let me know
how to start qemu on TC377 ?
Here is the latest version of qemu i have , I didn't download 9.0

[image: image.png]

Regards
Sameer