OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [cmds/] [memory.c] - Diff between revs 464 and 467

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 464 Rev 467
Line 1... Line 1...
#include "common.h"
#include "common.h"
#include "support.h"
#include "support.h"
#include "spr-defs.h"
#include "spr-defs.h"
#include "spincursor.h"
 
 
 
void show_mem(int start, int stop)
void show_mem(int start, int stop)
{
{
        unsigned long i = start;
        unsigned long i = start;
        if ((i & 0xf) != 0x0)
        if ((i & 0xf) != 0x0)
Line 22... Line 21...
{
{
        unsigned long addr;
        unsigned long addr;
        unsigned long err_addr = 0;
        unsigned long err_addr = 0;
        unsigned long err_no = 0;
        unsigned long err_no = 0;
 
 
        unsigned long stack_top = (unsigned long) &_src_addr;
        unsigned long stack_top = (unsigned long) &_stack_top;
 
 
        if (start_addr < stack_top)
        if (start_addr < stack_top)
        {
        {
                printf("\n");
                printf("\n");
                printf("Warning: RAM test will overwrite stack.\n");
                printf("Warning: RAM test will overwrite stack.\n");
Line 131... Line 130...
        unsigned long addr;
        unsigned long addr;
        unsigned long err_addr = 0;
        unsigned long err_addr = 0;
        unsigned long err_no = 0;
        unsigned long err_no = 0;
        int b;
        int b;
        printf("\nSetting memory contents to all 1'b1  ");
        printf("\nSetting memory contents to all 1'b1  ");
        //enable_spincursor();
 
        for (addr = start_addr; addr <= stop_addr; addr += 1)
        for (addr = start_addr; addr <= stop_addr; addr += 1)
                REG8(addr) = 0xff;
                REG8(addr) = 0xff;
        //disable_spincursor();
 
        printf("\rVerifying memory contents all set to 1'b1:  ");
        printf("\rVerifying memory contents all set to 1'b1:  ");
        //enable_spincursor();
 
        /* Verify */
        /* Verify */
        for (addr = start_addr; addr <= stop_addr; addr += 1) {
        for (addr = start_addr; addr <= stop_addr; addr += 1) {
                if (REG8(addr) != 0xff) {
                if (REG8(addr) != 0xff) {
                        err_no++;
                        err_no++;
                        err_addr = addr;
                        err_addr = addr;
                        //disable_spincursor();
 
                        printf("\n%04lx times failed. Last at location %08lx  ",
                        printf("\n%04lx times failed. Last at location %08lx  ",
                               err_no, err_addr);
                               err_no, err_addr);
                        //enable_spincursor();
 
                }
                }
        }
        }
 
 
        if (err_no == 0)
        if (err_no == 0)
                printf("Passed");
                printf("Passed");

powered by: WebSVN 2.1.0

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