public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* multiple isa support
@ 2000-11-19 19:52 Ben Elliston
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Elliston @ 2000-11-19 19:52 UTC (permalink / raw)
  To: cgen development

I'm currently adding multiple isa support to the sim/common application in
cgen.  I've managed to get the -gen-hardware functions doing the right
thing, but when it comes time to pass multiple isas on the "make cgen-cpu"
command line, I get an error about having multiple isas selected.

Shouldn't arch.{h,c}, cpuall.h and cpu.h all be able to be generated with
multiple isas selected?

Ben

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

* Re: multiple isa support
  2000-12-01  6:15     ` Johan Rydberg
@ 2000-12-01 13:43       ` Ben Elliston
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Elliston @ 2000-12-01 13:43 UTC (permalink / raw)
  To: Johan Rydberg; +Cc: Doug Evans, cgen development

johan.rydberg wrote:

   Is this commited to the CVS-repository ?

Not yet.  I am in the process of reviewing and cleaning up my patches.
I'll be submitting them for approval in a week or so.

Ben

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

* Re: multiple isa support
  2000-11-23 18:12   ` Ben Elliston
@ 2000-12-01  6:15     ` Johan Rydberg
  2000-12-01 13:43       ` Ben Elliston
  0 siblings, 1 reply; 8+ messages in thread
From: Johan Rydberg @ 2000-12-01  6:15 UTC (permalink / raw)
  To: Ben Elliston; +Cc: Doug Evans, cgen development

Ben Elliston wrote:
> 
> Hi Doug,
> 
>     >   #include "cgen-engine.h"
>     >   #include "cpu.h"
>     >   #include "decode.h"
> 
>    I'm guessing the way to go is to have a separate #include for each
>    decoder. After quick glance at m32r's decode.h and decodex.h it seems
>    like they can co-exist.
> 
> I ended up leaving the code generator to emit #include "decode.h" and then
> created my own decode.h which brings in the relevant decoder:
> 
>         #ifdef WANT_ISA_FOO
>         #include "decode-foo.h"
>         #endif
> 
>         #ifdef WANT_ISA_BAR
>         #include "decode-bar.h"
>         #endif

Is this commited to the CVS-repository ?

I'm using CGEN to port an architecture (OpenRISC) that has two isas:
OR32
and OR16.  I have created a main .cpu-file for the architecture and has 
two other files that holds the seperate isas (much like the arm.cpu <->
arm7.cpu, thumb.cpu).  

From the main .cpu-file:

  (if (keep-isa? (or32))
      (include "or32.cpu"))
  (if (keep-isa? (or16))
      (include "or16.cpu"))

When generated "desc.[c|h]" using the "desc" target it seems just to
handle 
one ISA (the first one defined).

Here's how I'm invoking cgen:

  $ make ARCH=or1k desc

If you look at the result (tmp-desc.c) you see:

  /* jr $rA */
    {
      @ARCH@_INSN_JR, "jr", "jr", 32,
      { 0|A(DELAY_SLOT)|A(UNCOND_CTI), { (1<<MACH_BASE), (1<<ISA_OR32) }
}
    },

  ...
  /* jr $rA */
    {
      @ARCH@_INSN_JR, "jr", "jr", 16,
      { 0|A(DELAY_SLOT)|A(UNCOND_CTI), { (1<<MACH_BASE), (1<<ISA_OR32) }
}
    },

The first "jr" insn is from the OR32 isa, the other one from OR16. 
I guess that this is not the right behavior, right?   Is this a bug,
not implemented or am I just invoking cgen incorrect?

Maybe someone could give me some guidence how to use cgen with multiple
isas.

regards,
Johan.

-- 
Johan Rydberg, Net Insight AB, Sweden, +46-8-685 04 00

$ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") -
             THEN EXCUSE/OBJECT=ME

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

* Re: multiple isa support
  2000-11-22  8:26 ` Doug Evans
  2000-11-22 16:09   ` Ben Elliston
@ 2000-11-23 18:12   ` Ben Elliston
  2000-12-01  6:15     ` Johan Rydberg
  1 sibling, 1 reply; 8+ messages in thread
From: Ben Elliston @ 2000-11-23 18:12 UTC (permalink / raw)
  To: Doug Evans; +Cc: cgen development

Hi Doug,

    > 	#include "cgen-engine.h"
    > 	#include "cpu.h"
    > 	#include "decode.h"

   I'm guessing the way to go is to have a separate #include for each
   decoder. After quick glance at m32r's decode.h and decodex.h it seems
   like they can co-exist.

I ended up leaving the code generator to emit #include "decode.h" and then
created my own decode.h which brings in the relevant decoder:

	#ifdef WANT_ISA_FOO
	#include "decode-foo.h"
	#endif

	#ifdef WANT_ISA_BAR
	#include "decode-bar.h"
	#endif

I can control this from my Makefile by passing -D options to the compiler.
I think this is probably sufficient.  I don't feel this is a problem that we
should invest a whole lot of time to solve for the sim/common framework.
We've got bigger fish to fry. :-)

Cheers, Ben

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

* Re: multiple isa support
  2000-11-22 16:09   ` Ben Elliston
