public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Simulator Porting
@ 2005-05-24  6:58 Shilin Shakti
  2005-05-24 12:59 ` Frank Ch. Eigler
  0 siblings, 1 reply; 7+ messages in thread
From: Shilin Shakti @ 2005-05-24  6:58 UTC (permalink / raw)
  To: cgen

Hi all,
I am having some trouble trying to port a simulator for a new target.
Actually i have modelled the required simulator files like mloop.in, sim-if.c, etc, for my port to be as close to the existing m32r base port.
However when i try to execute a program using my simulator, it gives the following message:
"2 byte write to unmapped address 0xfffffffe at 0x404", 
while the similar m32r program runs fine. At 0x404 is a move immediate data instruction in my case (but how this 0xfffffffe address i'm confused!!).

I do not know why this is coming. Currently i have changed a few constants of m32r base port like the M32R_DEVICE_ADDR,M32R_DEVICE_LEN and M32R_DEFAULT_MEM_SIZE to match those of my processor. Still why this error 
for 0xfffffffe,etc is coming into picture i am not sure.
Please could anyone provide any help in this regard.
Currently i have two terminals open, one where i'm debugging my ported simulator on native gdb, and other debugging the existing m32r base simulator, for the sake of reference of execution flow, etc :-)) (to see where i'm going wrong!)..But still no luck..
Kindly advice anyone,
Thanking you in advance,
Best Regards,
Shilin



---------------------------------
This message contains the information that may be privileged and is  the property of the KPIT Cummins Infosystems LTD.It is intended only for the person to whom it is addressed. If you are not intended recipient, you are not authorized to read, print , retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Simulator Porting
  2005-05-24  6:58 Simulator Porting Shilin Shakti
@ 2005-05-24 12:59 ` Frank Ch. Eigler
  0 siblings, 0 replies; 7+ messages in thread
From: Frank Ch. Eigler @ 2005-05-24 12:59 UTC (permalink / raw)
  To: Shilin Shakti; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi -

On Tue, May 24, 2005 at 12:26:48PM +0530, Shilin Shakti wrote:
> [...]
> following message:
> "2 byte write to unmapped address 0xfffffffe at 0x404",=20
> while the similar m32r program runs fine. At 0x404 is a move immediate da
> ta instruction in my case (but how this 0xfffffffe address i'm confused!!
> ).

You could run the simulator under gdb, and put a breakpoint at the
point in the generated sem.c file which executes that move-immediate
instruction.  Without posting more information, such as your modified
.cpu file and disassembled sample program, we won't be able to help
much.


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Simulator Porting
  2005-05-26 13:18 Shilin Shakti
@ 2005-05-27 19:04 ` Frank Ch. Eigler
  0 siblings, 0 replies; 7+ messages in thread
From: Frank Ch. Eigler @ 2005-05-27 19:04 UTC (permalink / raw)
  To: Shilin Shakti; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

Hi -

On Thu, May 26, 2005 at 06:41:37PM +0530, Shilin Shakti wrote:
> [...]
> Regarding enabling the sim tracing option, i have done it in the
> 'configure' file (--enable-sim-trace option i guess).

That, plus use "(gdb) target sim OPTIONS" where OPTIONS includes
actual activation (not just capability) instructions like
"--trace-insn".  See sim/common/*trace*.

> But by the gdb-linked variant of the simulator did you mean the
> 'step' option to be passed that is checked in 'main' (mentioned in
> \sim\common\nrun.c) for single stepping?

I meant "(gdb) target sim; load; stepi; stepi; stepi; ...", so that
the sim is made to execute one target instruction at a time.

> I could not fully comprehend this option also.  [...]

I suggest building a vanilla working cross toolchain first, learning
how to use all the tools, and only after that attempting to port them.
It will take far too long to explain both usage and porting in email.


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Simulator Porting
@ 2005-05-26 13:18 Shilin Shakti
  2005-05-27 19:04 ` Frank Ch. Eigler
  0 siblings, 1 reply; 7+ messages in thread
From: Shilin Shakti @ 2005-05-26 13:18 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

Hi Frank,
I have begun the process of rechecking the related mainloop and other
sim files as you suggested.
Regarding enabling the sim tracing option, i have done it in the
'configure' file (--enable-sim-trace
option i guess). But by the gdb-linked variant of the simulator did you
mean the 'step' option
to be passed that is checked in 'main' (mentioned in \sim\common\nrun.c)
for single stepping? I could not fully comprehend this option also.
Currently i am using the native gdb to debug my ported simulator
program!

Thank you very much once again for your response.

Best Regards,
Shilin


-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: Wednesday, May 25, 2005 7:50 PM
To: Shilin Shakti
Cc: cgen@sources.redhat.com
Subject: Re: Simulator Porting


Hi -

shilins wrote:

> [...] Am i doing all these correctly? Also what do you think might
> be the reason for that address alignment issue?

It's very hard to say.  We may need to see code and other data.  Check
your initialization and main loop code.  Activate all available sim
tracing options.  Run the gdb-linked variant of the simulator, so you
can single-step it under control.

- FChE


---------------------------------
This message contains the information that may be privileged and is  the property of the KPIT Cummins Infosystems LTD.It is intended only for the person to whom it is addressed. If you are not intended recipient, you are not authorized to read, print , retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Simulator Porting
  2005-05-25 10:43 Shilin Shakti
