public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* porting to a new architecture
@ 2010-11-17 10:36 Dalibor Kovacevic
  2010-11-17 14:16 ` Jean-Marc Saffroy
  0 siblings, 1 reply; 2+ messages in thread
From: Dalibor Kovacevic @ 2010-11-17 10:36 UTC (permalink / raw)
  To: cgen

Hi,

My client wants me to port GDB to his CPU but he does not have any
kind of simulator yet on which I could try out my port. Reading about
the quickest way to generate a simulator and came across CGEN.

So I`m wondering can I do that but not in the order like on
http://sourceware.org/cgen/docs-1.0/cgen_5.html for that I need a .cpu
file which I don`t have and before I start making one just wanted to
check is there a way to get that file out of already ported gcc or
binutils. I have searched them for all .cpu files but my architecture
is not there.

I`m maybe asking to much but it doesn't  hurt to ask.

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

* Re: porting to a new architecture
  2010-11-17 10:36 porting to a new architecture Dalibor Kovacevic
@ 2010-11-17 14:16 ` Jean-Marc Saffroy
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Marc Saffroy @ 2010-11-17 14:16 UTC (permalink / raw)
  To: Dalibor Kovacevic; +Cc: cgen

Hi Dalibor,

> My client wants me to port GDB to his CPU but he does not have any
> kind of simulator yet on which I could try out my port.

No simulator? This sounds really surprising!

> Reading about
> the quickest way to generate a simulator and came across CGEN.

It seems a good idea, CGEN can save you a lot of time in writing a
simulator, though it is still a fair bit of work, possibly much more
than a simple gdb port.

> So I`m wondering can I do that but not in the order like on
> http://sourceware.org/cgen/docs-1.0/cgen_5.html

Indeed, if all you want is a simulator, then you don't need to follow
all the steps described in the CGEN documentation. What you really want
is a working simulator, so the steps needed are:
- modify configure etc. stuff for your arch
- .cpu and .opc files to feed to CEN; you should look at other ports for
ideas, but it seems you will need to start from scratch
- simple modifications for opcodes support; CGEN generates almost
everything here
- simulator code:
 . some boiler plate code to start the simulator; most can be stolen
from other simple ports
 . mloop.in: a template for the main loop, which can very generic code,
with little (if any) knowledge of the simulated arch; again, there are
good examples in other ports
 . support code for specific aspects of your target: traps,
interruptions, and the like; this is of course much more specific to
your target

> for that I need a .cpu
> file which I don`t have and before I start making one just wanted to
> check is there a way to get that file out of already ported gcc or
> binutils. I have searched them for all .cpu files but my architecture
> is not there.

The binutils CVS repo on sourceware.org has .cpu files under two
directories: cpu/ and cgen/cpu/. Though it looks like the latter
contains some unfinished stuff.

There is no .cpu file in gcc; CGEN's RTL and gcc's RTL are meant to look
familiar, but they really are different things. Maybe you could use an
existing gcc port for hints, if the CPU documentation isn't clear
enough, but then you have other serious problems!


Cheers,
Jean-Marc

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

end of thread, other threads:[~2010-11-17 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-17 10:36 porting to a new architecture Dalibor Kovacevic
2010-11-17 14:16 ` Jean-Marc Saffroy

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).