@ 2000-11-22 16:29     ` Frank Ch. Eigler
  0 siblings, 0 replies; 8+ messages in thread
From: Frank Ch. Eigler @ 2000-11-22 16:29 UTC (permalink / raw)
  To: Ben Elliston; +Cc: cgen development

Hi -

On Thu, Nov 23, 2000 at 11:08:56AM +1100, Ben Elliston wrote:
:    I'm guessing the way to go is to have a separate #include for each decoder.
: 
: Right -- that would make sense.  Do we really need to emit a decoder for
: each *isa* rather than each CPU?

Well yes -- that's fundamentally what makes an ISA different from others!
(I suppose cgen could emit one decoder function that does a run-time check
and switches between several independent decoder ... but that would
penalize machines that know their current ISA choice ahead of time.)


- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6HGT/VZbdDOm/ZT0RAg5FAJ9gWIUQTMk7wbnDC7NT1vT96RZxRQCfbmLD
WAEHI7htQn0ZNnLrSiAgKZY=
=mQk6
-----END PGP SIGNATURE-----

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

* Re: multiple isa support
  2000-11-22  8:26 ` Doug Evans
@ 2000-11-22 16:09   ` Ben Elliston
  2000-11-22 16:29     ` Frank Ch. Eigler
  2000-11-23 18:12   ` Ben Elliston
  1 sibling, 1 reply; 8+ messages in thread
From: Ben Elliston @ 2000-11-22 16:09 UTC (permalink / raw)
  To: Doug Evans; +Cc: cgen development

   I'm guessing the way to go is to have a separate #include for each decoder.

Right -- that would make sense.  Do we really need to emit a decoder for
each *isa* rather than each CPU?

   After quick glance at m32r's decode.h and decodex.h it seems like they
   can co-exist.  Whether decoders for different isas can co-exist, I
   dunno; I'd have to see them first.

   Which suffix are you refering to?

The suffix that the Makefile appends to the generated files -- for example
the `x' in m32rx.

Ben

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

* multiple isa support
  2000-11-20 14:33 Ben Elliston
@ 2000-11-22  8:26 ` Doug Evans
  2000-11-22 16:09   ` Ben Elliston
  2000-11-23 18:12   ` Ben Elliston
  0 siblings, 2 replies; 8+ messages in thread
From: Doug Evans @ 2000-11-22  8:26 UTC (permalink / raw)
  To: Ben Elliston; +Cc: cgen development

Ben Elliston writes:
 > Hi.
 > 
 > I'm making slow progress on making cgen capable of emitting separate
 > decoders and semantics for each of a number of ISAs.  cpuall.h contains one
 > booby trap that I'm not sure about how to handle:
 > 
 > 	#include "cgen-engine.h"
 > 	#include "cpu.h"
 > 	#include "decode.h"
 > 
 > [...]
 > 
 > Should there be a #include for each decoder?  Should they be able to
 > co-exist?  If so, an additional problem is that hardwiring filenames like
 > this is *wrong* -- the shell wrapper may suffix all of the generated
 > filenames.
 > 
 > Any advice on how to proceed?

I'm guessing the way to go is to have a separate #include for each decoder.
After quick glance at m32r's decode.h and decodex.h it seems like they
can co-exist.  Whether decoders for different isas can co-exist, I
dunno; I'd have to see them first.

Which suffix are you refering to?
Here's what m32r/cpuall.h contains.


/* Include files for each cpu family.  */

#ifdef WANT_CPU_M32RBF
#include "eng.h"
#include "cgen-engine.h"
#include "cpu.h"
#include "decode.h"
#endif

#ifdef WANT_CPU_M32RXF
#include "engx.h"
#include "cgen-engine.h"
#include "cpux.h"
#include "decodex.h"
#endif

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

* multiple isa support
@ 2000-11-20 14:33 Ben Elliston
  2000-11-22  8:26 ` Doug Evans
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Elliston @ 2000-11-20 14:33 UTC (permalink / raw)
  To: cgen development

Hi.

I'm making slow progress on making cgen capable of emitting separate
decoders and semantics for each of a number of ISAs.  cpuall.h contains one
booby trap that I'm not sure about how to handle:

	#include "cgen-engine.h"
	#include "cpu.h"
	#include "decode.h"

[...]

Should there be a #include for each decoder?  Should they be able to
co-exist?  If so, an additional problem is that hardwiring filenames like
this is *wrong* -- the shell wrapper may suffix all of the generated
filenames.

Any advice on how to proceed?

Ben

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

end of thread, other threads:[~2000-12-01 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-19 19:52 multiple isa support Ben Elliston
2000-11-20 14:33 Ben Elliston
2000-11-22  8:26 ` Doug Evans
2000-11-22 16:09   ` Ben Elliston
2000-11-22 16:29     ` Frank Ch. Eigler
2000-11-23 18:12   ` Ben Elliston
2000-12-01  6:15     ` Johan Rydberg
2000-12-01 13:43       ` Ben Elliston

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