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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [testbench/] [cache.c] - Diff between revs 574 and 575

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

Rev 574 Rev 575
Line 37... Line 37...
void dummy();
void dummy();
 
 
void jump_and_link(void)
void jump_and_link(void)
{
{
        asm("_jalr:");
        asm("_jalr:");
 
  asm("l.jr\tr9");
 
  asm("l.nop");
}
}
 
 
void jump(void)
void jump(void)
{
{
        asm("_jr:");
        asm("_jr:");
Line 51... Line 53...
        /* Load next executin address from table */
        /* Load next executin address from table */
        asm("l.lwz\t\tr3,0(r3)");
        asm("l.lwz\t\tr3,0(r3)");
        /* Jump to that address */
        /* Jump to that address */
        asm("l.jr\t\tr3") ;
        asm("l.jr\t\tr3") ;
        /* Report that we succeeded */
        /* Report that we succeeded */
        asm("l.nop\t1");
        asm("l.nop\t2");
}
}
 
 
void copy_jr(unsigned long add)
void copy_jr(unsigned long add)
{
{
        memcpy((void *)add, (void *)&jr, 24);
        memcpy((void *)add, (void *)&jr, 24);
Line 63... Line 65...
 
 
void call(unsigned long add)
void call(unsigned long add)
{
{
  asm("l.movhi\tr11,hi(_jump_indx)" : :);
  asm("l.movhi\tr11,hi(_jump_indx)" : :);
  asm("l.ori\tr11,r11,lo(_jump_indx)" : :);
  asm("l.ori\tr11,r11,lo(_jump_indx)" : :);
        asm("l.jr\t\t%0" : : "r" (add) : "r11");
        asm("l.jalr\t\t%0" : : "r" (add) : "r11", "r9");
        asm("l.nop" : :);
        asm("l.nop" : :);
}
}
 
 
void icache_enable(void)
void icache_enable(void)
{
{
Line 265... Line 267...
 
 
           This test can not be run on or1ksim. */
           This test can not be run on or1ksim. */
        rc = ic_test();
        rc = ic_test();
        report(rc);
        report(rc);
 
 
 
        exit(0);
 
 
        return 0;
        return 0;
}
}
 
 
/* just for size calculation */
/* just for size calculation */
void dummy()
void dummy()

powered by: WebSVN 2.1.0

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