LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Matjaz Breskvar<phoenix@o...>
    Date: Wed Jun 23 21:54:57 CEST 2004
    Subject: [openrisc] Architecture simulation of basic.S
    Top
    * gurumurt@c... (gurumurt@c...) wrote:
    > I just noticed that the report function is in support.c. But as seen from
    > the traces that I given below, the report function doesnot match with
    > the execution.
    >
    > Here is the execution trace for the last few instructions in the basic.S
    > I have typed in the corresponding instructions in brackets.

    which simulator are you using (output looks unfamiliar to me ?)

    i have something like:

    f0000178: : 03fffffa l.j -6 (executed) [time 902832ns, #161506]
    f000017c: : 9c840004 l.addi r4,r4,0x4 (next insn) (delay insn)
    GPR00: 00000000 GPR01: 00000000 GPR02: 00000000 GPR03: f0001e20
    GPR04: 00001e1c GPR05: 00378014 GPR06: c0378014 GPR07: 00000000
    GPR08: b4600010 GPR09: f0000140 GPR10: 00000000 GPR11: 00000000
    GPR12: 00000000 GPR13: 00000000 GPR14: 00000000 GPR15: 00000000
    GPR16: 00000000 GPR17: 00000000 GPR18: 00000000 GPR19: 00000000
    GPR20: 00000000 GPR21: 00000000 GPR22: 00000000 GPR23: 00000000
    GPR24: 00000000 GPR25: 00000000 GPR26: 00000000 GPR27: 00000000
    GPR28: 00000000 GPR29: 00000000 GPR30: 00000000 GPR31: 00000000 flag: 0
    (sim) t
    f000017c: : 9c840004 l.addi r4,r4,0x4 (executed) [time 902836ns, #161507]
    f0000160: : e4642800 l.sfgeu r4,r5 (next insn)
    GPR00: 00000000 GPR01: 00000000 GPR02: 00000000 GPR03: f0001e20
    GPR04: 00001e20 GPR05: 00378014 GPR06: c0378014 GPR07: 00000000
    GPR08: b4600010 GPR09: f0000140 GPR10: 00000000 GPR11: 00000000
    GPR12: 00000000 GPR13: 00000000 GPR14: 00000000 GPR15: 00000000
    GPR16: 00000000 GPR17: 00000000 GPR18: 00000000 GPR19: 00000000
    GPR20: 00000000 GPR21: 00000000 GPR22: 00000000 GPR23: 00000000
    GPR24: 00000000 GPR25: 00000000 GPR26: 00000000 GPR27: 00000000
    GPR28: 00000000 GPR29: 00000000 GPR30: 00000000 GPR31: 00000000 flag: 0
    (sim)


    > EXECUTED( 565): 040006dc: 0400008a (l.jal _report)
    > GPR 0: 00000000 GPR 1: 00000001 GPR 2: 00000003 GPR 3:
    > deaddead
    > GPR 4: 00000000 GPR 5: 00008001 GPR 6: ffffffff GPR 7: fffffffa
    > GPR 8: 1243f8b2 GPR 9: 040006e4 GPR10: 04000660 GPR11:
    > 000007ff
    > GPR12: 00000fff GPR13: 00001fff GPR14: 00003fff GPR15: 00007fff
    > GPR16: ffff0012 GPR17: ffff0011 GPR18: ffff8010 GPR19: ffffc00f
    > GPR20: ffffe00e GPR21: fffff00d GPR22: fffff80c GPR23: fffffc0b
    > GPR24: fffffe0a GPR25: ffffff09 GPR26: ffffff88 GPR27: ffffffc7
    > GPR28: ffffffe6 GPR29: fffffff5 GPR30: fffffffc GPR31: 00000040
    > SR : 00008001 EPCR0: 040006bc EEAR0: 00000000 ESR0 : 00008001
    >
    > EXECUTED( 566): 040006e0: 15000000 (l.nop 0)
    > GPR 0: 00000000 GPR 1: 00000001 GPR 2: 00000003 GPR 3:
    > deaddead
    > GPR 4: 00000000 GPR 5: 00008001 GPR 6: ffffffff GPR 7: fffffffa
    > GPR 8: 1243f8b2 GPR 9: 040006e4 GPR10: 04000660 GPR11:
    > 000007ff
    > GPR12: 00000fff GPR13: 00001fff GPR14: 00003fff GPR15: 00007fff
    > GPR16: ffff0012 GPR17: ffff0011 GPR18: ffff8010 GPR19: ffffc00f
    > GPR20: ffffe00e GPR21: fffff00d GPR22: fffff80c GPR23: fffffc0b
    > GPR24: fffffe0a GPR25: ffffff09 GPR26: ffffff88 GPR27: ffffffc7
    > GPR28: ffffffe6 GPR29: fffffff5 GPR30: fffffffc GPR31: 00000040
    > SR : 00008001 EPCR0: 040006bc EEAR0: 00000000 ESR0 : 00008001
    >
    > EXECUTED( 567): 04000904: 9c21fffc (l.addi r1,r1,-4)
    > GPR 0: 00000000 GPR 1: fffffffd GPR 2: 00000003 GPR 3: deaddead
    > GPR 4: 00000000 GPR 5: 00008001 GPR 6: ffffffff GPR 7: fffffffa
    > GPR 8: 1243f8b2 GPR 9: 040006e4 GPR10: 04000660 GPR11:
    > 000007ff
    > GPR12: 00000fff GPR13: 00001fff GPR14: 00003fff GPR15: 00007fff
    > GPR16: ffff0012 GPR17: ffff0011 GPR18: ffff8010 GPR19: ffffc00f
    > GPR20: ffffe00e GPR21: fffff00d GPR22: fffff80c GPR23: fffffc0b
    > GPR24: fffffe0a GPR25: ffffff09 GPR26: ffffff88 GPR27: ffffffc7
    > GPR28: ffffffe6 GPR29: fffffff5 GPR30: fffffffc GPR31: 00000040
    > SR : 00008001 EPCR0: 040006bc EEAR0: 00000000 ESR0 : 00008001
    >
    > EXECUTED( 568): 04000908: d4011000 (l.sw 0x0(r1),r2)
    > GPR 0: 00000000 GPR 1: fffffffd GPR 2: 00000003 GPR 3: deaddead
    > GPR 4: 00000000 GPR 5: 00008001 GPR 6: ffffffff GPR 7: fffffffa
    > GPR 8: 1243f8b2 GPR 9: 040006e4 GPR10: 04000660 GPR11:
    > 000007ff
    > GPR12: 00000fff GPR13: 00001fff GPR14: 00003fff GPR15: 00007fff
    > GPR16: ffff0012 GPR17: ffff0011 GPR18: ffff8010 GPR19: ffffc00f
    > GPR20: ffffe00e GPR21: fffff00d GPR22: fffff80c GPR23: fffffc0b
    > GPR24: fffffe0a GPR25: ffffff09 GPR26: ffffff88 GPR27: ffffffc7
    > GPR28: ffffffe6 GPR29: fffffff5 GPR30: fffffffc GPR31: 00000040
    > SR : 00008001 EPCR0: 040006bc EEAR0: 00000000 ESR0 : 00008001
    >
    > EXECUTED( 569): 00000600: 00000000 (l.j 0x0)
    > GPR 0: 00000000 GPR 1: fffffffd GPR 2: 00000003 GPR 3: deaddead
    > GPR 4: 00000000 GPR 5: 00008001 GPR 6: ffffffff GPR 7: fffffffa
    > GPR 8: 1243f8b2 GPR 9: 040006e4 GPR10: 04000660 GPR11:
    > 000007ff
    > GPR12: 00000fff GPR13: 00001fff GPR14: 00003fff GPR15: 00007fff
    > GPR16: ffff0012 GPR17: ffff0011 GPR18: ffff8010 GPR19: ffffc00f
    > GPR20: ffffe00e GPR21: fffff00d GPR22: fffff80c GPR23: fffffc0b
    > GPR24: fffffe0a GPR25: ffffff09 GPR26: ffffff88 GPR27: ffffffc7
    > GPR28: ffffffe6 GPR29: fffffff5 GPR30: fffffffc GPR31: 00000040
    > SR : 00008001 EPCR0: 04000908 EEAR0: fffffffd ESR0 : 00008001
    >
    >
    > There is an execption at 568th instruction, here is the exception
    > message: > "Exception 0x600 (Alignment) at 0x4000908, EA: 0xfffffffd, ppc: > 0x4000908, npc: 0x400090c, #568" > > Why would this exception happen? if you look instruction just above you'll notice a store of r2 to 0-th offest of r1. l.sw 0x0(r1),r2 the problem is that r1 (stack pointer) is incorrent. looks like r1 got corrupted or isn't set in the first place (also possible stack corruption...). can't really see from what you posted... are you trying to compile with frame pointer. if so try with -fomit-frame-pointer. > One more thing here is the report function from support.c. > void report(unsigned long value) > { > asm("l.addi\tr3,%0,0": :"r" (value)); > asm("l.nop %0": :"K" (NOP_REPORT)); > } > > You would notice that these statements do not seem to correspond to > the statements listed above. Am I missing something? can't tell from all this. you are probably seeing a prologue of report() function, (first thing it does is save some registers to stack... but it seams stack pointer is invalid) btw. which toolchain are you using (how old...) best regards, p.

    ReferenceAuthor
    [openrisc] Architecture simulation of basic.SGurumurt

    Follow upAuthor
    [openrisc] Architecture simulation of basic.SDamjan Lampret

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.