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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [barrel_shift.S] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 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 lsl, ror                                              //
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
 
43
        .section .text
44
        .globl  main
45
main:
46
 
47
/* lsl 0 */
48
        mov     r1, #1
49
        mov     r2, r1, lsl #0
50
        mov     r3, #0x1
51
        cmp     r2, r3
52
        bne     testfail
53
 
54
/* lsl 1 */
55
        mov     r4, #1
56
        mov     r5, r4, lsl #1
57
        mov     r6, #2
58
        cmp     r5, r6
59
        bne     testfail
60
 
61
/* lsl 31 */
62
        mov     r7, #1
63
        mov     r8, r1, lsl #31
64
        mov     r9, #0x80000000
65
        cmp     r8, r9
66
        bne     testfail
67
 
68
/* lsr 1 */
69
        mov     r1, #2
70
        mov     r2, r1, lsr #1
71
        mov     r3, #0x1
72
        cmp     r2, r3
73
        bne     testfail
74
 
75
/* lsr 8 */
76
        mov     r4, #0xff00
77
        mov     r5, r4, lsr #8
78
        cmp     r5, #0xff
79
        bne     testfail
80
 
81
/* ror 8 */
82
        ldr     r6, Data1
83
        mov     r7, r6, ror #8
84
        ldr     r8, Data2
85
        cmp     r7, r8
86
        bne     testfail
87
 
88
 
89
        b       testpass
90
 
91
 
92
testfail:
93
        ldr     r11, AdrTestStatus
94
        str     r10, [r11]
95
        b       testfail
96
 
97
testpass:
98
        ldr     r11, AdrTestStatus
99
        mov     r10, #17
100
        str     r10, [r11]
101
        b       testpass
102
 
103
 
104
/* Write 17 to this address to generate a Test Passed message */
105
AdrTestStatus:  .word  ADR_AMBER_TEST_STATUS
106
Data1:          .word  0x12345678
107
Data2:          .word  0x78123456
108
 
109
/* ========================================================================= */
110
/* ========================================================================= */
111
 
112
 

powered by: WebSVN 2.1.0

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