@ 2005-05-25 14:20 ` Frank Ch. Eigler
  0 siblings, 0 replies; 7+ messages in thread
From: Frank Ch. Eigler @ 2005-05-25 14:20 UTC (permalink / raw)
  To: Shilin Shakti; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hi -

shilins wrote:

> [...] Am i doing all these correctly? Also what do you think might
> be the reason for that address alignment issue?

It's very hard to say.  We may need to see code and other data.  Check
your initialization and main loop code.  Activate all available sim
tracing options.  Run the gdb-linked variant of the simulator, so you
can single-step it under control.

- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Simulator Porting
@ 2005-05-25 10:43 Shilin Shakti
  2005-05-25 14:20 ` Frank Ch. Eigler
  0 siblings, 1 reply; 7+ messages in thread
From: Shilin Shakti @ 2005-05-25 10:43 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

Hi Frank,
Thank you very much for your response.
I had been using the sem-switch.c in the makefile with the '-switch'
option enabled for mloop.in file, similar to the m32r, along with the
'-fast -pbb' options also.
Now i have changed it to use sem.c like you mentioned, with '-scache'
option for mloop.in file (removed -switch, -fast, -pbb options from
makefile for mloop.in).
But I now notice that if i insert a 2 byte 'nop' insn just before the
mov imm insn, that error message doesn't occur and execution seems to be
going on, though i still can't figure if the simulator is correctly
working or not (since our toolchain's printf function is currently
implemented for output to hyperterminal for hardware!!!). Also the
'Program exited normally' message has not come; seems to hang around in
the simulator program itself!

Am i doing all these correctly? Also what do you think might be the
reason for that address alignment issue?

Thanking you once again,
Best Regards,
Shilin

-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: Tuesday, May 24, 2005 6:29 PM
To: Shilin Shakti
Cc: cgen@sources.redhat.com
Subject: Re: Simulator Porting


Hi -

On Tue, May 24, 2005 at 12:26:48PM +0530, Shilin Shakti wrote:
> [...]
> following message:
> "2 byte write to unmapped address 0xfffffffe at 0x404",=20
> while the similar m32r program runs fine. At 0x404 is a move immediate
da
> ta instruction in my case (but how this 0xfffffffe address i'm
confused!!
> ).

You could run the simulator under gdb, and put a breakpoint at the
point in the generated sem.c file which executes that move-immediate
instruction.  Without posting more information, such as your modified
.cpu file and disassembled sample program, we won't be able to help
much.


- FChE


---------------------------------
This message contains the information that may be privileged and is  the property of the KPIT Cummins Infosystems LTD.It is intended only for the person to whom it is addressed. If you are not intended recipient, you are not authorized to read, print , retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Simulator Porting
@ 2005-05-24  7:31 Shilin Shakti
  0 siblings, 0 replies; 7+ messages in thread
From: Shilin Shakti @ 2005-05-24  7:31 UTC (permalink / raw)
  To: cgen

In my previous mail (with Subject: Simulator Porting)i forgot to mention a few things about the version.
Obviously i am using CGEN for porting my simulator, which is version 1.0.
Also i am using GDB version 6.3.
One other thing is that my assembler port using CGEN for the target is working ok. Also CGEN has autogenerated the decode.c/.h, cpu.c/.h, etc files for me in the gdb-6.3/sim folder for my target, which are involved in the simulator executable.
Requesting any help and thanking you once again,
Best Regards,
Shilin

-----Original Message-----
From: cgen-owner@sources.redhat.com
[mailto:cgen-owner@sources.redhat.com]On Behalf Of Shilin Shakti
Sent: Tuesday, May 24, 2005 12:27 PM
To: cgen@sources.redhat.com
Subject: Simulator Porting


Hi all,
I am having some trouble trying to port a simulator for a new target.
Actually i have modelled the required simulator files like mloop.in, sim-if.c, etc, for my port to be as close to the existing m32r base port.
However when i try to execute a program using my simulator, it gives the following message:
"2 byte write to unmapped address 0xfffffffe at 0x404", 
while the similar m32r program runs fine. At 0x404 is a move immediate data instruction in my case (but how this 0xfffffffe address i'm confused!!).

I do not know why this is coming. Currently i have changed a few constants of m32r base port like the M32R_DEVICE_ADDR,M32R_DEVICE_LEN and M32R_DEFAULT_MEM_SIZE to match those of my processor. Still why this error 
for 0xfffffffe,etc is coming into picture i am not sure.
Please could anyone provide any help in this regard.
Currently i have two terminals open, one where i'm debugging my ported simulator on native gdb, and other debugging the existing m32r base simulator, for the sake of reference of execution flow, etc :-)) (to see where i'm going wrong!)..But still no luck..
Kindly advice anyone,
Thanking you in advance,
Best Regards,
Shilin



---------------------------------
This message contains the information that may be privileged and is  the property of the KPIT Cummins Infosystems LTD.It is intended only for the person to whom it is addressed. If you are not intended recipient, you are not authorized to read, print , retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails.


---------------------------------
This message contains the information that may be privileged and is  the property of the KPIT Cummins Infosystems LTD.It is intended only for the person to whom it is addressed. If you are not intended recipient, you are not authorized to read, print , retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-05-27 19:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-24  6:58 Simulator Porting Shilin Shakti
2005-05-24 12:59 ` Frank Ch. Eigler
2005-05-24  7:31 Shilin Shakti
2005-05-25 10:43 Shilin Shakti
2005-05-25 14:20 ` Frank Ch. Eigler
2005-05-26 13:18 Shilin Shakti
2005-05-27 19:04 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).