public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* sim: Handle and pass new required option -OPC for CGEN "desc".
@ 2004-12-01  2:33 Hans-Peter Nilsson
  2004-12-01 13:54 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Hans-Peter Nilsson @ 2004-12-01  2:33 UTC (permalink / raw)
  To: cgen, gdb

Most CGEN-based simulators use the <target>-desc.h file from
opcodes (and by most, I mean two out of the total three), see
sim/m32r/Makefile.in and sim/frv/Makefile.in.  When the CGEN
option "-OPC" was introduced for generating that file, the CGEN
caller in opcodes was updated, but the one in sim wasn't.  So
i960 broke.  To repeat, build sim --target=i960-elf
--enable-cgen-maint or go to build/sim/i960 and make
"stamp-desc" (may need to "rm stamp-desc" or "touch
cgen/cpu/i960.cpu").  You'll see:

make cgen-desc CGEN=`if [ -f ../../guile/libguile/guile ]; then echo ../../guile/libguile/guile; else echo guile ; fi` CGENFLAGS="-v" \
  cpu=i960 mach=all \
  archfile=/n/asic/slask/hp/simtest/src/sim/i960/../../cgen/cpu/i960.cpu
make[1]: Entering directory `/n/asic_slask/hp/simtest/srcobji960/sim/i960'
/bin/sh /n/asic/slask/hp/simtest/src/sim/i960/../common/cgen.sh desc /n/asic/slask/hp/simtest/src/sim/i960 \
guile /n/asic/slask/hp/simtest/src/sim/i960/../../cgen "-v" \
	i960 "" i960 "" all "" \
	/n/asic/slask/hp/simtest/src/sim/i960/../../cgen/cpu/i960.cpu ignored
Skipping slib/sort, already loaded.
Skipping slib/random, already loaded.
No backtrace available.
cgen -s /n/asic/slask/hp/simtest/src/sim/i960/../../cgen/cgen-opc.scm -s /n/asic/slask/hp/simtest/src/sim/i960/../../cgen -v -f  -m all -a /n/asic/slask/hp/simtest/src/sim/i960/../../cgen/cpu/i960.cpu -i all -H tmp-desc.h1 -C tmp-desc.c1 -O tmp-opc.h1 
Loading cpu description /n/asic/slask/hp/simtest/src/sim/i960/../../cgen/cpu/i960.cpu
Including file simplify.inc ...
Analyzing instruction set ...
Done analysis.
Generating i960 desc.h ...
ERROR: .opc file unspecified, missing -OPC argument
make[1]: *** [cgen-desc] Error 1

Fixed by adjusting the desc-related machinery to handle both
explicit and defaulted .opc file.  The following was committed
as obvious, after testing by "make stamp-desc" in sim/i960 (has
an opcfile cgen/cpu/i960.opc) and the wip sim/cris (no opcfile,
defaults to /dev/null) and building the simulators.  I didn't
commit the regenerated sim/i960 files, because they obviously
haven't been regenerated since CGEN was last modified and
they're too different from the version in CVS for me to decide
whether the changes are benevolent, and there's no testsuite for
it trigged by "make check-sim". :-(  I also updated copyright
year for Make-common.in, but that's not shown in this patch.

sim/common:
	* cgen.sh: New thirteenth parameter opcfile, defaulting to
	/dev/null.
	<case desc>: Pass -OPC opcfile.
	* Make-common.in (cgen-desc): Pass $(opcfile) as thirteenth
	parameter to cgen.sh.

sim/i960:
	* Makefile.in (stamp-desc): Specify opcfile.


Index: Make-common.in
===================================================================
RCS file: /cvs/src/src/sim/common/Make-common.in,v
retrieving revision 1.16
diff -c -p -r1.16 Make-common.in
*** Make-common.in	30 Nov 2004 13:44:13 -0000	1.16
--- Make-common.in	1 Dec 2004 00:54:00 -0000
*************** cgen-desc: force
*** 739,744 ****
  	$(SHELL) $(srccom)/cgen.sh desc $(srcdir) \
  		$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
  		$(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
! 		$(archfile) ignored
  
  ## End COMMON_POST_CONFIG_FRAG
--- 739,744 ----
  	$(SHELL) $(srccom)/cgen.sh desc $(srcdir) \
  		$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
  		$(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
! 		$(archfile) ignored $(opcfile)
  
  ## End COMMON_POST_CONFIG_FRAG
Index: cgen.sh
===================================================================
RCS file: /cvs/src/src/sim/common/cgen.sh,v
retrieving revision 1.5
diff -c -p -r1.5 cgen.sh
*** cgen.sh	8 Sep 2003 17:24:59 -0000	1.5
--- cgen.sh	1 Dec 2004 00:54:00 -0000
***************
*** 3,9 ****
  #
  # Usage: /bin/sh cgen.sh {"arch"|"cpu"|"decode"|"defs"|"cpu-decode"} \
  #	srcdir cgen cgendir cgenflags \
! #	arch archflags cpu mach suffix archfile extrafiles
  #
  # We store the generated files in the source directory until we decide to
  # ship a Scheme interpreter (or other implementation) with gdb/binutils.
--- 3,9 ----
  #
  # Usage: /bin/sh cgen.sh {"arch"|"cpu"|"decode"|"defs"|"cpu-decode"} \
  #	srcdir cgen cgendir cgenflags \
! #	arch archflags cpu mach suffix archfile extrafiles opcfile
  #
  # We store the generated files in the source directory until we decide to
  # ship a Scheme interpreter (or other implementation) with gdb/binutils.
*************** shift ; mach=$9
*** 26,34 ****
--- 26,37 ----
  shift ; suffix=$9
  shift ; archfile=$9
  shift ; extrafiles=$9
+ shift ; opcfile=$9
  
  rootdir=${srcdir}/../..
  
+ test -z "${opcfile}" && opcfile=/dev/null
+ 
  if test -z "$isa" ; then
    isa=all
    prefix=$cpu
*************** desc)
*** 196,201 ****
--- 199,205 ----
  	${cgen} -s ${cgendir}/cgen-opc.scm \
  		-s ${cgendir} \
  		${cgenflags} \
+ 		-OPC ${opcfile} \
  		-f "${archflags}" \
  		-m ${mach} \
  		-a ${archfile} \


Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/i960/Makefile.in,v
retrieving revision 1.5
diff -c -p -r1.5 Makefile.in
*** Makefile.in	8 Sep 2003 17:25:56 -0000	1.5
--- Makefile.in	1 Dec 2004 01:47:54 -0000
***************
*** 1,5 ****
  # Makefile template for Configure for the i960 simulator
! # Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
  # Contributed by Cygnus Support.
  #
  # This file is part of GDB, the GNU debugger.
--- 1,5 ----
  # Makefile template for Configure for the i960 simulator
! # Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
  # Contributed by Cygnus Support.
  #
  # This file is part of GDB, the GNU debugger.
*************** stamp-desc: $(CGEN_READ_SCM) $(CGEN_DESC
*** 125,130 ****
  		$(CGEN_CPU_DIR)/sparc.cpu $(CGEN_CPU_DIR)/sparccom.cpu $(CGEN_CPU_DIR)/i960.cpu $(CGEN_CPU_DIR)/i960.cpu
  	$(MAKE) cgen-desc $(CGEN_FLAGS_TO_PASS) \
  	  cpu=i960 mach=all \
! 	  archfile=$(CGEN_CPU_DIR)/i960.cpu
  	touch stamp-desc
  i960-desc.c i960-desc.h i960-opc.h: $(CGEN_MAINT) stamp-desc
--- 125,130 ----
  		$(CGEN_CPU_DIR)/sparc.cpu $(CGEN_CPU_DIR)/sparccom.cpu $(CGEN_CPU_DIR)/i960.cpu $(CGEN_CPU_DIR)/i960.cpu
  	$(MAKE) cgen-desc $(CGEN_FLAGS_TO_PASS) \
  	  cpu=i960 mach=all \
! 	  archfile=$(CGEN_CPU_DIR)/i960.cpu opcfile=$(CGEN_CPU_DIR)/i960.opc
  	touch stamp-desc
  i960-desc.c i960-desc.h i960-opc.h: $(CGEN_MAINT) stamp-desc

brgds, H-P

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

* Re: sim: Handle and pass new required option -OPC for CGEN "desc".
  2004-12-01  2:33 sim: Handle and pass new required option -OPC for CGEN "desc" Hans-Peter Nilsson
@ 2004-12-01 13:54 ` Frank Ch. Eigler
  2004-12-01 15:02   ` Hans-Peter Nilsson
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2004-12-01 13:54 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: cgen, gdb

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

Hi, HP -

On Wed, Dec 01, 2004 at 03:32:59AM +0100, Hans-Peter Nilsson wrote:
> [...]
> I didn't
> commit the regenerated sim/i960 files, because they obviously
> haven't been regenerated since CGEN was last modified and
> they're too different from the version in CVS for me to decide
> whether the changes are benevolent, and there's no testsuite for
> it trigged by "make check-sim". :-(  [...]

Testsuites for "check-sim" are quite rare.  The way one normally
obtains confidence in regenerated simulators is by running the
gcc/gdb tests against the changed sim.

Thanks for your care & feeding of cgen.  (I'll get back to
you on the other cris stuff later today.)

- FChE

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

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

* Re: sim: Handle and pass new required option -OPC for CGEN "desc".
  2004-12-01 13:54 ` Frank Ch. Eigler
@ 2004-12-01 15:02   ` Hans-Peter Nilsson
  0 siblings, 0 replies; 3+ messages in thread
From: Hans-Peter Nilsson @ 2004-12-01 15:02 UTC (permalink / raw)
  To: fche; +Cc: cgen, gdb

> Date: Wed, 1 Dec 2004 08:53:40 -0500
> From: "Frank Ch. Eigler" <fche@redhat.com>

> Testsuites for "check-sim" are quite rare.  The way one normally
> obtains confidence in regenerated simulators is by running the
> gcc/gdb tests against the changed sim.

A *very* weak confidence, and a roundabout way of doing it at
that!  I just want to raise a concern: I hope it isn't policy.

(I like test-suites, and ones exercising existing-code coverage,
functional coverage and fixed bugs is a minimum.  I could
rewrite the whole thing and not worry -- except of course to
check that the new code paths are covered!)  Besides, i960 is
obsoleted, removed from gcc, so no hope in current CVS for that.

> Thanks for your care & feeding of cgen.  (I'll get back to
> you on the other cris stuff later today.)

So they all say. :-)  I'd be most thankful to get that SID issue
resolved.  What are y'all using for CGEN debugging?  I tried
psd-1.2.1 but it doesn't seem guile-compatible.

brgds, H-P

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

end of thread, other threads:[~2004-12-01 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01  2:33 sim: Handle and pass new required option -OPC for CGEN "desc" Hans-Peter Nilsson
2004-12-01 13:54 ` Frank Ch. Eigler
2004-12-01 15:02   ` Hans-Peter Nilsson

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