* Make-common.in (CGEN_CPU_EXTR,CGEN_CPU_READ): Pass canonical
identifiers for file types rather than encoding internal implementation details of cgen.sh. (CGEN_CPU_WRITE,CGEN_CPU_SEM,CGEN_CPU_SEMSW): Ditto. * cgen.sh: Add support for parallel makes. Rewrite cpu/decode handling to avoid generating "extrafiles" twice.
This commit is contained in:
parent
02b96ddcb6
commit
2c2a86d776
|
@ -1,3 +1,12 @@
|
||||||
|
2009-07-06 Doug Evans <dje@sebabeach.org>
|
||||||
|
|
||||||
|
* Make-common.in (CGEN_CPU_EXTR,CGEN_CPU_READ): Pass canonical
|
||||||
|
identifiers for file types rather than encoding internal
|
||||||
|
implementation details of cgen.sh.
|
||||||
|
(CGEN_CPU_WRITE,CGEN_CPU_SEM,CGEN_CPU_SEMSW): Ditto.
|
||||||
|
* cgen.sh: Add support for parallel makes.
|
||||||
|
Rewrite cpu/decode handling to avoid generating "extrafiles" twice.
|
||||||
|
|
||||||
2009-05-18 Jon Beniston <jon@beniston.com>
|
2009-05-18 Jon Beniston <jon@beniston.com>
|
||||||
|
|
||||||
* gennltvals.sh: Add lm32 target.
|
* gennltvals.sh: Add lm32 target.
|
||||||
|
|
|
@ -701,11 +701,12 @@ CGEN_DECODE_SCM = $(CGENDIR)/sim-decode.scm
|
||||||
CGEN_DESC_SCM = $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm
|
CGEN_DESC_SCM = $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm
|
||||||
|
|
||||||
# Various choices for which cpu specific files to generate.
|
# Various choices for which cpu specific files to generate.
|
||||||
CGEN_CPU_EXTR = -E tmp-ext.c1
|
# These are passed to cgen.sh in the "extrafiles" argument.
|
||||||
CGEN_CPU_READ = -R tmp-read.c1
|
CGEN_CPU_EXTR = /extr/
|
||||||
CGEN_CPU_WRITE = -W tmp-write.c1
|
CGEN_CPU_READ = /read/
|
||||||
CGEN_CPU_SEM = -S tmp-sem.c1
|
CGEN_CPU_WRITE = /write/
|
||||||
CGEN_CPU_SEMSW = -X tmp-semsw.c1
|
CGEN_CPU_SEM = /sem/
|
||||||
|
CGEN_CPU_SEMSW = /semsw/
|
||||||
|
|
||||||
CGEN_FLAGS_TO_PASS = \
|
CGEN_FLAGS_TO_PASS = \
|
||||||
CGEN='$(CGEN)' \
|
CGEN='$(CGEN)' \
|
||||||
|
|
|
@ -50,11 +50,14 @@ sedscript="\
|
||||||
-e s/@CPU@/${CPU}/g -e s/@cpu@/${cpu}/g \
|
-e s/@CPU@/${CPU}/g -e s/@cpu@/${cpu}/g \
|
||||||
-e s/@PREFIX@/${PREFIX}/g -e s/@prefix@/${prefix}/g"
|
-e s/@PREFIX@/${PREFIX}/g -e s/@prefix@/${prefix}/g"
|
||||||
|
|
||||||
|
# avoid collisions in parallel makes
|
||||||
|
tmp=tmp-$$
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
arch)
|
arch)
|
||||||
rm -f tmp-arch.h1 tmp-arch.h
|
rm -f ${tmp}-arch.h1 ${tmp}-arch.h
|
||||||
rm -f tmp-arch.c1 tmp-arch.c
|
rm -f ${tmp}-arch.c1 ${tmp}-arch.c
|
||||||
rm -f tmp-all.h1 tmp-all.h
|
rm -f ${tmp}-all.h1 ${tmp}-all.h
|
||||||
|
|
||||||
${cgen} ${cgendir}/cgen-sim.scm \
|
${cgen} ${cgendir}/cgen-sim.scm \
|
||||||
-s ${cgendir} \
|
-s ${cgendir} \
|
||||||
|
@ -63,53 +66,64 @@ arch)
|
||||||
-m ${mach} \
|
-m ${mach} \
|
||||||
-a ${archfile} \
|
-a ${archfile} \
|
||||||
-i ${isa} \
|
-i ${isa} \
|
||||||
-A tmp-arch.h1 \
|
-A ${tmp}-arch.h1 \
|
||||||
-B tmp-arch.c1 \
|
-B ${tmp}-arch.c1 \
|
||||||
-N tmp-all.h1
|
-N ${tmp}-all.h1
|
||||||
sed $sedscript < tmp-arch.h1 > tmp-arch.h
|
sed $sedscript < ${tmp}-arch.h1 > ${tmp}-arch.h
|
||||||
${rootdir}/move-if-change tmp-arch.h ${srcdir}/arch.h
|
${rootdir}/move-if-change ${tmp}-arch.h ${srcdir}/arch.h
|
||||||
sed $sedscript < tmp-arch.c1 > tmp-arch.c
|
sed $sedscript < ${tmp}-arch.c1 > ${tmp}-arch.c
|
||||||
${rootdir}/move-if-change tmp-arch.c ${srcdir}/arch.c
|
${rootdir}/move-if-change ${tmp}-arch.c ${srcdir}/arch.c
|
||||||
sed $sedscript < tmp-all.h1 > tmp-all.h
|
sed $sedscript < ${tmp}-all.h1 > ${tmp}-all.h
|
||||||
${rootdir}/move-if-change tmp-all.h ${srcdir}/cpuall.h
|
${rootdir}/move-if-change ${tmp}-all.h ${srcdir}/cpuall.h
|
||||||
|
|
||||||
rm -f tmp-arch.h1 tmp-arch.c1 tmp-all.h1
|
rm -f ${tmp}-arch.h1 ${tmp}-arch.c1 ${tmp}-all.h1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cpu | decode | cpu-decode)
|
cpu | decode | cpu-decode)
|
||||||
|
|
||||||
fileopts=""
|
fileopts=""
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
*cpu*)
|
*cpu*)
|
||||||
rm -f tmp-cpu.h1 tmp-cpu.c1
|
rm -f ${tmp}-cpu.h1 ${tmp}-cpu.c1
|
||||||
rm -f tmp-ext.c1 tmp-read.c1 tmp-write.c1
|
rm -f ${tmp}-ext.c1 ${tmp}-read.c1 ${tmp}-write.c1
|
||||||
rm -f tmp-sem.c1 tmp-semsw.c1
|
rm -f ${tmp}-sem.c1 ${tmp}-semsw.c1
|
||||||
rm -f tmp-mod.c1
|
rm -f ${tmp}-mod.c1
|
||||||
rm -f tmp-cpu.h tmp-cpu.c
|
rm -f ${tmp}-cpu.h ${tmp}-cpu.c
|
||||||
rm -f tmp-ext.c tmp-read.c tmp-write.c
|
rm -f ${tmp}-ext.c ${tmp}-read.c ${tmp}-write.c
|
||||||
rm -f tmp-sem.c tmp-semsw.c tmp-mod.c
|
rm -f ${tmp}-sem.c ${tmp}-semsw.c ${tmp}-mod.c
|
||||||
fileopts="$fileopts \
|
fileopts="$fileopts \
|
||||||
-C tmp-cpu.h1 \
|
-C ${tmp}-cpu.h1 \
|
||||||
-U tmp-cpu.c1 \
|
-U ${tmp}-cpu.c1 \
|
||||||
-M tmp-mod.c1 \
|
-M ${tmp}-mod.c1"
|
||||||
${extrafiles}"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
*decode*)
|
*decode*)
|
||||||
rm -f tmp-dec.h1 tmp-dec.h tmp-dec.c1 tmp-dec.c
|
rm -f ${tmp}-dec.h1 ${tmp}-dec.h ${tmp}-dec.c1 ${tmp}-dec.c
|
||||||
fileopts="$fileopts \
|
fileopts="$fileopts \
|
||||||
-T tmp-dec.h1 \
|
-T ${tmp}-dec.h1 \
|
||||||
-D tmp-dec.c1"
|
-D ${tmp}-dec.c1"
|
||||||
case "$extrafiles" in
|
|
||||||
ignored) # Do nothing.
|
|
||||||
;;
|
|
||||||
*) fileopts="$fileopts $extrafiles"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case "$extrafiles" in
|
||||||
|
*/extr/*) fileopts="${fileopts} -E ${tmp}-ext.c1" ;;
|
||||||
|
esac
|
||||||
|
case "$extrafiles" in
|
||||||
|
*/read/*) fileopts="${fileopts} -R ${tmp}-read.c1" ;;
|
||||||
|
esac
|
||||||
|
case "$extrafiles" in
|
||||||
|
*/write/*) fileopts="${fileopts} -W ${tmp}-write.c1" ;;
|
||||||
|
esac
|
||||||
|
case "$extrafiles" in
|
||||||
|
*/sem/*) fileopts="${fileopts} -S ${tmp}-sem.c1" ;;
|
||||||
|
esac
|
||||||
|
case "$extrafiles" in
|
||||||
|
*/semsw/*) fileopts="${fileopts} -X ${tmp}-semsw.c1" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
${cgen} ${cgendir}/cgen-sim.scm \
|
${cgen} ${cgendir}/cgen-sim.scm \
|
||||||
-s ${cgendir} \
|
-s ${cgendir} \
|
||||||
${cgenflags} \
|
${cgenflags} \
|
||||||
|
@ -121,63 +135,56 @@ cpu | decode | cpu-decode)
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
*cpu*)
|
*cpu*)
|
||||||
sed $sedscript < tmp-cpu.h1 > tmp-cpu.h
|
sed $sedscript < ${tmp}-cpu.h1 > ${tmp}-cpu.h
|
||||||
${rootdir}/move-if-change tmp-cpu.h ${srcdir}/cpu${suffix}.h
|
${rootdir}/move-if-change ${tmp}-cpu.h ${srcdir}/cpu${suffix}.h
|
||||||
sed $sedscript < tmp-cpu.c1 > tmp-cpu.c
|
sed $sedscript < ${tmp}-cpu.c1 > ${tmp}-cpu.c
|
||||||
${rootdir}/move-if-change tmp-cpu.c ${srcdir}/cpu${suffix}.c
|
${rootdir}/move-if-change ${tmp}-cpu.c ${srcdir}/cpu${suffix}.c
|
||||||
sed $sedscript < tmp-mod.c1 > tmp-mod.c
|
sed $sedscript < ${tmp}-mod.c1 > ${tmp}-mod.c
|
||||||
${rootdir}/move-if-change tmp-mod.c ${srcdir}/model${suffix}.c
|
${rootdir}/move-if-change ${tmp}-mod.c ${srcdir}/model${suffix}.c
|
||||||
if test -f tmp-ext.c1 ; then \
|
rm -f ${tmp}-cpu.h1 ${tmp}-cpu.c1 ${tmp}-mod.c1
|
||||||
sed $sedscript < tmp-ext.c1 > tmp-ext.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-ext.c ${srcdir}/extract${suffix}.c ; \
|
|
||||||
fi
|
|
||||||
if test -f tmp-read.c1 ; then \
|
|
||||||
sed $sedscript < tmp-read.c1 > tmp-read.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-read.c ${srcdir}/read${suffix}.c ; \
|
|
||||||
fi
|
|
||||||
if test -f tmp-write.c1 ; then \
|
|
||||||
sed $sedscript < tmp-write.c1 > tmp-write.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-write.c ${srcdir}/write${suffix}.c ; \
|
|
||||||
fi
|
|
||||||
if test -f tmp-sem.c1 ; then \
|
|
||||||
sed $sedscript < tmp-sem.c1 > tmp-sem.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-sem.c ${srcdir}/sem${suffix}.c ; \
|
|
||||||
fi
|
|
||||||
if test -f tmp-semsw.c1 ; then \
|
|
||||||
sed $sedscript < tmp-semsw.c1 > tmp-semsw.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-semsw.c ${srcdir}/sem${suffix}-switch.c ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f tmp-cpu.h1 tmp-cpu.c1
|
|
||||||
rm -f tmp-ext.c1 tmp-read.c1 tmp-write.c1
|
|
||||||
rm -f tmp-sem.c1 tmp-semsw.c1 tmp-mod.c1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
*decode*)
|
*decode*)
|
||||||
sed $sedscript < tmp-dec.h1 > tmp-dec.h
|
sed $sedscript < ${tmp}-dec.h1 > ${tmp}-dec.h
|
||||||
${rootdir}/move-if-change tmp-dec.h ${srcdir}/decode${suffix}.h
|
${rootdir}/move-if-change ${tmp}-dec.h ${srcdir}/decode${suffix}.h
|
||||||
sed $sedscript < tmp-dec.c1 > tmp-dec.c
|
sed $sedscript < ${tmp}-dec.c1 > ${tmp}-dec.c
|
||||||
${rootdir}/move-if-change tmp-dec.c ${srcdir}/decode${suffix}.c
|
${rootdir}/move-if-change ${tmp}-dec.c ${srcdir}/decode${suffix}.c
|
||||||
|
rm -f ${tmp}-dec.h1 ${tmp}-dec.c1
|
||||||
if test -f tmp-sem.c1 ; then \
|
|
||||||
sed $sedscript < tmp-sem.c1 > tmp-sem.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-sem.c ${srcdir}/sem${suffix}.c ; \
|
|
||||||
fi
|
|
||||||
if test -f tmp-semsw.c1 ; then \
|
|
||||||
sed $sedscript < tmp-semsw.c1 > tmp-semsw.c ; \
|
|
||||||
${rootdir}/move-if-change tmp-semsw.c ${srcdir}/sem${suffix}-switch.c ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f tmp-dec.h1 tmp-dec.c1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if test -f ${tmp}-ext.c1 ; then \
|
||||||
|
sed $sedscript < ${tmp}-ext.c1 > ${tmp}-ext.c ; \
|
||||||
|
${rootdir}/move-if-change ${tmp}-ext.c ${srcdir}/extract${suffix}.c ; \
|
||||||
|
rm -f ${tmp}-ext.c1
|
||||||
|
fi
|
||||||
|
if test -f ${tmp}-read.c1 ; then \
|
||||||
|
sed $sedscript < ${tmp}-read.c1 > ${tmp}-read.c ; \
|
||||||
|
${rootdir}/move-if-change ${tmp}-read.c ${srcdir}/read${suffix}.c ; \
|
||||||
|
rm -f ${tmp}-read.c1
|
||||||
|
fi
|
||||||
|
if test -f ${tmp}-write.c1 ; then \
|
||||||
|
sed $sedscript < ${tmp}-write.c1 > ${tmp}-write.c ; \
|
||||||
|
${rootdir}/move-if-change ${tmp}-write.c ${srcdir}/write${suffix}.c ; \
|
||||||
|
rm -f ${tmp}-write.c1
|
||||||
|
fi
|
||||||
|
if test -f ${tmp}-sem.c1 ; then \
|
||||||
|
sed $sedscript < ${tmp}-sem.c1 > ${tmp}-sem.c ; \
|
||||||
|
${rootdir}/move-if-change ${tmp}-sem.c ${srcdir}/sem${suffix}.c ; \
|
||||||
|
rm -f ${tmp}-sem.c1
|
||||||
|
fi
|
||||||
|
if test -f ${tmp}-semsw.c1 ; then \
|
||||||
|
sed $sedscript < ${tmp}-semsw.c1 > ${tmp}-semsw.c ; \
|
||||||
|
${rootdir}/move-if-change ${tmp}-semsw.c ${srcdir}/sem${suffix}-switch.c ; \
|
||||||
|
rm -f ${tmp}-semsw.c1
|
||||||
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
defs)
|
defs)
|
||||||
rm -f tmp-defs.h1 tmp-defs.h
|
rm -f ${tmp}-defs.h1 ${tmp}-defs.h
|
||||||
|
|
||||||
${cgen} ${cgendir}/cgen-sim.scm \
|
${cgen} ${cgendir}/cgen-sim.scm \
|
||||||
-s ${cgendir} \
|
-s ${cgendir} \
|
||||||
|
@ -186,15 +193,16 @@ defs)
|
||||||
-m ${mach} \
|
-m ${mach} \
|
||||||
-a ${archfile} \
|
-a ${archfile} \
|
||||||
-i ${isa} \
|
-i ${isa} \
|
||||||
-G tmp-defs.h1
|
-G ${tmp}-defs.h1
|
||||||
sed $sedscript < tmp-defs.h1 > tmp-defs.h
|
sed $sedscript < ${tmp}-defs.h1 > ${tmp}-defs.h
|
||||||
${rootdir}/move-if-change tmp-defs.h ${srcdir}/defs${suffix}.h
|
${rootdir}/move-if-change ${tmp}-defs.h ${srcdir}/defs${suffix}.h
|
||||||
|
rm -f ${tmp}-defs.h1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
desc)
|
desc)
|
||||||
rm -f tmp-desc.h1 tmp-desc.h
|
rm -f ${tmp}-desc.h1 ${tmp}-desc.h
|
||||||
rm -f tmp-desc.c1 tmp-desc.c
|
rm -f ${tmp}-desc.c1 ${tmp}-desc.c
|
||||||
rm -f tmp-opc.h1 tmp-opc.h
|
rm -f ${tmp}-opc.h1 ${tmp}-opc.h
|
||||||
|
|
||||||
${cgen} ${cgendir}/cgen-opc.scm \
|
${cgen} ${cgendir}/cgen-opc.scm \
|
||||||
-s ${cgendir} \
|
-s ${cgendir} \
|
||||||
|
@ -204,17 +212,17 @@ desc)
|
||||||
-m ${mach} \
|
-m ${mach} \
|
||||||
-a ${archfile} \
|
-a ${archfile} \
|
||||||
-i ${isa} \
|
-i ${isa} \
|
||||||
-H tmp-desc.h1 \
|
-H ${tmp}-desc.h1 \
|
||||||
-C tmp-desc.c1 \
|
-C ${tmp}-desc.c1 \
|
||||||
-O tmp-opc.h1
|
-O ${tmp}-opc.h1
|
||||||
sed $sedscript < tmp-desc.h1 > tmp-desc.h
|
sed $sedscript < ${tmp}-desc.h1 > ${tmp}-desc.h
|
||||||
${rootdir}/move-if-change tmp-desc.h ${srcdir}/${arch}-desc.h
|
${rootdir}/move-if-change ${tmp}-desc.h ${srcdir}/${arch}-desc.h
|
||||||
sed $sedscript < tmp-desc.c1 > tmp-desc.c
|
sed $sedscript < ${tmp}-desc.c1 > ${tmp}-desc.c
|
||||||
${rootdir}/move-if-change tmp-desc.c ${srcdir}/${arch}-desc.c
|
${rootdir}/move-if-change ${tmp}-desc.c ${srcdir}/${arch}-desc.c
|
||||||
sed $sedscript < tmp-opc.h1 > tmp-opc.h
|
sed $sedscript < ${tmp}-opc.h1 > ${tmp}-opc.h
|
||||||
${rootdir}/move-if-change tmp-opc.h ${srcdir}/${arch}-opc.h
|
${rootdir}/move-if-change ${tmp}-opc.h ${srcdir}/${arch}-opc.h
|
||||||
|
|
||||||
rm -f tmp-desc.h1 tmp-desc.c1 tmp-opc.h1
|
rm -f ${tmp}-desc.h1 ${tmp}-desc.c1 ${tmp}-opc.h1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in New Issue