From 13589168a7cacbb9ea59ffd52eb8b416bcf0c16a Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 13 Oct 2000 11:21:57 +0000 Subject: [PATCH] * cleanup 2000-10-13 matthew green * utils-cgen.scm (get-ifetch): Move from here ... * sim.scm (get-ifetch): ... to here. --- ChangeLog | 5 +++++ sim.scm | 18 ++++++++++++++++++ utils-cgen.scm | 16 ---------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77051d8..daaf379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-10-13 matthew green + + * utils-cgen.scm (get-ifetch): Move from here ... + * sim.scm (get-ifetch): ... to here. + 2000-10-06 Dave Brolley * utils-gen.scm (-gen-ifld-extract-base): Compute start position as diff --git a/sim.scm b/sim.scm index 9907410..ec38976 100644 --- a/sim.scm +++ b/sim.scm @@ -152,6 +152,24 @@ (string-append c-cpu-macro " (" sym ")") ) + +; Return C code to fetch a value from instruction memory. +; PC-VAR is the C expression containing the address of the start of the +; instruction. +; ??? Aligned/unaligned support? + +(define (gen-ifetch pc-var bitoffset bitsize) + (string-append "GETIMEM" + (case bitsize + ((8) "UQI") + ((16) "UHI") + ((32) "USI") + (else (error "bad bitsize argument to gen-ifetch" bitsize))) + " (current_cpu, " + pc-var " + " (number->string (quotient bitoffset 8)) + ")") +) + ; Instruction field support code. ; Return a object of the value of an ifield. diff --git a/utils-cgen.scm b/utils-cgen.scm index 5d3f24c..240cc61 100644 --- a/utils-cgen.scm +++ b/utils-cgen.scm @@ -624,22 +624,6 @@ ";} while (0)\n") ) -; Return C code to fetch a value from instruction memory. -; PC-VAR is the C expression containing the address of the start of the -; instruction. -; ??? Aligned/unaligned support? - -(define (gen-ifetch pc-var bitoffset bitsize) - (string-append "GETIMEM" - (case bitsize - ((8) "UQI") - ((16) "UHI") - ((32) "USI") - (else (error "bad bitsize argument to gen-ifetch" bitsize))) - " (current_cpu, " - pc-var " + " (number->string (quotient bitoffset 8)) - ")") -) ; Called before loading the .cpu file to initialize. -- 2.43.5