+2000-12-04 Frank Ch. Eigler <fche@redhat.com>
+
+ * utils-sim.scm (gen-define-argbuf-macro): Handle sfmt=#f case, to be
+ used by simple/non-scache simulators.
+ * sim-cpu.scm (-gen-read-case): Call gen-define/undef-field-macro
+ regardless of with-scache?.
+ (-gen-write-case, -gen-no-scache-semantic-fn, -gen-sem-case): Ditto.
+
2000-12-03 Ben Elliston <bje@redhat.com>
* desc-cpu.scm (cgen-desc.h): Clarify generated filenames.
" CASE (read, READ_" (string-upcase (gen-sym sfmt)) ") : "
"/* " (obj:comment sfmt) " */\n"
" {\n"
- (if (with-scache?)
- (gen-define-field-macro sfmt)
- "")
+ (gen-define-field-macro (if (with-scache?) sfmt #f))
(gen-define-parallel-operand-macro sfmt)
(gen-define-ifields (sfmt-iflds sfmt) (sfmt-length sfmt) " " #f)
(gen-extract-ifields (sfmt-iflds sfmt) (sfmt-length sfmt) " " #f)
(-gen-read-args sfmt)
(gen-undef-parallel-operand-macro sfmt)
- (if (with-scache?)
- (gen-undef-field-macro sfmt)
- "")
+ (gen-undef-field-macro sfmt)
" }\n"
" BREAK (read);\n\n"
)
/indent
" const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;\n")
"")
- (if (with-scache?)
- (gen-define-field-macro sfmt)
- "")
+ (gen-define-field-macro (if (with-scache?) sfmt #f))
(gen-define-parallel-operand-macro sfmt)
/indent
" int UNUSED written = abuf->written;\n"
(string-list /indent " SEM_BRANCH_FINI (vpc);\n")
"")
(gen-undef-parallel-operand-macro sfmt)
- (if (with-scache?)
- (gen-undef-field-macro sfmt)
- "")
+ (gen-undef-field-macro sfmt)
/indent " }\n"
(if insn
(string-list /indent " NEXT (vpc);\n")
"")
" SEM_STATUS status = 0;\n" ; ??? wip
" ARGBUF *abuf = SEM_ARGBUF (sem_arg);\n"
+ (gen-define-field-macro (if (with-scache?) (insn-sfmt insn) #f))
; Unconditionally written operands are not recorded here.
" int UNUSED written = 0;\n"
" IADDR UNUSED pc = GET_H_PC ();\n"
(gen-bool-attrs (obj-atlist insn) gen-attr-mask)
");\n")
"")
+ (gen-undef-field-macro (insn-sfmt insn))
" return status;\n"
(if (and parallel? (not (with-generic-write?)))
(gen-undef-parallel-operand-macro (insn-sfmt insn))
"{\n"
" SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);\n"
" ARGBUF *abuf = SEM_ARGBUF (sem_arg);\n"
- (if (with-scache?)
- (gen-define-field-macro (insn-sfmt insn))
- "")
+ (gen-define-field-macro (if (with-scache?) (insn-sfmt insn) #f))
(if (and parallel? (not (with-generic-write?)))
(gen-define-parallel-operand-macro (insn-sfmt insn))
"")
(if (and parallel? (not (with-generic-write?)))
(gen-undef-parallel-operand-macro (insn-sfmt insn))
"")
- (if (with-scache?)
- (gen-undef-field-macro (insn-sfmt insn))
- "")
+ (gen-undef-field-macro (insn-sfmt insn))
"}\n"
" NEXT (vpc);\n\n"
))
; Name of macro to access fields in ARGBUF.
(define c-argbuf-macro "FLD")
+; NB: If sfmt is #f, then define the macro to pass through the argument
+; symbol. This is appropriate for "simple" (non-scache) simulators
+; that have no abuf/scache in the sem.c routines, but rather plain
+; local variables.
(define (gen-define-argbuf-macro sfmt)
(string-append "#define " c-argbuf-macro "(f) "
- "abuf->fields."
- (gen-sym (sfmt-sbuf sfmt))
- ".f\n")
+ (if sfmt
+ (string-append
+ "abuf->fields."
+ (gen-sym (sfmt-sbuf sfmt))
+ ".f\n")
+ "f\n"))
)
(define (gen-undef-argbuf-macro sfmt)