OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [testsuite/] [testsuite.cpu] - Rev 7

Go to most recent revision | Compare with Previous | Blame | View Log

;; CPU to use for the testsuite. -*- Scheme -*-

(define-arch
  (name testsuite) ; name of cpu
  (comment ".cpu file for the testsuite")
  (insn-lsb0? #t)
  (machs testb)
  (isas test)
)

(define-isa
  (name test)
  (base-insn-bitsize 16)
  (decode-assist (0 1 2 3))
)
  
(define-cpu
  (name testf)
  (comment "experimental cpu family")
  (endian little)
  (word-bitsize 32)
)

(define-mach
  (name testb)
  (comment "mach for testsuite")
  (cpu testf)
)

(define-model
  (name test) (comment "test") (attrs)
  (mach testb)
  ;(pipeline all "" () ((fetch) (decode) (execute) (writeback)))
  (unit u-exec "Execution Unit" () 1 1 () () () ())
)

;; Some useful pmacros for testcases.

(define-pmacro (newline) (.print "\n"))

;; Record name of test for debugging purposes.

(define-pmacro (test-name name)
  (.print "TEST: " name "\n")
)

;; Print TEXT as the expected output.

(define-pmacro (print-match text)
  (.begin
   (.print "MATCH: ")
   (.print text)
   (newline))
)

;; Print EXPR as the text to be verified.

(define-pmacro (print-expr expr)
  (.begin
   (.print "EXPR: ")
   (.dump expr)
   (newline))
)

;; THUNK is invoked to exercise whatever is being tested.

(define-pmacro (print-thunk thunk)
  (.begin
   (.print "EXPR: ")
   (thunk)
   (newline))
)

;; Wrapper around .internal-test to include pass/fail messages.
(define-pmacro (internal-verify test-name expr)
  (.if (.internal-test expr)
       (.print "PASS: " test-name "\n")
       (.print "FAIL: " test-name "\n"))
)

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.