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] - Blame information for rev 7

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

Line No. Rev Author Line
1 6 jlechner
;; CPU to use for the testsuite. -*- Scheme -*-
2
 
3
(define-arch
4
  (name testsuite) ; name of cpu
5
  (comment ".cpu file for the testsuite")
6
  (insn-lsb0? #t)
7
  (machs testb)
8
  (isas test)
9
)
10
 
11
(define-isa
12
  (name test)
13
  (base-insn-bitsize 16)
14
  (decode-assist (0 1 2 3))
15
)
16
 
17
(define-cpu
18
  (name testf)
19
  (comment "experimental cpu family")
20
  (endian little)
21
  (word-bitsize 32)
22
)
23
 
24
(define-mach
25
  (name testb)
26
  (comment "mach for testsuite")
27
  (cpu testf)
28
)
29
 
30
(define-model
31
  (name test) (comment "test") (attrs)
32
  (mach testb)
33
  ;(pipeline all "" () ((fetch) (decode) (execute) (writeback)))
34
  (unit u-exec "Execution Unit" () 1 1 () () () ())
35
)
36
 
37
;; Some useful pmacros for testcases.
38
 
39
(define-pmacro (newline) (.print "\n"))
40
 
41
;; Record name of test for debugging purposes.
42
 
43
(define-pmacro (test-name name)
44
  (.print "TEST: " name "\n")
45
)
46
 
47
;; Print TEXT as the expected output.
48
 
49
(define-pmacro (print-match text)
50
  (.begin
51
   (.print "MATCH: ")
52
   (.print text)
53
   (newline))
54
)
55
 
56
;; Print EXPR as the text to be verified.
57
 
58
(define-pmacro (print-expr expr)
59
  (.begin
60
   (.print "EXPR: ")
61
   (.dump expr)
62
   (newline))
63
)
64
 
65
;; THUNK is invoked to exercise whatever is being tested.
66
 
67
(define-pmacro (print-thunk thunk)
68
  (.begin
69
   (.print "EXPR: ")
70
   (thunk)
71
   (newline))
72
)
73
 
74
;; Wrapper around .internal-test to include pass/fail messages.
75
(define-pmacro (internal-verify test-name expr)
76
  (.if (.internal-test expr)
77
       (.print "PASS: " test-name "\n")
78
       (.print "FAIL: " test-name "\n"))
79
)

powered by: WebSVN 2.1.0

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