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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [cache_asm.S] - Diff between revs 621 and 970

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

Rev 621 Rev 970
Line 1... Line 1...
#include "spr_defs.h"
#include "spr_defs.h"
 
#include "board.h"
 
 
#define IC_ENABLE 0
#define IC_ENABLE 0
#define DC_ENABLE 0
#define DC_ENABLE 0
 
 
 
#define MC_CSR          (0x00)
 
#define MC_POC          (0x04)
 
#define MC_BA_MASK      (0x08)
 
#define MC_CSC(i)       (0x10 + (i) * 8)
 
#define MC_TMS(i)       (0x14 + (i) * 8)
 
 
 
 
 
        .extern _main
 
 
        .global _ic_enable
        .global _ic_enable
        .global _ic_disable
        .global _ic_disable
        .global _dc_enable
        .global _dc_enable
        .global _dc_disable
        .global _dc_disable
        .global _dc_inv
        .global _dc_inv
        .global _ic_inv_test
        .global _ic_inv_test
        .global _dc_inv_test
        .global _dc_inv_test
 
 
 
        .section .stack
 
        .space 0x1000
 
_stack:
 
 
 
              .section .reset, "ax"
 
 
 
        .org    0x100
 
_reset_vector:
 
        l.addi  r2,r0,0x0
 
        l.addi  r3,r0,0x0
 
        l.addi  r4,r0,0x0
 
        l.addi  r5,r0,0x0
 
        l.addi  r6,r0,0x0
 
        l.addi  r7,r0,0x0
 
        l.addi  r8,r0,0x0
 
        l.addi  r9,r0,0x0
 
        l.addi  r10,r0,0x0
 
        l.addi  r11,r0,0x0
 
        l.addi  r12,r0,0x0
 
        l.addi  r13,r0,0x0
 
        l.addi  r14,r0,0x0
 
        l.addi  r15,r0,0x0
 
        l.addi  r16,r0,0x0
 
        l.addi  r17,r0,0x0
 
        l.addi  r18,r0,0x0
 
        l.addi  r19,r0,0x0
 
        l.addi  r20,r0,0x0
 
        l.addi  r21,r0,0x0
 
        l.addi  r22,r0,0x0
 
        l.addi  r23,r0,0x0
 
        l.addi  r24,r0,0x0
 
        l.addi  r25,r0,0x0
 
        l.addi  r26,r0,0x0
 
        l.addi  r27,r0,0x0
 
        l.addi  r28,r0,0x0
 
        l.addi  r29,r0,0x0
 
        l.addi  r30,r0,0x0
 
        l.addi  r31,r0,0x0
 
 
 
        l.movhi r3,hi(start)
 
        l.ori   r3,r3,lo(start)
 
        l.jr    r3
 
        l.nop
 
start:
 
        l.jal   _init_mc
 
        l.nop
 
 
 
        l.movhi r1,hi(_stack)
 
        l.ori   r1,r1,lo(_stack)
 
 
 
        /* Copy data section */
 
        l.movhi r3,hi(_src_beg)
 
        l.ori   r3,r3,lo(_src_beg)
 
        l.movhi r4,hi(_dst_beg)
 
        l.ori   r4,r4,lo(_dst_beg)
 
        l.movhi r5,hi(_dst_end)
 
        l.ori   r5,r5,lo(_dst_end)
 
        l.sub   r5,r5,r4
 
        l.sfeqi r5,0
 
        l.bf    2f
 
        l.nop
 
1:      l.lwz   r6,0(r3)
 
        l.sw    0(r4),r6
 
        l.addi  r3,r3,4
 
        l.addi  r4,r4,4
 
        l.addi  r5,r5,-4
 
        l.sfgtsi r5,0
 
        l.bf    1b
 
        l.nop
 
2:
 
        l.movhi r2,hi(_main)
 
        l.ori   r2,r2,lo(_main)
 
        l.jr    r2
 
        l.nop
 
 
 
_init_mc:
 
 
 
        l.movhi r3,hi(MC_BASE_ADDR)
 
        l.ori   r3,r3,lo(MC_BASE_ADDR)
 
 
 
        l.addi  r4,r3,MC_CSC(0)
 
        l.movhi r5,hi(FLASH_BASE_ADDR)
 
        l.srai  r5,r5,6
 
        l.ori   r5,r5,0x0025
 
        l.sw    0(r4),r5
 
 
 
        l.addi  r4,r3,MC_TMS(0)
 
        l.movhi r5,hi(FLASH_TMS_VAL)
 
        l.ori   r5,r5,lo(FLASH_TMS_VAL)
 
        l.sw    0(r4),r5
 
 
 
        l.addi  r4,r3,MC_BA_MASK
 
        l.addi  r5,r0,MC_MASK_VAL
 
        l.sw    0(r4),r5
 
 
 
        l.addi  r4,r3,MC_CSR
 
        l.movhi r5,hi(MC_CSR_VAL)
 
        l.ori   r5,r5,lo(MC_CSR_VAL)
 
        l.sw    0(r4),r5
 
 
 
        l.addi  r4,r3,MC_TMS(1)
 
        l.movhi r5,hi(SDRAM_TMS_VAL)
 
        l.ori   r5,r5,lo(SDRAM_TMS_VAL)
 
        l.sw    0(r4),r5
 
 
 
        l.addi  r4,r3,MC_CSC(1)
 
        l.movhi r5,hi(SDRAM_BASE_ADDR)
 
        l.srai  r5,r5,6
 
        l.ori   r5,r5,0x0411
 
        l.sw    0(r4),r5
 
 
 
        l.jr    r9
 
        l.nop
 
 
 
 
 
        .section .text
 
 
_ic_enable:
_ic_enable:
        /* Disable IC */
        /* Disable IC */
        l.mfspr r13,r0,SPR_SR
        l.mfspr r13,r0,SPR_SR
        l.addi  r11,r0,-1
        l.addi  r11,r0,-1
        l.xori  r11,r11,SPR_SR_ICE
        l.xori  r11,r11,SPR_SR_ICE

powered by: WebSVN 2.1.0

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