+2000-12-01 Ben Elliston <bje@redhat.com>
+
+ * sim-cpu.scm (cgen-cpu.h): Only emit argbuf, scache and extract
+ definitions if run without with-multipla-isa?.
+ (cgen-defs.h): New function. Emit an ISA-specific defs file.
+ * cgen-sim.scm (sim-arguments): Accept -G option to generate defs.
+
2000-11-24 Ben Elliston <bje@redhat.com>
* sim-cpu.scm (-gen-hardware-struct): New function.
; Simulator generator entry point.
; This is invoked to build: arch.h, cpu-<cpu>.h, memops.h, semops.h, decode.h,
-; decode.c, extract.c, semantics.c, ops.c, model.c, mainloop.in.
+; decode.c, defs.h, extract.c, semantics.c, ops.c, model.c, mainloop.in.
;
; memops.h, semops.h, ops.c, mainloop.in are either deprecated or wip.
;
(lambda (arg) (file-write arg cgen-cpuall.h)))
(list '-F "file" "generate memops.h in <file>"
(lambda (arg) (file-write arg cgen-mem-ops.h)))
+ (list '-G "file" "generate defs.h in <file>"
+ (lambda (arg) (file-write arg cgen-defs.h)))
(list '-P "file" "generate semops.h in <file>"
(lambda (arg) (file-write arg cgen-sem-ops.h)))
(list '-T "file" "generate decode.h in <file>"
-gen-hardware-types
-gen-cpu-reg-access-decls
-gen-model-decls
- (lambda () (gen-argbuf-type #t))
- (lambda () (gen-scache-type #t))
- -gen-extract-macros
+
+ (if (not (with-multiple-isa?))
+ (string-list
+ (lambda () (gen-argbuf-type #t))
+ (lambda () (gen-scache-type #t))
+ -gen-extract-macros)
+ "")
+
(if (and (with-parallel?) (not (with-generic-write?)))
-gen-parallel-exec-type
"")
)
)
+; Generate defs-<isa>.h.
+
+(define (cgen-defs.h)
+ (logit 1 "Generating " (obj:name (current-isa)) " defs.h ...\n")
+
+ (sim-analyze-insns!)
+
+ ; Tell the rtl->c translator we're not the simulator.
+ ; ??? Minimizes changes in generated code until this is changed.
+ ; RTL->C happens for field decoding.
+ (rtl-c-config! #:rtl-cover-fns? #f)
+
+ (string-write
+ (gen-copyright (string-append
+ "ISA definitions header for "
+ (obj:name (current-isa))
+ ".")
+ CURRENT-COPYRIGHT CURRENT-PACKAGE)
+ "\
+#ifndef DEFS_@PREFIX@_H
+#define DEFS_@PREFIX@_H
+
+"
+ (lambda () (gen-argbuf-type #t))
+ (lambda () (gen-scache-type #t))
+ -gen-extract-macros
+
+ "#endif /* DEFS_@PREFIX@_H */\n"
+ )
+)
+
; Generate cpu-<cpu>.c
(define (cgen-cpu.c)