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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [tst.S] - Blame information for rev 82

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

Line No. Rev Author Line
1 82 csantifort
/*****************************************************************
2
//                                                              //
3
//  Amber 2 Core Instruction Test                               //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  Tests add with carry                                        //
10
//                                                              //
11
//  Author(s):                                                  //
12
//      - Conor Santifort, csantifort.amber@gmail.com           //
13
//                                                              //
14
//////////////////////////////////////////////////////////////////
15
//                                                              //
16
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
17
//                                                              //
18
// This source file may be used and distributed without         //
19
// restriction provided that this copyright statement is not    //
20
// removed from the file and that any derivative work contains  //
21
// the original copyright notice and the associated disclaimer. //
22
//                                                              //
23
// This source file is free software; you can redistribute it   //
24
// and/or modify it under the terms of the GNU Lesser General   //
25
// Public License as published by the Free Software Foundation; //
26
// either version 2.1 of the License, or (at your option) any   //
27
// later version.                                               //
28
//                                                              //
29
// This source is distributed in the hope that it will be       //
30
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
31
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
32
// PURPOSE.  See the GNU Lesser General Public License for more //
33
// details.                                                     //
34
//                                                              //
35
// You should have received a copy of the GNU Lesser General    //
36
// Public License along with this source; if not, download it   //
37
// from http://www.opencores.org/lgpl.shtml                     //
38
//                                                              //
39
*****************************************************************/
40
 
41
#include "amber_registers.h"
42
#include "amber_macros.h"
43
 
44
        .section .text
45
        .globl  main
46
main:
47
        // sets all four flags
48
        // Cant use p version of instrustion in 32-bit CPU because it writes the upper 4 bits of PC
49
        teqp    pc, #0xf0000000
50
 
51
        //
52
        // Check that they are set
53
        bvc     testfail  // V flag
54
        bpl     testfail  // N flag
55
        bne     testfail  // Z flag
56
        bcc     testfail  // C flag
57
 
58
        mov     r1, #0
59
 
60
        // should not unset the V flag value
61
        tst     r1, #0
62
 
63
        // Check the V flag and Z flag are still set, the C flag
64
        // gets the carry out value from the barrel shifter, which is
65
        // the C flag in this case, and the N flag gets cleared
66
        bvc     testfail
67
        bne     testfail
68
        bcc     testfail
69
        bmi     testfail
70
 
71
        // Test "Strange issue with r12 after TEQLSP"
72
        mov     r1,  #0x1
73
        mov     r2,  #0x1
74
        mov     r8,  #0
75
        mov     r6,  #10
76
        mov     r10, #13
77
        mov     r12, #100
78
        nop
79
 
80
        add     r6,  r6,#1
81
        cmp     r6,  r8
82
        ldrls   r3,  [r9,r6,lsl #2]
83
        movls   r4,  r11
84
        movhi   r3,  #0
85
        teqp  r1,  r2 // r1 XOR r2 = 0x1 -> sets the mode bits of the PC to 1
86
        mov     r12, r6 // normal r12 or FIRQ r12 ?
87
 
88
        b       testpass
89
 
90
testfail:
91
        ldr     r11, AdrTestStatus
92
        str     r10, [r11]
93
        b       testfail
94
 
95
testpass:
96
        ldr     r11, AdrTestStatus
97
        mov     r10, #17
98
        str     r10, [r11]
99
        b       testpass
100
 
101
 
102
AdrTestStatus:  .word  ADR_AMBER_TEST_STATUS
103
 

powered by: WebSVN 2.1.0

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