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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [flow_bug.S] - Blame information for rev 57

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
//  The processor illegally skipped an instruction              //
10
//  after a sequence of 3 conditional not-execute               //
11
//  instructions and 1 conditional execute instruction          //
12
//                                                              //
13
//  Author(s):                                                  //
14
//      - Conor Santifort, csantifort.amber@gmail.com           //
15
//                                                              //
16
//////////////////////////////////////////////////////////////////
17
//                                                              //
18
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
19
//                                                              //
20
// This source file may be used and distributed without         //
21
// restriction provided that this copyright statement is not    //
22
// removed from the file and that any derivative work contains  //
23
// the original copyright notice and the associated disclaimer. //
24
//                                                              //
25
// This source file is free software; you can redistribute it   //
26
// and/or modify it under the terms of the GNU Lesser General   //
27
// Public License as published by the Free Software Foundation; //
28
// either version 2.1 of the License, or (at your option) any   //
29
// later version.                                               //
30
//                                                              //
31
// This source is distributed in the hope that it will be       //
32
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
33
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
34
// PURPOSE.  See the GNU Lesser General Public License for more //
35
// details.                                                     //
36
//                                                              //
37
// You should have received a copy of the GNU Lesser General    //
38
// Public License along with this source; if not, download it   //
39
// from http://www.opencores.org/lgpl.shtml                     //
40
//                                                              //
41
*****************************************************************/
42
 
43
#include "amber_registers.h"
44
 
45
 
46
        .section .text
47
        .globl  main
48
main:
49
 
50
        ldr     r6, AdrData1
51
        sub     r6, r6, #4
52
        nop
53
        nop
54
 
55
 
56
@ ------------------------------------------
57
@ Bad sequence
58
@ ------------------------------------------
59
 
60
        ldr     r5, [r6, #4]
61
        cmp     r5, #0
62
        addne   r3, r5, #16
63
        ldmneda r3, {r1,r3}
64
        subne   r1, r3, r1
65
        moveq   r1, r5
66
        ldr     r0, Data2   @ SKIPPED !!!!
67
        bl      check_r0
68
 
69
@ ------------------------------------------
70
@ ------------------------------------------
71
check_r0:
72
        ldr     r7, Data2
73
        cmp     r0, r7
74
        movne   r10, #100
75
        bne     testfail
76
 
77
        b       testpass
78
 
79
 
80
testfail:
81
        ldr     r11, AdrTestStatus
82
        str     r10, [r11]
83
        b       testfail
84
 
85
testpass:
86
        ldr     r11, AdrTestStatus
87
        mov     r10, #17
88
        str     r10, [r11]
89
        b       testpass
90
 
91
 
92
/* Write 17 to this address to generate a Test Passed message */
93
AdrTestStatus:              .word ADR_AMBER_TEST_STATUS
94
AdrData1:                   .word Data1
95
Data1:                      .word 0
96
Data2:                      .word 17
97
 
98
/* ========================================================================= */
99
/* ========================================================================= */
100
 
101
 

powered by: WebSVN 2.1.0

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