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

Subversion Repositories myblaze

[/] [myblaze/] [trunk/] [rtl/] [testbench.c] - Diff between revs 2 and 6

Show entire file | Details | Blame | View Log

Rev 2 Rev 6
Line 1... Line 1...
#include "stdio.h"
#include "stdio.h"
#include <stdio.h>
/*#include <stdio.h>*/
 
#include "xil_printf.c"
char str[] = "Hallo, Welt!\r\n";
char str[] = "Hallo, Welt!\r\n";
/*char str[] = "1";*/
/*[>char str[] = "1";<]*/
 
int fib(int n){
 
    switch (n) {
 
        case 0:
 
            return 0;
 
        case 1:
 
            return 1;
 
        default:
 
            return fib(n-1) + fib(n-2);
 
    }
 
}
int main()
int main()
{
{
 
    char count = 0;
 
    int f = 0;
    volatile char *led = (char *) 0xffffffb0;
    volatile char *led = (char *) 0xffffffb0;
    *led = (char) 0xaa;
while(1) {
    xil_printf(
    *led = (char) count;
 
    count += 1;
 
    xil_printf2(
                /*"02"*/
                /*"02"*/
            "0:Hello, world!\r\n"
            "0:Hello, world!\r\n"
            "1:Hello, world!\r\n"
            "1:Hello, world!\r\n"
            "2:Hello, world!\r\n"
 
            "3:Hello, world!\r\n"
 
            "4:Hello, world!\r\n"
 
            "5:Hello, world!\r\n"
 
            "6:Hello, world!\r\n"
 
            "7:Hello, world!\r\n"
 
            "8:Hello, world!\r\n"
 
            "9:Hello, world!\r\n"
 
            "a:Hello, world!\r\n"
 
            "b:Hello, world!\r\n"
 
            "c:Hello, world!\r\n"
 
            "d:Hello, world!\r\n"
 
            "e:Hello, world!\r\n"
 
            "f:Hello, world!\r\n"
 
    );
    );
    xil_printf(str);
    xil_printf2(str);
    *led = (char) 0xff;
    f = fib(15);
 
    if (f == 610)
 
        /*xil_printf2("Okey\r\n");*/
 
        xil_printf2("0x%x\r\n", f);
 
    else
 
        xil_printf2("Error\r\n");
 
    xil_printf2(str);
 
}
    return 0;
    return 0;
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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