|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
how to run hello world in on-chip ram?hi all,
I have a altera FPGA board with Cyclone II EP2c35 and synthesize the orp_soc following the hardware tutorials. I have only one dedicated JTAG for FPGA and have no pins for or1k CPU. So I want to burn the "hello world" program into on-chip ram by initializing this memory, that is, let the JTAG download the all the CPU and program . so there are two questions for help: 1) how to set start pointer of the reset.S and let the "hello world" run. 2) I find the hello.hex in or1k is incompatible with Intel hex format of altera memory. how can I convert it to altera memory format? Is there anybody using altera FPGA? Please give me some directions . Thanks a lot ! _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
RE: how to run hello world in on-chip ram?1) The CPU always vectors to 0x100 on reset so you will either need some
sort of bootstrap there or you will have to map RAM which you can download to there. 2) You can always get to intelhex from the ELF file using: or32-uclinux-objcopy -S -O ihex <ELFfile> <ihexfile> Robert Cragie, Design Engineer _______________________________________________________________ Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK http://www.jennic.com Tel: +44 (0) 114 281 2655 _______________________________________________________________ > -----Original Message----- > From: openrisc-bounces@... > [mailto:openrisc-bounces@...]On Behalf Of charlie yang > Sent: 19 November 2007 04:17 > To: openrisc@... > Subject: [openrisc] how to run hello world in on-chip ram? > > > hi all, > I have a altera FPGA board with Cyclone II EP2c35 and synthesize the > orp_soc following the hardware tutorials. I have only one dedicated > JTAG for FPGA and have no pins for or1k CPU. So I want to burn > the "hello world" program into on-chip ram by initializing this memory, > that is, let the JTAG download the all the CPU and program . > so there are two questions for help: > 1) how to set start pointer of the reset.S and let the "hello > world" run. > 2) I find the hello.hex in or1k is incompatible with Intel hex > format of > altera memory. how can I convert it to altera memory format? > > Is there anybody using altera FPGA? Please give me some directions . > Thanks a lot ! > _______________________________________________ > http://www.opencores.org/mailman/listinfo/openrisc _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram? Thanks Robert.
I use the or1k/hello-uart as my example. use or32-uclinux-objcopy to get a hello.hex and initialize the on-chip ram. When use modelsim to do rtl simulation, I find the on-chip ram input address(wb_ss_adr_i) repeat like 0x100,0x000,0x104,0x00,0x100,0x000,0x104,0x000. and the ouput data (wb_ss_dat_o) is always zero. In the hello-uart, there is no FLASH,no Memory controller and no cache. I don't know if my reset.S is incorrect or hex files is incorrect. Please give me some hints. Thanks! Here is my reset.S in hello-uart directory: .global ___main .section .stack /*, "aw", @nobits*/ .space STACK_SIZE _stack: .section .vectors, "ax" .org 0x100 _reset_vector: l.nop l.nop 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(SDRAM_BASE_ADDR) l.ori r3,r3,lo(SDRAM_BASE_ADDR) l.addi r5,r0,0x00 l.sw 0(r3),r5 l.movhi r3,hi(_start) l.ori r3,r3,lo(_start) l.jr r3 l.nop .section .text _start: l.movhi r1,hi(_stack-4) l.ori r1,r1,lo(_stack-4) l.addi r2,r0,-3 l.and r1,r1,r2 l.movhi r2,hi(_main) l.ori r2,r2,lo(_main) l.jr r2 l.nop ___main: l.jr r9 l.nop Then I use the following step to generate hex file: or32-uclinux-gcc -g -c -o reset.o reset.S or32-uclinux-ld -Tram.ld -o hello.or32 reset.o hello.o or32-uclinux-objcopy -O binary hello.or32 hello.bin or32-uclinux-objcopy -S -O ihex hello.or32 hello.hex ----- Original Message ----- From: Robert Cragie<rcc@j...> To: Date: Mon Nov 19 09:24:52 CET 2007 Subject: [openrisc] how to run hello world in on-chip ram? > 1) The CPU always vectors to 0x100 on reset so you will either need > some > sort of bootstrap there or you will have to map RAM which you can > download > to there. > 2) You can always get to intelhex from the ELF file using: > or32-uclinux-objcopy -S -O ihex <ELFfile> <ihexfile> > Robert Cragie, Design Engineer > _____________________________________________________________ __ > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > http://www.jennic.com Tel: +44 (0) 114 281 2655 > _____________________________________________________________ __ > > -----Original Message----- > > From: openrisc-bounces at opencores.org > > [mailto:openrisc-bounces at opencores.org]On Behalf Of charlie > yang > > Sent: 19 November 2007 04:17 > > To: openrisc at opencores.org > > Subject: [openrisc] how to run hello world in on-chip ram? > > > > > > hi all, > > I have a altera FPGA board with Cyclone II EP2c35 and > synthesize the > > orp_soc following the hardware tutorials. I have only one > dedicated > > JTAG for FPGA and have no pins for or1k CPU. So I want to burn > > the "hello world" program into on-chip ram by > initializing this memory, > > that is, let the JTAG download the all the CPU and program . > > so there are two questions for help: > > 1) how to set start pointer of the reset.S and let the > "hello > > world" run. > > 2) I find the hello.hex in or1k is incompatible with Intel hex > > format of > > altera memory. how can I convert it to altera memory format? > > > > Is there anybody using altera FPGA? Please give me some > directions . > > Thanks a lot ! > > _______________________________________________ > > http://www.opencores.org/mailman/listinfo/openrisc > > http://www.opencores.org/mailman/listinfo/openrisc |
|
|
RE: how to run hello world in on-chip ram?It seems like you're not initialising your on chip RAM correctly, or it is
not configured correctly in your design as you'd expect to see 0x15000000 (l.nop) on the memory bus as it starts running. Are you offsetting by 0x100 correctly? Also, I'm not sure what SDRAM_BASE_ADDR points to either - you may want to remove that part. Robert Cragie, Design Engineer _______________________________________________________________ Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK http://www.jennic.com Tel: +44 (0) 114 281 2655 _______________________________________________________________ > -----Original Message----- > From: charlie yang [mailto:ydt@...] > Sent: 20 November 2007 10:35 > To: rcc@...; openrisc@... > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > Thanks Robert. > > I use the or1k/hello-uart as my example. use or32-uclinux-objcopy to > > get a hello.hex and initialize the on-chip ram. When use modelsim to do > > rtl simulation, I find the on-chip ram input address(wb_ss_adr_i) repeat > > like 0x100,0x000,0x104,0x00,0x100,0x000,0x104,0x000. and the ouput > > data (wb_ss_dat_o) is always zero. > > > > In the hello-uart, there is no FLASH,no Memory controller and no > > cache. I don't know if my reset.S is incorrect or hex files is incorrect. > > Please give me some hints. Thanks! > > > > Here is my reset.S in hello-uart directory: > > .global ___main > > .section .stack /*, "aw", @nobits*/ > > .space STACK_SIZE > > _stack: > > > > .section .vectors, "ax" > > .org 0x100 > > > > _reset_vector: > > l.nop > > l.nop > > 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(SDRAM_BASE_ADDR) > > l.ori r3,r3,lo(SDRAM_BASE_ADDR) > > l.addi r5,r0,0x00 > > l.sw 0(r3),r5 > > l.movhi r3,hi(_start) > > l.ori r3,r3,lo(_start) > > l.jr r3 > > l.nop > > .section .text > > > > _start: > > l.movhi r1,hi(_stack-4) > > l.ori r1,r1,lo(_stack-4) > > l.addi r2,r0,-3 > > l.and r1,r1,r2 > > > > l.movhi r2,hi(_main) > > l.ori r2,r2,lo(_main) > > l.jr r2 > > l.nop > > > > ___main: > > l.jr r9 > > l.nop > > > > Then I use the following step to generate hex file: > > or32-uclinux-gcc -g -c -o reset.o reset.S > > or32-uclinux-ld -Tram.ld -o hello.or32 reset.o hello.o > > or32-uclinux-objcopy -O binary hello.or32 hello.bin > > or32-uclinux-objcopy -S -O ihex hello.or32 hello.hex > > > > > > ----- Original Message ----- > > From: Robert Cragie<rcc@j...> > > To: > > Date: Mon Nov 19 09:24:52 CET 2007 > > Subject: [openrisc] how to run hello world in on-chip ram? > > > > > 1) The CPU always vectors to 0x100 on reset so you will either need > > > some > > > sort of bootstrap there or you will have to map RAM which you can > > > download > > > to there. > > > 2) You can always get to intelhex from the ELF file using: > > > or32-uclinux-objcopy -S -O ihex <ELFfile> <ihexfile> > > > Robert Cragie, Design Engineer > > > > > _____________________________________________________________ > > __ > > > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > > > http://www.jennic.com Tel: +44 (0) 114 281 2655 > > > > > _____________________________________________________________ > > __ > > > > -----Original Message----- > > > > From: openrisc-bounces at opencores.org > > > > [mailto:openrisc-bounces at opencores.org]On Behalf Of charlie > > > yang > > > > Sent: 19 November 2007 04:17 > > > > To: openrisc at opencores.org > > > > Subject: [openrisc] how to run hello world in on-chip ram? > > > > > > > > > > > > hi all, > > > > I have a altera FPGA board with Cyclone II EP2c35 and > > > synthesize the > > > > orp_soc following the hardware tutorials. I have only one > > > dedicated > > > > JTAG for FPGA and have no pins for or1k CPU. So I want to burn > > > > the "hello world" program into on-chip ram by > > > initializing this memory, > > > > that is, let the JTAG download the all the CPU and program . > > > > so there are two questions for help: > > > > 1) how to set start pointer of the reset.S and let the > > > "hello > > > > world" run. > > > > 2) I find the hello.hex in or1k is incompatible with Intel hex > > > > format of > > > > altera memory. how can I convert it to altera memory format? > > > > > > > > Is there anybody using altera FPGA? Please give me some > > > directions . > > > > Thanks a lot ! > > > > _______________________________________________ > > > > http://www.opencores.org/mailman/listinfo/openrisc > > > > > > _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram?Hi,Roboert,
I don't know if the hello.hex is not suit for the altera ram. I use a single port ram with 4kx32bit. and set the ram.ld as: MEMORY { vectors : ORIGIN = 0x00000000, LENGTH = 0x000000200 ram : ORIGIN = 0x000000200, LENGTH = 0x000000f00 - 0x0000200 } when initializing the ram, i use the content offset to 0x100 in hello.hex and cut the no useful information before address 0x100 ,which all is zero. In simulation, Ithe pc value (equal to wb_ss_adr_i) vs wb_ss_dat_o is: pc dat_o 0x000 15000000 0x100 9e000000 0x104 9e200000 0x108 9e400000 ... 0x11c 9ee00000 0x120 Hiz here cpu will report Starting exception: 7 utill pc run 128, pc will jump to 0x700 ,then 0x704, and will repeat 0x700,0x704 forever. the wb_ss_dat_o value is always 15000000. what happen to this? here is my chopped hello.hex: :2000000015000000150000009C4000009C6000009C8000009CA000009CC 000009CE00000AE :200020009D0000009D2000009D4000009D6000009D8000009DA000009DC 000009DE0000058 :200040009E0000009E2000009E4000009E6000009E8000009EA000009EC0 00009EE0000030 :200060009F0000009F2000009F4000009F6000009F8000009FA000009FC0 00009FE0000008 :2000800018200000A82135529C40FFFDE021100318400000A8422450440 010009C40000006 :2000A0004400480015000000000000000000000000000000000000000000 0000000000009F :2000C0000000000000000000000000000000000000000000000000000000 00000000000020 :2000E0000000000000000000000000000000000000000000000000000000 00000000000000 :200100000000000000000000000000000000000000000000000000000000 000000000000DF :200120000000000000000000000000000000000000000000000000000000 000000000000BF :200140000000000000000000000000000000000000000000000000000000 0000000000009F :200160000000000000000000000000000000000000000000000000000000 0000000000007F :200180000000000000000000000000000000000000000000000000000000 0000000000005F :2001A0000000000000000000000000000000000000000000000000000000 0000000000003F :2001C0000000000000000000000000000000000000000000000000000000 0000000000001F :2001E0000000000000000000000000000000000000000000000000000000 000000000000FF :200200000000000000000000000000000000000000000000000000000000 000000000000DE :200220000000000000000000000000000000000000000000000000000000 000000000000BE :200240000000000000000000000000000000000000000000000000000000 0000000000009E :200260000000000000000000000000000000000000000000000000000000 0000000000007E :200280000000000000000000000000000000000000000000000000000000 0000000000005E :2002A0000000000000000000000000000000000000000000000000000000 0000000000003E :2002C0000000000000000000000000000000000000000000000000000000 0000000000001E :2002E0000000000000000000000000000000000000000000000000000000 000000000000FE :200300000000000000000000000000000000000000000000000000000000 000000000000DD :200320000000000000000000000000000000000000000000000000000000 000000000000BD :200340000000000000000000000000000000000000000000000000000000 0000000000009D :200360000000000000000000000000000000000000000000000000000000 0000000000007D :200380000000000000000000000000000000000000000000000000000000 0000000000005D :2003A0000000000000000000000000000000000000000000000000000000 0000000000003D :2003C0000000000000000000000000000000000000000000000000000000 0000000000001D :2003E0000000000000000000000000000000000000000000000000000000 000000000000FD :200400000000000000000000000000000000000000000000000000000000 000000000000DC :200420000000000000000000000000000000000000000000000000000000 000000000000BC :200440000000000000000000000000000000000000000000000000000000 0000000000009C :200460000000000000000000000000000000000000000000000000000000 0000000000007C :200480000000000000000000000000000000000000000000000000000000 0000000000005C :2004A0000000000000000000000000000000000000000000000000000000 0000000000003C :2004C0000000000000000000000000000000000000000000000000000000 0000000000001C :2004E0000000000000000000000000000000000000000000000000000000 000000000000FC :200500000000000000000000000000000000000000000000000000000000 000000000000DB :200520000000000000000000000000000000000000000000000000000000 000000000000BB :200540000000000000000000000000000000000000000000000000000000 0000000000009B :200560000000000000000000000000000000000000000000000000000000 0000000000007B :200580000000000000000000000000000000000000000000000000000000 0000000000005B :2005A0000000000000000000000000000000000000000000000000000000 0000000000003B :2005C0000000000000000000000000000000000000000000000000000000 0000000000001B :2005E0000000000000000000000000000000000000000000000000000000 000000000000FB :200600000000000000000000000000000000000000000000000000000000 000000000000DA :200620000000000000000000000000000000000000000000000000000000 000000000000BA :200640000000000000000000000000000000000000000000000000000000 0000000000009A :200660000000000000000000000000000000000000000000000000000000 0000000000007A :200680000000000000000000000000000000000000000000000000000000 0000000000005A :2006A0000000000000000000000000000000000000000000000000000000 0000000000003A :2006C0000000000000000000000000000000000000000000000000000000 0000000000001A :2006E0000000000000000000000000000000000000000000000000000000 000000000000FA :200700000000000000000000000000000000000000000000000000000000 000000000000D9 :200720000000000000000000000000000000000000000000000000000000 000000000000B9 :200740000000000000000000000000000000000000000000000000000000 00000000000099 :200760000000000000000000000000000000000000000000000000000000 00000000000079 :200780000000000000000000000000000000000000000000000000000000 00000000000059 :2007A0000000000000000000000000000000000000000000000000000000 00000000000039 :2007C0000000000000000000000000000000000000000000000000000000 00000000000019 :2007E0000000000000000000000000000000000000000000000000000000 000000000000F9 :200800000000000000000000000000000000000000000000000000000000 000000000000D8 :200820000000000000000000000000000000000000000000000000000000 000000000000B8 :200840000000000000000000000000000000000000000000000000000000 00000000000098 :200860000000000000000000000000000000000000000000000000000000 00000000000078 :200880000000000000000000000000000000000000000000000000000000 00000000000058 :2008A0000000000000000000000000000000000000000000000000000000 00000000000038 :2008C0000000000000000000000000000000000000000000000000000000 00000000000018 :2008E0000000000000000000000000000000000000000000000000000000 000000000000F8 :200900000000000000000000000000000000000000000000000000000000 000000000000D7 :200920000000000000000000000000000000000000000000000000000000 000000000000B7 :200940000000000000000000000000000000000000000000000000000000 00000000000097 :200960000000000000000000000000000000000000000000000000000000 00000000000077 :200980000000000000000000000000000000000000000000000000000000 00000000000057 :2009A0000000000000000000000000000000000000000000000000000000 00000000000037 :2009C0000000000000000000000000000000000000000000000000000000 00000000000017 :2009E0000000000000000000000000000000000000000000000000000000 000000000000F7 :200A00000000000000000000000000000000000000000000000000000000 000000000000D6 :200A20000000000000000000000000000000000000000000000000000000 000000000000B6 :200A40000000000000000000000000000000000000000000000000000000 00000000000096 :200A60000000000000000000000000000000000000000000000000000000 00000000000076 :200A80000000000000000000000000000000000000000000000000000000 00000000000056 :200AA0000000000000000000000000000000000000000000000000000000 00000000000036 :200AC0000000000000000000000000000000000000000000000000000000 00000000000016 :200AE0000000000000000000000000000000000000000000000000000000 000000000000F6 :200B00000000000000000000000000000000000000000000000000000000 000000000000D5 :200B20000000000000000000000000000000000000000000000000000000 000000000000B5 :200B40000000000000000000000000000000000000000000000000000000 00000000000095 :200B60000000000000000000000000000000000000000000000000000000 00000000000075 :200B80000000000000000000000000000000000000000000000000000000 00000000000055 :200BA0000000000000000000000000000000000000000000000000000000 00000000000035 :200BC0000000000000000000000000000000000000000000000000000000 00000000000015 :200BE0000000000000000000000000000000000000000000000000000000 000000000000F5 :200C00000000000000000000000000000000000000000000000000000000 000000000000D4 :200C20000000000000000000000000000000000000000000000000000000 000000000000B4 :200C40000000000000000000000000000000000000000000000000000000 00000000000094 :200C60000000000000000000000000000000000000000000000000000000 00000000000074 :200C80000000000000000000000000000000000000000000000000000000 00000000000054 :200CA0000000000000000000000000000000000000000000000000000000 00000000000034 :200CC0000000000000000000000000000000000000000000000000000000 00000000000014 :200CE0000000000000000000000000000000000000000000000000000000 000000000000F4 :200D00000000000000000000000000000000000000000000000000000000 000000000000D3 :200D20000000000000000000000000000000000000000000000000000000 000000000000B3 :200D40000000000000000000000000000000000000000000000000000000 00000000000093 :200D60000000000000000000000000000000000000000000000000000000 00000000000073 :200D80000000000000000000000000000000000000000000000000000000 00000000000053 :200DA0000000000000000000000000000000000000000000000000000000 00000000000033 :200DC0000000000000000000000000000000000000000000000000000000 00000000000013 :200DE0000000000000000000000000000000000000000000000000000000 000000000000F3 :200E00000000000000000000000000000000000000000000000000000000 000000000000D2 :200E20000000000000000000000000000000000000000000000000000000 000000000000B2 :200E40000000000000000000000000000000000000000000000000000000 00000000000092 :200E60000000000000000000000000000000000000000000000000000000 00000000000072 :200E80000000000000000000000000000000000000000000000000000000 00000000000052 :200EA0000000000000000000000000000000000000000000000000000000 00000000000032 :200EC0000000000000000000000000000000000000000000000000000000 00000000000012 :200EE0000000000000000000000000000000000000000000000000000000 000000000000F2 :200F00000000000000000000000000000000000000000000000000000000 000000000000D1 :200F20000000000000000000000000000000000000000000000000000000 000000000000B1 :200F40000000000000000000000000000000000000000000000000000000 00000000000091 :200F60000000000000000000000000000000000000000000000000000000 00000000000071 :200F80000000000000000000000000000000000000000000000000000000 00000000000051 :200FA0000000000000000000000000000000000000000000000000000000 00000000000031 :200FC0000000000000000000000000000000000000000000000000000000 00000000000011 :200FE0000000000000000000000000000000000000000000000000000000 000000000000F1 :201000000000000000000000000000000000000000000000000000000000 000000000000D0 :201020000000000000000000000000000000000000000000000000000000 000000000000B0 :201040000000000000000000000000000000000000000000000000000000 00000000000090 :201060000000000000000000000000000000000000000000000000000000 00000000000070 :201080000000000000000000000000000000000000000000000000000000 00000000000050 :2010A0000000000000000000000000000000000000000000000000000000 00000000000030 :2010C0000000000000000000000000000000000000000000000000000000 00000000000010 :2010E0000000000000000000000000000000000000000000000000000000 000000000000F0 :201100000000000000000000000000000000000000000000000000000000 000000000000CF :201120000000000000000000000000000000000000000000000000000000 000000000000AF :201140000000000000000000000000000000000000000000000000000000 0000000000008F :201160000000000000000000000000000000000000000000000000000000 0000000000006F :201180000000000000000000000000000000000000000000000000000000 0000000000004F :2011A0000000000000000000000000000000000000000000000000000000 0000000000002F :2011C0000000000000000000000000000000000000000000000000000000 0000000000000F :2011E0000000000000000000000000000000000000000000000000000000 000000000000EF :201200000000000000000000000000000000000000000000000000000000 000000000000CE :201220000000000000000000000000000000000000000000000000000000 000000000000AE :201240000000000000000000000000000000000000000000000000000000 0000000000008E :201260000000000000000000000000000000000000000000000000000000 0000000000006E :201280000000000000000000000000000000000000000000000000000000 0000000000004E :2012A0000000000000000000000000000000000000000000000000000000 0000000000002E :2012C0000000000000000000000000000000000000000000000000000000 0000000000000E :2012E0000000000000000000000000000000000000000000000000000000 000000000000EE :201300000000000000000000000000000000000000000000000000000000 000000000000CD :201320000000000000000000000000000000000000000000000000000000 000000000000AD :201340000000000000000000000000000000000000000000000000000000 0000000000008D :201360000000000000000000000000000000000000000000000000000000 0000000000006D :201380000000000000000000000000000000000000000000000000000000 0000000000004D :2013A0000000000000000000000000000000000000000000000000000000 0000000000002D :2013C0000000000000000000000000000000000000000000000000000000 0000000000000D :2013E0000000000000000000000000000000000000000000000000000000 000000000000ED :201400000000000000000000000000000000000000000000000000000000 000000000000CC :201420000000000000000000000000000000000000000000000000000000 000000000000AC :201440000000000000000000000000000000000000000000000000000000 0000000000008C :201460000000000000000000000000000000000000000000000000000000 0000000000006C :201480000000000000000000000000000000000000000000000000000000 0000000000004C :2014A0000000000000000000000000000000000000000000000000000000 0000000000002C :2014C0000000000000000000000000000000000000000000000000000000 0000000000000C :2014E0000000000000000000000000000000000000000000000000000000 000000000000EC :201500000000000000000000000000000000000000000000000000000000 000000000000CB :201520000000000000000000000000000000000000000000000000000000 000000000000AB :201540000000000000000000000000000000000000000000000000000000 0000000000008B :201560000000000000000000000000000000000000000000000000000000 0000000000006B :201580000000000000000000000000000000000000000000000000000000 0000000000004B :2015A0000000000000000000000000000000000000000000000000000000 0000000000002B :2015C0000000000000000000000000000000000000000000000000000000 0000000000000B :2015E0000000000000000000000000000000000000000000000000000000 000000000000EB :201600000000000000000000000000000000000000000000000000000000 000000000000CA :201620000000000000000000000000000000000000000000000000000000 000000000000AA :201640000000000000000000000000000000000000000000000000000000 0000000000008A :201660000000000000000000000000000000000000000000000000000000 0000000000006A :201680000000000000000000000000000000000000000000000000000000 0000000000004A :2016A0000000000000000000000000000000000000000000000000000000 0000000000002A :2016C0000000000000000000000000000000000000000000000000000000 0000000000000A :2016E0000000000000000000000000000000000000000000000000000000 000000000000EA :201700000000000000000000000000000000000000000000000000000000 000000000000C9 :201720000000000000000000000000000000000000000000000000000000 000000000000A9 :201740000000000000000000000000000000000000000000000000000000 00000000000089 :201760000000000000000000000000000000000000000000000000000000 00000000000069 :201780000000000000000000000000000000000000000000000000000000 00000000000049 :2017A0000000000000000000000000000000000000000000000000000000 00000000000029 :2017C0000000000000000000000000000000000000000000000000000000 00000000000009 :2017E0000000000000000000000000000000000000000000000000000000 000000000000E9 :201800000000000000000000000000000000000000000000000000000000 000000000000C8 :201820000000000000000000000000000000000000000000000000000000 000000000000A8 :201840000000000000000000000000000000000000000000000000000000 00000000000088 :201860000000000000000000000000000000000000000000000000000000 00000000000068 :201880000000000000000000000000000000000000000000000000000000 00000000000048 :2018A0000000000000000000000000000000000000000000000000000000 00000000000028 :2018C0000000000000000000000000000000000000000000000000000000 00000000000008 :2018E0000000000000000000000000000000000000000000000000000000 000000000000E8 :201900000000000000000000000000000000000000000000000000000000 000000000000C7 :201920000000000000000000000000000000000000000000000000000000 000000000000A7 :201940000000000000000000000000000000000000000000000000000000 00000000000087 :201960000000000000000000000000000000000000000000000000000000 00000000000067 :201980000000000000000000000000000000000000000000000000000000 00000000000047 :2019A0000000000000000000000000000000000000000000000000000000 00000000000027 :2019C0000000000000000000000000000000000000000000000000000000 00000000000007 :2019E0000000000000000000000000000000000000000000000000000000 000000000000E7 :201A00000000000000000000000000000000000000000000000000000000 000000000000C6 :201A20000000000000000000000000000000000000000000000000000000 000000000000A6 :201A40000000000000000000000000000000000000000000000000000000 00000000000086 :201A60000000000000000000000000000000000000000000000000000000 00000000000066 :201A80000000000000000000000000000000000000000000000000000000 00000000000046 :201AA0000000000000000000000000000000000000000000000000000000 00000000000026 :201AC0000000000000000000000000000000000000000000000000000000 00000000000006 :201AE0000000000000000000000000000000000000000000000000000000 000000000000E6 :201B00000000000000000000000000000000000000000000000000000000 000000000000C5 :201B20000000000000000000000000000000000000000000000000000000 000000000000A5 :201B40000000000000000000000000000000000000000000000000000000 00000000000085 :201B60000000000000000000000000000000000000000000000000000000 00000000000065 :201B80000000000000000000000000000000000000000000000000000000 00000000000045 :201BA0000000000000000000000000000000000000000000000000000000 00000000000025 :201BC0000000000000000000000000000000000000000000000000000000 00000000000005 :201BE0000000000000000000000000000000000000000000000000000000 000000000000E5 :201C00000000000000000000000000000000000000000000000000000000 000000000000C4 :201C20000000000000000000000000000000000000000000000000000000 000000000000A4 :201C40000000000000000000000000000000000000000000000000000000 00000000000084 :201C60000000000000000000000000000000000000000000000000000000 00000000000064 :201C80000000000000000000000000000000000000000000000000000000 00000000000044 :201CA0000000000000000000000000000000000000000000000000000000 00000000000024 :201CC0000000000000000000000000000000000000000000000000000000 00000000000004 :201CE0000000000000000000000000000000000000000000000000000000 000000000000E4 :201D00000000000000000000000000000000000000000000000000000000 000000000000C3 :201D20000000000000000000000000000000000000000000000000000000 000000000000A3 :201D40000000000000000000000000000000000000000000000000000000 00000000000083 :201D60000000000000000000000000000000000000000000000000000000 00000000000063 :201D80000000000000000000000000000000000000000000000000000000 00000000000043 :201DA0000000000000000000000000000000000000000000000000000000 00000000000023 :201DC0000000000000000000000000000000000000000000000000000000 00000000000003 :201DE0000000000000000000000000000000000000000000000000000000 000000000000E3 :201E00000000000000000000000000000000000000000000000000000000 000000000000C2 :201E20000000000000000000000000000000000000000000000000000000 000000000000A2 :201E40000000000000000000000000000000000000000000000000000000 00000000000082 :201E60000000000000000000000000000000000000000000000000000000 00000000000062 :201E80000000000000000000000000000000000000000000000000000000 00000000000042 :201EA0000000000000000000000000000000000000000000000000000000 00000000000022 :201EC0000000000000000000000000000000000000000000000000000000 00000000000002 :201EE0000000000000000000000000000000000000000000000000000000 000000000000E2 :201F00009C21FF44D40110009C4100BC18609000D7E21FF48482FFF4A88 40002D7E227F870 :201F20009C60FFC7D7E21FF08482FFF0DBE227EF8C82FFEF8462FFF8D80 320001860900073 :201F4000D7E21FE48482FFE4A8840001D7E227E89C600000D7E21FE0848 2FFE0DBE227DF8B :201F60008C82FFDF8462FFE8D803200018609000D7E21FD48482FFD4A88 40003D7E227D839 :201F80009C600003D7E21FD08482FFD0DBE227CF8C82FFCF8462FFD8D80 320009C60004141 :201FA000D7E21FC88482FFC8D7E227FC18609000D7E21FC08482FFC0A88 40003D7E227C4A0 :201FC00018609000D7E21FB88482FFB8A8840003D7E227BC8462FFBC8C6 30000DBE21FB7BE :201FE0009C60FF808C82FFB7E0641804D7E21FB08482FFB0DBE227AF8C8 2FFAF8462FFC40D :20200000D803200018609000D7E21FA88482FFFCD7E227A49C60FFFFD7E 21F9C8482FF9CA9 :20202000DBE227A38462FFA4DBE21F9B8C82FF9B8C62FFA3E0841803D7E 227948482FF9455 :20204000DBE227938C82FF938462FFA8D803200018609000D7E21F88848 2FF88A8840001BF :20206000D7E2278C8462FFFCD7E21F808482FF80B8840088D7E227849C6 0FFFFD7E21F78C4 :202080008482FF78DBE2277F8462FF84DBE21F778C82FF778C62FF7FE08 41803D7E22770E5 :2020A0008482FF70DBE2276F8C82FF6F8462FF8CD803200018609000D7E 21F648482FF64C3 :2020C000A8840003D7E2276818609000D7E21F5C8482FF5CA8840003D7E 227609C60007F02 :2020E000D7E21F548482FF54DBE2275B8462FF608C630000DBE21F538C8 2FF538C62FF5B11 :20210000E0841803D7E2274C8482FF4CDBE2274B8C82FF4B8462FF68D80 32000844100002F :20212000440048009C2100BC9C21FF9CD40110009C410064D7E21FF8846 2FFF8DBE21FF79C :202140008C82FFF7DBE227FF18609000D7E21FEC8482FFECA8840005D7E 227F08462FFF005 :202160008C630000DBE21FEB8C82FFEBDBE227FE8C62FFFED7E21FE4848 2FFE4A4840020F7 :20218000D7E227E08462FFE0BC230000100000041500000003FFFFED150 000001880900087 :2021A000D7E227DC8C62FFFFDBE21FDB8C62FFDB8482FFDCD804180090 82FFFFD7E227D45F :2021C0008462FFD4BC23000A100000201500000018809000D7E227CC846 2FFCCA863000583 :2021E000D7E21FD08482FFD08C840000DBE227CB8C62FFCBDBE21FFE8C8 2FFFED7E227C462 :202200008462FFC4A4630020D7E21FC08482FFC0BC24000010000004150 0000003FFFFED9A :202220001500000018609000D7E21FBC9C80000DD7E227B88462FFB8DBE 21FB78C62FFB758 :202240008482FFBCD804180018809000D7E227AC8462FFACA8630005D7E 21FB08482FFB037 :202260008C840000DBE227AB8C62FFABDBE21FFE8C82FFFED7E227A4846 2FFA4A4630060CE :20228000D7E21FA08482FFA0BC040060100000041500000003FFFFED150 000008441000010 :2022A000440048009C2100649C21FFD0D40110009C41003018609000D7E 21FF08462FFF04E :2022C000A8630005D7E21FF48462FFF48C630000DBE21FEF8C62FFEFDBE 21FFF8C62FFFFEC :2022E000D7E21FE88462FFE8AC630001D7E21FE48462FFE4A4630001D7E 21FE08462FFE037 :20230000BC030000100000041500000003FFFFEA1500000018609000D7E 21FDC8462FFDC58 :202320008C630000DBE21FDB8C62FFDBDBE21FFE9062FFFED7E21FD4846 2FFD4D7E21FF831 :202340008562FFF884410000440048009C2100309C21FFC4D40110049C4 1003CD4014800C2 :2023600007FFFEE81500000018600000A8632544D7E21FF88462FFF88463 0000D7E21FF410 :202380008462FFF4D7E21FFC8462FFFCD7E21FF08462FFF090630000D7E 21FEC8462FFEC8A :2023A000BC03000010000013150000008462FFFCD7E21FE88462FFE8906 30000D7E21FE409 :2023C0008462FFE407FFFF59150000008462FFFCD7E21FE08462FFE09C6 30001D7E21FDCAF :2023E0008462FFDCD7E21FFC03FFFFE81500000007FFFFAE15000000D7E 25FD88462FFD8D5 :202400009C630001D7E21FD48462FFD4B8630018D7E21FCC8462FFCCB86 30098D7E21FD074 :202420008462FFD007FFFF411500000003FFFFF115000000852100008441 0004440048008A :162440009C21003C0000254848656C6C6F20776F726C64210A00B9 :00000001FF ----- Original Message ----- From: Robert Cragie<rcc@j...> To: Date: Tue Nov 20 12:27:57 CET 2007 Subject: [openrisc] how to run hello world in on-chip ram? > It seems like you're not initialising your on chip RAM correctly, > or it is > not configured correctly in your design as you'd expect to see > 0x15000000 > (l.nop) on the memory bus as it starts running. Are you offsetting > by 0x100 > correctly? Also, I'm not sure what SDRAM_BASE_ADDR points to either > - you > may want to remove that part. > Robert Cragie, Design Engineer > __ > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > http://www.jennic.com Tel: +44 (0) 114 281 2655 > _____________________________________________________________ __ > > -----Original Message----- > > From: charlie yang [mailto:ydt at ustc.edu] > > Sent: 20 November 2007 10:35 > > To: rcc at jennic.com; openrisc at opencores.org > > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > > > > Thanks Robert. > > > > I use the or1k/hello-uart as my example. use > or32-uclinux-objcopy to > > > > get a hello.hex and initialize the on-chip ram. When use > modelsim to do > > > > rtl simulation, I find the on-chip ram input > address(wb_ss_adr_i) repeat > > > > like 0x100,0x000,0x104,0x00,0x100,0x000,0x104,0x000. and the > ouput > > > > data (wb_ss_dat_o) is always zero. > > > > > > > > In the hello-uart, there is no FLASH,no Memory controller and > no > > > > cache. I don't know if my reset.S is incorrect or hex files is > incorrect. > > > > Please give me some hints. Thanks! > > > > > > > > Here is my reset.S in hello-uart directory: > > > > .global ___main > > > > .section .stack /*, "aw", @nobits*/ > > > > .space STACK_SIZE > > > > _stack: > > > > > > > > .section .vectors, "ax" > > > > .org 0x100 > > > > > > > > _reset_vector: > > > > l.nop > > > > l.nop > > > > 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(SDRAM_BASE_ADDR) > > l.ori r3,r3,lo(SDRAM_BASE_ADDR) > > > l.addi r5,r0,0x00 > > l.sw 0(r3),r5 > > > l.movhi r3,hi(_start) > > l.ori r3,r3,lo(_start) > > > l.jr r3 > > l.nop > > .section .text > > > > > _start: > > l.movhi r1,hi(_stack-4) > > l.ori > r1,r1,lo(_stack-4) > > l.addi r2,r0,-3 > > l.and > r1,r1,r2 > > > > l.movhi r2,hi(_main) > > l.ori > r2,r2,lo(_main) > > l.jr r2 > > l.nop > > > > > ___main: > > l.jr r9 > > l.nop > > > > > Then I use the following step to generate hex file: > > > or32-uclinux-gcc -g -c -o reset.o reset.S > > or32-uclinux-ld > -Tram.ld -o hello.or32 reset.o hello.o > > > or32-uclinux-objcopy -O binary hello.or32 hello.bin > > > or32-uclinux-objcopy -S -O ihex hello.or32 hello.hex > > > > > > > ----- Original Message ----- > > From: Robert > Cragie<rcc at j...> > > To: > > Date: Mon Nov 19 > 09:24:52 CET 2007 > > Subject: [openrisc] how to run hello > world in on-chip ram? > > > > > 1) The CPU always > vectors to 0x100 on reset so you will either need > > > > some > > > sort of bootstrap there or you will have to map > RAM which you can > > > download > > > to there. > > > > 2) You can always get to intelhex from the ELF file > using: > > > or32-uclinux-objcopy -S -O ihex > <ELFfile> <ihexfile> > > > Robert Cragie, > Design Engineer > > > > > > > > > __ > > > Jennic Ltd, Furnival Street, Sheffield, S1 > 4QT, UK > > > http://www.jennic.com Tel: +44 (0) 114 281 > 2655 > > > > > > _____________________________________________________________ > > > __ > > > > -----Original Message----- > > > > > From: openrisc-bounces at opencores.org > > > > > [mailto:openrisc-bounces at opencores.org]On Behalf Of charlie > > > > yang > > > > Sent: 19 November 2007 > 04:17 > > > > To: openrisc at opencores.org > > > > > Subject: [openrisc] how to run hello world in on-chip > ram? > > > > > > > > > > > > hi > all, > > > > I have a altera FPGA board with Cyclone II > EP2c35 and > > > synthesize the > > > > > orp_soc following the hardware tutorials. I have only one > > > > dedicated > > > > JTAG for FPGA and have no pins > for or1k CPU. So I want to burn > > > > the "hello > world" program into on-chip ram by > > > initializing > this memory, > > > > that is, let the JTAG download the > all the CPU and program . > > > > so there are two > questions for help: > > > > 1) how to set start pointer > of the reset.S and let the > > > "hello > > > > > world" run. > > > > 2) I find the > hello.hex in or1k is incompatible with Intel hex > > > > > format of > > > > altera memory. how can I convert > it to altera memory format? > > > > > > > > > Is there anybody using altera FPGA? Please give me some > > > > directions . > > > > Thanks a lot ! > > > > > _______________________________________________ > > > > > http://www.opencores.org/mailman/listinfo/openrisc > > > > > > > > http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram?charlie yang wrote:
> when initializing the ram, i use the content offset to 0x100 in hello.hex > and cut the no useful information before address 0x100 ,which all is zero. > This was probably a mistake -- now the instructions that should be at 0x100 are at 0x000: > In simulation, Ithe pc value (equal to wb_ss_adr_i) vs wb_ss_dat_o is: > pc dat_o > 0x000 15000000 > 0x100 9e000000 > 0x104 9e200000 > 0x108 9e400000 QED: you should have a NOP (i.e., 0x15000000) at 0x100, a NOP at 0x104, etc. (q.v. the reset.S you posted previously). > > here is my chopped hello.hex: > :2000000015000000150000009C4000009C6000009C8000009CA000009CC > 000009CE00000AE > :200020009D0000009D2000009D4000009D6000009D8000009DA000009DC > 000009DE0000058 > :200040009E0000009E2000009E4000009E6000009E8000009EA000009EC0 > 00009EE0000030 You can plainly see how this maps to the outputs you describe above, which suggests (to me, anyhow) that the memory is initialized correctly but that the initialization file is incorrect (due to removing the data from 0x000 to 0x100). _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
RE: how to run hello world in on-chip ram?Can you post the disassembly of your hello.or32 file?:
or32-uclinux-objdump -d hello.or32 That will give a clearer picture of where everything is. Robert Robert Cragie, Design Engineer _______________________________________________________________ Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK http://www.jennic.com Tel: +44 (0) 114 281 2655 _______________________________________________________________ > -----Original Message----- > From: openrisc-bounces@... > [mailto:openrisc-bounces@...]On Behalf Of charlie yang > Sent: 21 November 2007 11:57 > To: openrisc@... > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > Hi,Roboert, > > I don't know if the hello.hex is not suit for the altera ram. I > use a single > port ram with 4kx32bit. and set the ram.ld as: > MEMORY > { > vectors : ORIGIN = 0x00000000, LENGTH = 0x000000200 > ram : ORIGIN = 0x000000200, LENGTH = 0x000000f00 - > 0x0000200 > } > when initializing the ram, i use the content offset to 0x100 in > hello.hex > and cut the no useful information before address 0x100 ,which all is zero. > > In simulation, Ithe pc value (equal to wb_ss_adr_i) vs wb_ss_dat_o is: > pc dat_o > 0x000 15000000 > 0x100 9e000000 > 0x104 9e200000 > 0x108 9e400000 > ... > 0x11c 9ee00000 > 0x120 Hiz here cpu will report Starting exception: 7 > utill pc run 128, pc will jump to 0x700 ,then 0x704, and will repeat > 0x700,0x704 forever. the wb_ss_dat_o value is always 15000000. > what happen to this? > > here is my chopped hello.hex: > :2000000015000000150000009C4000009C6000009C8000009CA000009CC > 000009CE00000AE > :200020009D0000009D2000009D4000009D6000009D8000009DA000009DC > 000009DE0000058 > :200040009E0000009E2000009E4000009E6000009E8000009EA000009EC0 > 00009EE0000030 > :200060009F0000009F2000009F4000009F6000009F8000009FA000009FC0 > 00009FE0000008 > :2000800018200000A82135529C40FFFDE021100318400000A8422450440 > 010009C40000006 > :2000A0004400480015000000000000000000000000000000000000000000 > 0000000000009F > :2000C0000000000000000000000000000000000000000000000000000000 > 00000000000020 > :2000E0000000000000000000000000000000000000000000000000000000 > 00000000000000 > :200100000000000000000000000000000000000000000000000000000000 > 000000000000DF > :200120000000000000000000000000000000000000000000000000000000 > 000000000000BF > :200140000000000000000000000000000000000000000000000000000000 > 0000000000009F > :200160000000000000000000000000000000000000000000000000000000 > 0000000000007F > :200180000000000000000000000000000000000000000000000000000000 > 0000000000005F > :2001A0000000000000000000000000000000000000000000000000000000 > 0000000000003F > :2001C0000000000000000000000000000000000000000000000000000000 > 0000000000001F > :2001E0000000000000000000000000000000000000000000000000000000 > 000000000000FF > :200200000000000000000000000000000000000000000000000000000000 > 000000000000DE > :200220000000000000000000000000000000000000000000000000000000 > 000000000000BE > :200240000000000000000000000000000000000000000000000000000000 > 0000000000009E > :200260000000000000000000000000000000000000000000000000000000 > 0000000000007E > :200280000000000000000000000000000000000000000000000000000000 > 0000000000005E > :2002A0000000000000000000000000000000000000000000000000000000 > 0000000000003E > :2002C0000000000000000000000000000000000000000000000000000000 > 0000000000001E > :2002E0000000000000000000000000000000000000000000000000000000 > 000000000000FE > :200300000000000000000000000000000000000000000000000000000000 > 000000000000DD > :200320000000000000000000000000000000000000000000000000000000 > 000000000000BD > :200340000000000000000000000000000000000000000000000000000000 > 0000000000009D > :200360000000000000000000000000000000000000000000000000000000 > 0000000000007D > :200380000000000000000000000000000000000000000000000000000000 > 0000000000005D > :2003A0000000000000000000000000000000000000000000000000000000 > 0000000000003D > :2003C0000000000000000000000000000000000000000000000000000000 > 0000000000001D > :2003E0000000000000000000000000000000000000000000000000000000 > 000000000000FD > :200400000000000000000000000000000000000000000000000000000000 > 000000000000DC > :200420000000000000000000000000000000000000000000000000000000 > 000000000000BC > :200440000000000000000000000000000000000000000000000000000000 > 0000000000009C > :200460000000000000000000000000000000000000000000000000000000 > 0000000000007C > :200480000000000000000000000000000000000000000000000000000000 > 0000000000005C > :2004A0000000000000000000000000000000000000000000000000000000 > 0000000000003C > :2004C0000000000000000000000000000000000000000000000000000000 > 0000000000001C > :2004E0000000000000000000000000000000000000000000000000000000 > 000000000000FC > :200500000000000000000000000000000000000000000000000000000000 > 000000000000DB > :200520000000000000000000000000000000000000000000000000000000 > 000000000000BB > :200540000000000000000000000000000000000000000000000000000000 > 0000000000009B > :200560000000000000000000000000000000000000000000000000000000 > 0000000000007B > :200580000000000000000000000000000000000000000000000000000000 > 0000000000005B > :2005A0000000000000000000000000000000000000000000000000000000 > 0000000000003B > :2005C0000000000000000000000000000000000000000000000000000000 > 0000000000001B > :2005E0000000000000000000000000000000000000000000000000000000 > 000000000000FB > :200600000000000000000000000000000000000000000000000000000000 > 000000000000DA > :200620000000000000000000000000000000000000000000000000000000 > 000000000000BA > :200640000000000000000000000000000000000000000000000000000000 > 0000000000009A > :200660000000000000000000000000000000000000000000000000000000 > 0000000000007A > :200680000000000000000000000000000000000000000000000000000000 > 0000000000005A > :2006A0000000000000000000000000000000000000000000000000000000 > 0000000000003A > :2006C0000000000000000000000000000000000000000000000000000000 > 0000000000001A > :2006E0000000000000000000000000000000000000000000000000000000 > 000000000000FA > :200700000000000000000000000000000000000000000000000000000000 > 000000000000D9 > :200720000000000000000000000000000000000000000000000000000000 > 000000000000B9 > :200740000000000000000000000000000000000000000000000000000000 > 00000000000099 > :200760000000000000000000000000000000000000000000000000000000 > 00000000000079 > :200780000000000000000000000000000000000000000000000000000000 > 00000000000059 > :2007A0000000000000000000000000000000000000000000000000000000 > 00000000000039 > :2007C0000000000000000000000000000000000000000000000000000000 > 00000000000019 > :2007E0000000000000000000000000000000000000000000000000000000 > 000000000000F9 > :200800000000000000000000000000000000000000000000000000000000 > 000000000000D8 > :200820000000000000000000000000000000000000000000000000000000 > 000000000000B8 > :200840000000000000000000000000000000000000000000000000000000 > 00000000000098 > :200860000000000000000000000000000000000000000000000000000000 > 00000000000078 > :200880000000000000000000000000000000000000000000000000000000 > 00000000000058 > :2008A0000000000000000000000000000000000000000000000000000000 > 00000000000038 > :2008C0000000000000000000000000000000000000000000000000000000 > 00000000000018 > :2008E0000000000000000000000000000000000000000000000000000000 > 000000000000F8 > :200900000000000000000000000000000000000000000000000000000000 > 000000000000D7 > :200920000000000000000000000000000000000000000000000000000000 > 000000000000B7 > :200940000000000000000000000000000000000000000000000000000000 > 00000000000097 > :200960000000000000000000000000000000000000000000000000000000 > 00000000000077 > :200980000000000000000000000000000000000000000000000000000000 > 00000000000057 > :2009A0000000000000000000000000000000000000000000000000000000 > 00000000000037 > :2009C0000000000000000000000000000000000000000000000000000000 > 00000000000017 > :2009E0000000000000000000000000000000000000000000000000000000 > 000000000000F7 > :200A00000000000000000000000000000000000000000000000000000000 > 000000000000D6 > :200A20000000000000000000000000000000000000000000000000000000 > 000000000000B6 > :200A40000000000000000000000000000000000000000000000000000000 > 00000000000096 > :200A60000000000000000000000000000000000000000000000000000000 > 00000000000076 > :200A80000000000000000000000000000000000000000000000000000000 > 00000000000056 > :200AA0000000000000000000000000000000000000000000000000000000 > 00000000000036 > :200AC0000000000000000000000000000000000000000000000000000000 > 00000000000016 > :200AE0000000000000000000000000000000000000000000000000000000 > 000000000000F6 > :200B00000000000000000000000000000000000000000000000000000000 > 000000000000D5 > :200B20000000000000000000000000000000000000000000000000000000 > 000000000000B5 > :200B40000000000000000000000000000000000000000000000000000000 > 00000000000095 > :200B60000000000000000000000000000000000000000000000000000000 > 00000000000075 > :200B80000000000000000000000000000000000000000000000000000000 > 00000000000055 > :200BA0000000000000000000000000000000000000000000000000000000 > 00000000000035 > :200BC0000000000000000000000000000000000000000000000000000000 > 00000000000015 > :200BE0000000000000000000000000000000000000000000000000000000 > 000000000000F5 > :200C00000000000000000000000000000000000000000000000000000000 > 000000000000D4 > :200C20000000000000000000000000000000000000000000000000000000 > 000000000000B4 > :200C40000000000000000000000000000000000000000000000000000000 > 00000000000094 > :200C60000000000000000000000000000000000000000000000000000000 > 00000000000074 > :200C80000000000000000000000000000000000000000000000000000000 > 00000000000054 > :200CA0000000000000000000000000000000000000000000000000000000 > 00000000000034 > :200CC0000000000000000000000000000000000000000000000000000000 > 00000000000014 > :200CE0000000000000000000000000000000000000000000000000000000 > 000000000000F4 > :200D00000000000000000000000000000000000000000000000000000000 > 000000000000D3 > :200D20000000000000000000000000000000000000000000000000000000 > 000000000000B3 > :200D40000000000000000000000000000000000000000000000000000000 > 00000000000093 > :200D60000000000000000000000000000000000000000000000000000000 > 00000000000073 > :200D80000000000000000000000000000000000000000000000000000000 > 00000000000053 > :200DA0000000000000000000000000000000000000000000000000000000 > 00000000000033 > :200DC0000000000000000000000000000000000000000000000000000000 > 00000000000013 > :200DE0000000000000000000000000000000000000000000000000000000 > 000000000000F3 > :200E00000000000000000000000000000000000000000000000000000000 > 000000000000D2 > :200E20000000000000000000000000000000000000000000000000000000 > 000000000000B2 > :200E40000000000000000000000000000000000000000000000000000000 > 00000000000092 > :200E60000000000000000000000000000000000000000000000000000000 > 00000000000072 > :200E80000000000000000000000000000000000000000000000000000000 > 00000000000052 > :200EA0000000000000000000000000000000000000000000000000000000 > 00000000000032 > :200EC0000000000000000000000000000000000000000000000000000000 > 00000000000012 > :200EE0000000000000000000000000000000000000000000000000000000 > 000000000000F2 > :200F00000000000000000000000000000000000000000000000000000000 > 000000000000D1 > :200F20000000000000000000000000000000000000000000000000000000 > 000000000000B1 > :200F40000000000000000000000000000000000000000000000000000000 > 00000000000091 > :200F60000000000000000000000000000000000000000000000000000000 > 00000000000071 > :200F80000000000000000000000000000000000000000000000000000000 > 00000000000051 > :200FA0000000000000000000000000000000000000000000000000000000 > 00000000000031 > :200FC0000000000000000000000000000000000000000000000000000000 > 00000000000011 > :200FE0000000000000000000000000000000000000000000000000000000 > 000000000000F1 > :201000000000000000000000000000000000000000000000000000000000 > 000000000000D0 > :201020000000000000000000000000000000000000000000000000000000 > 000000000000B0 > :201040000000000000000000000000000000000000000000000000000000 > 00000000000090 > :201060000000000000000000000000000000000000000000000000000000 > 00000000000070 > :201080000000000000000000000000000000000000000000000000000000 > 00000000000050 > :2010A0000000000000000000000000000000000000000000000000000000 > 00000000000030 > :2010C0000000000000000000000000000000000000000000000000000000 > 00000000000010 > :2010E0000000000000000000000000000000000000000000000000000000 > 000000000000F0 > :201100000000000000000000000000000000000000000000000000000000 > 000000000000CF > :201120000000000000000000000000000000000000000000000000000000 > 000000000000AF > :201140000000000000000000000000000000000000000000000000000000 > 0000000000008F > :201160000000000000000000000000000000000000000000000000000000 > 0000000000006F > :201180000000000000000000000000000000000000000000000000000000 > 0000000000004F > :2011A0000000000000000000000000000000000000000000000000000000 > 0000000000002F > :2011C0000000000000000000000000000000000000000000000000000000 > 0000000000000F > :2011E0000000000000000000000000000000000000000000000000000000 > 000000000000EF > :201200000000000000000000000000000000000000000000000000000000 > 000000000000CE > :201220000000000000000000000000000000000000000000000000000000 > 000000000000AE > :201240000000000000000000000000000000000000000000000000000000 > 0000000000008E > :201260000000000000000000000000000000000000000000000000000000 > 0000000000006E > :201280000000000000000000000000000000000000000000000000000000 > 0000000000004E > :2012A0000000000000000000000000000000000000000000000000000000 > 0000000000002E > :2012C0000000000000000000000000000000000000000000000000000000 > 0000000000000E > :2012E0000000000000000000000000000000000000000000000000000000 > 000000000000EE > :201300000000000000000000000000000000000000000000000000000000 > 000000000000CD > :201320000000000000000000000000000000000000000000000000000000 > 000000000000AD > :201340000000000000000000000000000000000000000000000000000000 > 0000000000008D > :201360000000000000000000000000000000000000000000000000000000 > 0000000000006D > :201380000000000000000000000000000000000000000000000000000000 > 0000000000004D > :2013A0000000000000000000000000000000000000000000000000000000 > 0000000000002D > :2013C0000000000000000000000000000000000000000000000000000000 > 0000000000000D > :2013E0000000000000000000000000000000000000000000000000000000 > 000000000000ED > :201400000000000000000000000000000000000000000000000000000000 > 000000000000CC > :201420000000000000000000000000000000000000000000000000000000 > 000000000000AC > :201440000000000000000000000000000000000000000000000000000000 > 0000000000008C > :201460000000000000000000000000000000000000000000000000000000 > 0000000000006C > :201480000000000000000000000000000000000000000000000000000000 > 0000000000004C > :2014A0000000000000000000000000000000000000000000000000000000 > 0000000000002C > :2014C0000000000000000000000000000000000000000000000000000000 > 0000000000000C > :2014E0000000000000000000000000000000000000000000000000000000 > 000000000000EC > :201500000000000000000000000000000000000000000000000000000000 > 000000000000CB > :201520000000000000000000000000000000000000000000000000000000 > 000000000000AB > :201540000000000000000000000000000000000000000000000000000000 > 0000000000008B > :201560000000000000000000000000000000000000000000000000000000 > 0000000000006B > :201580000000000000000000000000000000000000000000000000000000 > 0000000000004B > :2015A0000000000000000000000000000000000000000000000000000000 > 0000000000002B > :2015C0000000000000000000000000000000000000000000000000000000 > 0000000000000B > :2015E0000000000000000000000000000000000000000000000000000000 > 000000000000EB > :201600000000000000000000000000000000000000000000000000000000 > 000000000000CA > :201620000000000000000000000000000000000000000000000000000000 > 000000000000AA > :201640000000000000000000000000000000000000000000000000000000 > 0000000000008A > :201660000000000000000000000000000000000000000000000000000000 > 0000000000006A > :201680000000000000000000000000000000000000000000000000000000 > 0000000000004A > :2016A0000000000000000000000000000000000000000000000000000000 > 0000000000002A > :2016C0000000000000000000000000000000000000000000000000000000 > 0000000000000A > :2016E0000000000000000000000000000000000000000000000000000000 > 000000000000EA > :201700000000000000000000000000000000000000000000000000000000 > 000000000000C9 > :201720000000000000000000000000000000000000000000000000000000 > 000000000000A9 > :201740000000000000000000000000000000000000000000000000000000 > 00000000000089 > :201760000000000000000000000000000000000000000000000000000000 > 00000000000069 > :201780000000000000000000000000000000000000000000000000000000 > 00000000000049 > :2017A0000000000000000000000000000000000000000000000000000000 > 00000000000029 > :2017C0000000000000000000000000000000000000000000000000000000 > 00000000000009 > :2017E0000000000000000000000000000000000000000000000000000000 > 000000000000E9 > :201800000000000000000000000000000000000000000000000000000000 > 000000000000C8 > :201820000000000000000000000000000000000000000000000000000000 > 000000000000A8 > :201840000000000000000000000000000000000000000000000000000000 > 00000000000088 > :201860000000000000000000000000000000000000000000000000000000 > 00000000000068 > :201880000000000000000000000000000000000000000000000000000000 > 00000000000048 > :2018A0000000000000000000000000000000000000000000000000000000 > 00000000000028 > :2018C0000000000000000000000000000000000000000000000000000000 > 00000000000008 > :2018E0000000000000000000000000000000000000000000000000000000 > 000000000000E8 > :201900000000000000000000000000000000000000000000000000000000 > 000000000000C7 > :201920000000000000000000000000000000000000000000000000000000 > 000000000000A7 > :201940000000000000000000000000000000000000000000000000000000 > 00000000000087 > :201960000000000000000000000000000000000000000000000000000000 > 00000000000067 > :201980000000000000000000000000000000000000000000000000000000 > 00000000000047 > :2019A0000000000000000000000000000000000000000000000000000000 > 00000000000027 > :2019C0000000000000000000000000000000000000000000000000000000 > 00000000000007 > :2019E0000000000000000000000000000000000000000000000000000000 > 000000000000E7 > :201A00000000000000000000000000000000000000000000000000000000 > 000000000000C6 > :201A20000000000000000000000000000000000000000000000000000000 > 000000000000A6 > :201A40000000000000000000000000000000000000000000000000000000 > 00000000000086 > :201A60000000000000000000000000000000000000000000000000000000 > 00000000000066 > :201A80000000000000000000000000000000000000000000000000000000 > 00000000000046 > :201AA0000000000000000000000000000000000000000000000000000000 > 00000000000026 > :201AC0000000000000000000000000000000000000000000000000000000 > 00000000000006 > :201AE0000000000000000000000000000000000000000000000000000000 > 000000000000E6 > :201B00000000000000000000000000000000000000000000000000000000 > 000000000000C5 > :201B20000000000000000000000000000000000000000000000000000000 > 000000000000A5 > :201B40000000000000000000000000000000000000000000000000000000 > 00000000000085 > :201B60000000000000000000000000000000000000000000000000000000 > 00000000000065 > :201B80000000000000000000000000000000000000000000000000000000 > 00000000000045 > :201BA0000000000000000000000000000000000000000000000000000000 > 00000000000025 > :201BC0000000000000000000000000000000000000000000000000000000 > 00000000000005 > :201BE0000000000000000000000000000000000000000000000000000000 > 000000000000E5 > :201C00000000000000000000000000000000000000000000000000000000 > 000000000000C4 > :201C20000000000000000000000000000000000000000000000000000000 > 000000000000A4 > :201C40000000000000000000000000000000000000000000000000000000 > 00000000000084 > :201C60000000000000000000000000000000000000000000000000000000 > 00000000000064 > :201C80000000000000000000000000000000000000000000000000000000 > 00000000000044 > :201CA0000000000000000000000000000000000000000000000000000000 > 00000000000024 > :201CC0000000000000000000000000000000000000000000000000000000 > 00000000000004 > :201CE0000000000000000000000000000000000000000000000000000000 > 000000000000E4 > :201D00000000000000000000000000000000000000000000000000000000 > 000000000000C3 > :201D20000000000000000000000000000000000000000000000000000000 > 000000000000A3 > :201D40000000000000000000000000000000000000000000000000000000 > 00000000000083 > :201D60000000000000000000000000000000000000000000000000000000 > 00000000000063 > :201D80000000000000000000000000000000000000000000000000000000 > 00000000000043 > :201DA0000000000000000000000000000000000000000000000000000000 > 00000000000023 > :201DC0000000000000000000000000000000000000000000000000000000 > 00000000000003 > :201DE0000000000000000000000000000000000000000000000000000000 > 000000000000E3 > :201E00000000000000000000000000000000000000000000000000000000 > 000000000000C2 > :201E20000000000000000000000000000000000000000000000000000000 > 000000000000A2 > :201E40000000000000000000000000000000000000000000000000000000 > 00000000000082 > :201E60000000000000000000000000000000000000000000000000000000 > 00000000000062 > :201E80000000000000000000000000000000000000000000000000000000 > 00000000000042 > :201EA0000000000000000000000000000000000000000000000000000000 > 00000000000022 > :201EC0000000000000000000000000000000000000000000000000000000 > 00000000000002 > :201EE0000000000000000000000000000000000000000000000000000000 > 000000000000E2 > :201F00009C21FF44D40110009C4100BC18609000D7E21FF48482FFF4A88 > 40002D7E227F870 > :201F20009C60FFC7D7E21FF08482FFF0DBE227EF8C82FFEF8462FFF8D80 > 320001860900073 > :201F4000D7E21FE48482FFE4A8840001D7E227E89C600000D7E21FE0848 > 2FFE0DBE227DF8B > :201F60008C82FFDF8462FFE8D803200018609000D7E21FD48482FFD4A88 > 40003D7E227D839 > :201F80009C600003D7E21FD08482FFD0DBE227CF8C82FFCF8462FFD8D80 > 320009C60004141 > :201FA000D7E21FC88482FFC8D7E227FC18609000D7E21FC08482FFC0A88 > 40003D7E227C4A0 > :201FC00018609000D7E21FB88482FFB8A8840003D7E227BC8462FFBC8C6 > 30000DBE21FB7BE > :201FE0009C60FF808C82FFB7E0641804D7E21FB08482FFB0DBE227AF8C8 > 2FFAF8462FFC40D > :20200000D803200018609000D7E21FA88482FFFCD7E227A49C60FFFFD7E > 21F9C8482FF9CA9 > :20202000DBE227A38462FFA4DBE21F9B8C82FF9B8C62FFA3E0841803D7E > 227948482FF9455 > :20204000DBE227938C82FF938462FFA8D803200018609000D7E21F88848 > 2FF88A8840001BF > :20206000D7E2278C8462FFFCD7E21F808482FF80B8840088D7E227849C6 > 0FFFFD7E21F78C4 > :202080008482FF78DBE2277F8462FF84DBE21F778C82FF778C62FF7FE08 > 41803D7E22770E5 > :2020A0008482FF70DBE2276F8C82FF6F8462FF8CD803200018609000D7E > 21F648482FF64C3 > :2020C000A8840003D7E2276818609000D7E21F5C8482FF5CA8840003D7E > 227609C60007F02 > :2020E000D7E21F548482FF54DBE2275B8462FF608C630000DBE21F538C8 > 2FF538C62FF5B11 > :20210000E0841803D7E2274C8482FF4CDBE2274B8C82FF4B8462FF68D80 > 32000844100002F > :20212000440048009C2100BC9C21FF9CD40110009C410064D7E21FF8846 > 2FFF8DBE21FF79C > :202140008C82FFF7DBE227FF18609000D7E21FEC8482FFECA8840005D7E > 227F08462FFF005 > :202160008C630000DBE21FEB8C82FFEBDBE227FE8C62FFFED7E21FE4848 > 2FFE4A4840020F7 > :20218000D7E227E08462FFE0BC230000100000041500000003FFFFED150 > 000001880900087 > :2021A000D7E227DC8C62FFFFDBE21FDB8C62FFDB8482FFDCD804180090 > 82FFFFD7E227D45F > :2021C0008462FFD4BC23000A100000201500000018809000D7E227CC846 > 2FFCCA863000583 > :2021E000D7E21FD08482FFD08C840000DBE227CB8C62FFCBDBE21FFE8C8 > 2FFFED7E227C462 > :202200008462FFC4A4630020D7E21FC08482FFC0BC24000010000004150 > 0000003FFFFED9A > :202220001500000018609000D7E21FBC9C80000DD7E227B88462FFB8DBE > 21FB78C62FFB758 > :202240008482FFBCD804180018809000D7E227AC8462FFACA8630005D7E > 21FB08482FFB037 > :202260008C840000DBE227AB8C62FFABDBE21FFE8C82FFFED7E227A4846 > 2FFA4A4630060CE > :20228000D7E21FA08482FFA0BC040060100000041500000003FFFFED150 > 000008441000010 > :2022A000440048009C2100649C21FFD0D40110009C41003018609000D7E > 21FF08462FFF04E > :2022C000A8630005D7E21FF48462FFF48C630000DBE21FEF8C62FFEFDBE > 21FFF8C62FFFFEC > :2022E000D7E21FE88462FFE8AC630001D7E21FE48462FFE4A4630001D7E > 21FE08462FFE037 > :20230000BC030000100000041500000003FFFFEA1500000018609000D7E > 21FDC8462FFDC58 > :202320008C630000DBE21FDB8C62FFDBDBE21FFE9062FFFED7E21FD4846 > 2FFD4D7E21FF831 > :202340008562FFF884410000440048009C2100309C21FFC4D40110049C4 > 1003CD4014800C2 > :2023600007FFFEE81500000018600000A8632544D7E21FF88462FFF88463 > 0000D7E21FF410 > :202380008462FFF4D7E21FFC8462FFFCD7E21FF08462FFF090630000D7E > 21FEC8462FFEC8A > :2023A000BC03000010000013150000008462FFFCD7E21FE88462FFE8906 > 30000D7E21FE409 > :2023C0008462FFE407FFFF59150000008462FFFCD7E21FE08462FFE09C6 > 30001D7E21FDCAF > :2023E0008462FFDCD7E21FFC03FFFFE81500000007FFFFAE15000000D7E > 25FD88462FFD8D5 > :202400009C630001D7E21FD48462FFD4B8630018D7E21FCC8462FFCCB86 > 30098D7E21FD074 > :202420008462FFD007FFFF411500000003FFFFF115000000852100008441 > 0004440048008A > :162440009C21003C0000254848656C6C6F20776F726C64210A00B9 > :00000001FF > > > > > ----- Original Message ----- > From: Robert Cragie<rcc@j...> > To: > Date: Tue Nov 20 12:27:57 CET 2007 > Subject: [openrisc] how to run hello world in on-chip ram? > > > It seems like you're not initialising your on chip RAM correctly, > > or it is > > not configured correctly in your design as you'd expect to see > > 0x15000000 > > (l.nop) on the memory bus as it starts running. Are you offsetting > > by 0x100 > > correctly? Also, I'm not sure what SDRAM_BASE_ADDR points to either > > - you > > may want to remove that part. > > Robert Cragie, Design Engineer > > > _____________________________________________________________ > __ > > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > > http://www.jennic.com Tel: +44 (0) 114 281 2655 > > > _____________________________________________________________ > __ > > > -----Original Message----- > > > From: charlie yang [mailto:ydt at ustc.edu] > > > Sent: 20 November 2007 10:35 > > > To: rcc at jennic.com; openrisc at opencores.org > > > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > > > > > > > Thanks Robert. > > > > > > I use the or1k/hello-uart as my example. use > > or32-uclinux-objcopy to > > > > > > get a hello.hex and initialize the on-chip ram. When use > > modelsim to do > > > > > > rtl simulation, I find the on-chip ram input > > address(wb_ss_adr_i) repeat > > > > > > like 0x100,0x000,0x104,0x00,0x100,0x000,0x104,0x000. and the > > ouput > > > > > > data (wb_ss_dat_o) is always zero. > > > > > > > > > > > > In the hello-uart, there is no FLASH,no Memory controller and > > no > > > > > > cache. I don't know if my reset.S is incorrect or hex files is > > incorrect. > > > > > > Please give me some hints. Thanks! > > > > > > > > > > > > Here is my reset.S in hello-uart directory: > > > > > > .global ___main > > > > > > .section .stack /*, "aw", @nobits*/ > > > > > > .space STACK_SIZE > > > > > > _stack: > > > > > > > > > > > > .section .vectors, "ax" > > > > > > .org 0x100 > > > > > > > > > > > > _reset_vector: > > > > > > l.nop > > > > > > l.nop > > > > > > 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(SDRAM_BASE_ADDR) > > l.ori r3,r3,lo(SDRAM_BASE_ADDR) > > > > l.addi r5,r0,0x00 > > l.sw 0(r3),r5 > > > > l.movhi r3,hi(_start) > > l.ori r3,r3,lo(_start) > > > > l.jr r3 > > l.nop > > .section .text > > > > > > _start: > > l.movhi r1,hi(_stack-4) > > l.ori > > r1,r1,lo(_stack-4) > > l.addi r2,r0,-3 > > l.and > > r1,r1,r2 > > > > l.movhi r2,hi(_main) > > l.ori > > r2,r2,lo(_main) > > l.jr r2 > > l.nop > > > > > > ___main: > > l.jr r9 > > l.nop > > > > > > Then I use the following step to generate hex file: > > > > or32-uclinux-gcc -g -c -o reset.o reset.S > > or32-uclinux-ld > > -Tram.ld -o hello.or32 reset.o hello.o > > > > or32-uclinux-objcopy -O binary hello.or32 hello.bin > > > > or32-uclinux-objcopy -S -O ihex hello.or32 hello.hex > > > > > > > > ----- Original Message ----- > > From: Robert > > Cragie<rcc at j...> > > To: > > Date: Mon Nov 19 > > 09:24:52 CET 2007 > > Subject: [openrisc] how to run hello > > world in on-chip ram? > > > > > 1) The CPU always > > vectors to 0x100 on reset so you will either need > > > > > some > > > sort of bootstrap there or you will have to map > > RAM which you can > > > download > > > to there. > > > > > 2) You can always get to intelhex from the ELF file > > using: > > > or32-uclinux-objcopy -S -O ihex > > <ELFfile> <ihexfile> > > > Robert Cragie, > > Design Engineer > > > > > > > > _____________________________________________________________ > > > > > __ > > > Jennic Ltd, Furnival Street, Sheffield, S1 > > 4QT, UK > > > http://www.jennic.com Tel: +44 (0) 114 281 > > 2655 > > > > > > > > _____________________________________________________________ > > > > > __ > > > > -----Original Message----- > > > > > > From: openrisc-bounces at opencores.org > > > > > > [mailto:openrisc-bounces at opencores.org]On Behalf Of charlie > > > > > yang > > > > Sent: 19 November 2007 > > 04:17 > > > > To: openrisc at opencores.org > > > > > > Subject: [openrisc] how to run hello world in on-chip > > ram? > > > > > > > > > > > > hi > > all, > > > > I have a altera FPGA board with Cyclone II > > EP2c35 and > > > synthesize the > > > > > > orp_soc following the hardware tutorials. I have only one > > > > > dedicated > > > > JTAG for FPGA and have no pins > > for or1k CPU. So I want to burn > > > > the "hello > > world" program into on-chip ram by > > > initializing > > this memory, > > > > that is, let the JTAG download the > > all the CPU and program . > > > > so there are two > > questions for help: > > > > 1) how to set start pointer > > of the reset.S and let the > > > "hello > > > > > > world" run. > > > > 2) I find the > > hello.hex in or1k is incompatible with Intel hex > > > > > > format of > > > > altera memory. how can I convert > > it to altera memory format? > > > > > > > > > > Is there anybody using altera FPGA? Please give me some > > > > > directions . > > > > Thanks a lot ! > > > > > > _______________________________________________ > > > > > > http://www.opencores.org/mailman/listinfo/openrisc > > > > > > > > > > > _______________________________________________ > http://www.opencores.org/mailman/listinfo/openrisc _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram?Thanks Robert.
I find where is the problem ,but dont' know why. When I use or32-uclinux-objcopy command to get the ram.hex, the "_start" physical address in RAM is 0x100, and CPU cannot jump there. But if i use orp_soc/sw/utils/bin2hex to convert the hello.bin to hello.hex (it's not the intel hex format),then copy the content of hello.hex to altera ram.hex, my hello-uart runs ok. But in this condition the physical address of "_start" is 0x40 (right shift 2 bit than 0x100). These two kinds of hex files come from the same hello.bin or hello.or32, why make out the different start address? The following is the file using "or32-uclinux-dump -d hello.or32": hello.or32: file format elf32-or32 Disassembly of section .vectors: 00000000 <_start-0x100>: ... 00000100 <_start>: 100: 18 20 00 00 l.movhi r1,0x0 104: a8 21 0d 52 l.ori r1,r1,0xd52 108: 9c 40 ff fd l.addi r2,r0,0xfffffffd 10c: e0 21 10 03 l.and r1,r1,r2 110: 18 40 00 00 l.movhi r2,0x0 114: a8 42 06 50 l.ori r2,r2,0x650 118: 44 00 10 00 l.jr r2 11c: 9c 40 00 00 l.addi r2,r0,0x0 00000120 <___main>: 120: 44 00 48 00 l.jr r9 124: 15 00 00 00 l.nop 0x0 Disassembly of section .text: 00000200 <_uart_init>: 200: 9c 21 ff 44 l.addi r1,r1,0xffffff44 204: d4 01 10 00 l.sw 0x0(r1),r2 208: 9c 41 00 bc l.addi r2,r1,0xbc 20c: 18 60 90 00 l.movhi r3,0x9000 210: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 214: 84 82 ff f4 l.lwz r4,0xfffffff4(r2) 218: a8 84 00 02 l.ori r4,r4,0x2 21c: d7 e2 27 f8 l.sw 0xfffffff8(r2),r4 220: 9c 60 ff c7 l.addi r3,r0,0xffffffc7 224: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 228: 84 82 ff f0 l.lwz r4,0xfffffff0(r2) 22c: db e2 27 ef l.sb 0xffffffef(r2),r4 230: 8c 82 ff ef l.lbz r4,0xffffffef(r2) 234: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) 238: d8 03 20 00 l.sb 0x0(r3),r4 23c: 18 60 90 00 l.movhi r3,0x9000 240: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 244: 84 82 ff e4 l.lwz r4,0xffffffe4(r2) 248: a8 84 00 01 l.ori r4,r4,0x1 24c: d7 e2 27 e8 l.sw 0xffffffe8(r2),r4 250: 9c 60 00 00 l.addi r3,r0,0x0 254: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 258: 84 82 ff e0 l.lwz r4,0xffffffe0(r2) 25c: db e2 27 df l.sb 0xffffffdf(r2),r4 260: 8c 82 ff df l.lbz r4,0xffffffdf(r2) 264: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) 268: d8 03 20 00 l.sb 0x0(r3),r4 26c: 18 60 90 00 l.movhi r3,0x9000 270: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 274: 84 82 ff d4 l.lwz r4,0xffffffd4(r2) 278: a8 84 00 03 l.ori r4,r4,0x3 27c: d7 e2 27 d8 l.sw 0xffffffd8(r2),r4 280: 9c 60 00 03 l.addi r3,r0,0x3 284: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 288: 84 82 ff d0 l.lwz r4,0xffffffd0(r2) 28c: db e2 27 cf l.sb 0xffffffcf(r2),r4 290: 8c 82 ff cf l.lbz r4,0xffffffcf(r2) 294: 84 62 ff d8 l.lwz r3,0xffffffd8(r2) 298: d8 03 20 00 l.sb 0x0(r3),r4 29c: 9c 60 00 41 l.addi r3,r0,0x41 2a0: d7 e2 1f c8 l.sw 0xffffffc8(r2),r3 2a4: 84 82 ff c8 l.lwz r4,0xffffffc8(r2) 2a8: d7 e2 27 fc l.sw 0xfffffffc(r2),r4 2ac: 18 60 90 00 l.movhi r3,0x9000 2b0: d7 e2 1f c0 l.sw 0xffffffc0(r2),r3 2b4: 84 82 ff c0 l.lwz r4,0xffffffc0(r2) 2b8: a8 84 00 03 l.ori r4,r4,0x3 2bc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 2c0: 18 60 90 00 l.movhi r3,0x9000 2c4: d7 e2 1f b8 l.sw 0xffffffb8(r2),r3 2c8: 84 82 ff b8 l.lwz r4,0xffffffb8(r2) 2cc: a8 84 00 03 l.ori r4,r4,0x3 2d0: d7 e2 27 bc l.sw 0xffffffbc(r2),r4 2d4: 84 62 ff bc l.lwz r3,0xffffffbc(r2) 2d8: 8c 63 00 00 l.lbz r3,0x0(r3) 2dc: db e2 1f b7 l.sb 0xffffffb7(r2),r3 2e0: 9c 60 ff 80 l.addi r3,r0,0xffffff80 2e4: 8c 82 ff b7 l.lbz r4,0xffffffb7(r2) 2e8: e0 64 18 04 l.or r3,r4,r3 2ec: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 2f0: 84 82 ff b0 l.lwz r4,0xffffffb0(r2) 2f4: db e2 27 af l.sb 0xffffffaf(r2),r4 2f8: 8c 82 ff af l.lbz r4,0xffffffaf(r2) 2fc: 84 62 ff c4 l.lwz r3,0xffffffc4(r2) 300: d8 03 20 00 l.sb 0x0(r3),r4 304: 18 60 90 00 l.movhi r3,0x9000 308: d7 e2 1f a8 l.sw 0xffffffa8(r2),r3 30c: 84 82 ff fc l.lwz r4,0xfffffffc(r2) 310: d7 e2 27 a4 l.sw 0xffffffa4(r2),r4 314: 9c 60 ff ff l.addi r3,r0,0xffffffff 318: d7 e2 1f 9c l.sw 0xffffff9c(r2),r3 31c: 84 82 ff 9c l.lwz r4,0xffffff9c(r2) 320: db e2 27 a3 l.sb 0xffffffa3(r2),r4 324: 84 62 ff a4 l.lwz r3,0xffffffa4(r2) 328: db e2 1f 9b l.sb 0xffffff9b(r2),r3 32c: 8c 82 ff 9b l.lbz r4,0xffffff9b(r2) 330: 8c 62 ff a3 l.lbz r3,0xffffffa3(r2) 334: e0 84 18 03 l.and r4,r4,r3 338: d7 e2 27 94 l.sw 0xffffff94(r2),r4 33c: 84 82 ff 94 l.lwz r4,0xffffff94(r2) 340: db e2 27 93 l.sb 0xffffff93(r2),r4 344: 8c 82 ff 93 l.lbz r4,0xffffff93(r2) 348: 84 62 ff a8 l.lwz r3,0xffffffa8(r2) 34c: d8 03 20 00 l.sb 0x0(r3),r4 350: 18 60 90 00 l.movhi r3,0x9000 354: d7 e2 1f 88 l.sw 0xffffff88(r2),r3 358: 84 82 ff 88 l.lwz r4,0xffffff88(r2) 35c: a8 84 00 01 l.ori r4,r4,0x1 360: d7 e2 27 8c l.sw 0xffffff8c(r2),r4 364: 84 62 ff fc l.lwz r3,0xfffffffc(r2) 368: d7 e2 1f 80 l.sw 0xffffff80(r2),r3 36c: 84 82 ff 80 l.lwz r4,0xffffff80(r2) 370: b8 84 00 88 l.srai r4,r4,0x8 374: d7 e2 27 84 l.sw 0xffffff84(r2),r4 378: 9c 60 ff ff l.addi r3,r0,0xffffffff 37c: d7 e2 1f 78 l.sw 0xffffff78(r2),r3 380: 84 82 ff 78 l.lwz r4,0xffffff78(r2) 384: db e2 27 7f l.sb 0xffffff7f(r2),r4 388: 84 62 ff 84 l.lwz r3,0xffffff84(r2) 38c: db e2 1f 77 l.sb 0xffffff77(r2),r3 390: 8c 82 ff 77 l.lbz r4,0xffffff77(r2) 394: 8c 62 ff 7f l.lbz r3,0xffffff7f(r2) 398: e0 84 18 03 l.and r4,r4,r3 39c: d7 e2 27 70 l.sw 0xffffff70(r2),r4 3a0: 84 82 ff 70 l.lwz r4,0xffffff70(r2) 3a4: db e2 27 6f l.sb 0xffffff6f(r2),r4 3a8: 8c 82 ff 6f l.lbz r4,0xffffff6f(r2) 3ac: 84 62 ff 8c l.lwz r3,0xffffff8c(r2) 3b0: d8 03 20 00 l.sb 0x0(r3),r4 3b4: 18 60 90 00 l.movhi r3,0x9000 3b8: d7 e2 1f 64 l.sw 0xffffff64(r2),r3 3bc: 84 82 ff 64 l.lwz r4,0xffffff64(r2) 3c0: a8 84 00 03 l.ori r4,r4,0x3 3c4: d7 e2 27 68 l.sw 0xffffff68(r2),r4 3c8: 18 60 90 00 l.movhi r3,0x9000 3cc: d7 e2 1f 5c l.sw 0xffffff5c(r2),r3 3d0: 84 82 ff 5c l.lwz r4,0xffffff5c(r2) 3d4: a8 84 00 03 l.ori r4,r4,0x3 3d8: d7 e2 27 60 l.sw 0xffffff60(r2),r4 3dc: 9c 60 00 7f l.addi r3,r0,0x7f 3e0: d7 e2 1f 54 l.sw 0xffffff54(r2),r3 3e4: 84 82 ff 54 l.lwz r4,0xffffff54(r2) 3e8: db e2 27 5b l.sb 0xffffff5b(r2),r4 3ec: 84 62 ff 60 l.lwz r3,0xffffff60(r2) 3f0: 8c 63 00 00 l.lbz r3,0x0(r3) 3f4: db e2 1f 53 l.sb 0xffffff53(r2),r3 3f8: 8c 82 ff 53 l.lbz r4,0xffffff53(r2) 3fc: 8c 62 ff 5b l.lbz r3,0xffffff5b(r2) 400: e0 84 18 03 l.and r4,r4,r3 404: d7 e2 27 4c l.sw 0xffffff4c(r2),r4 408: 84 82 ff 4c l.lwz r4,0xffffff4c(r2) 40c: db e2 27 4b l.sb 0xffffff4b(r2),r4 410: 8c 82 ff 4b l.lbz r4,0xffffff4b(r2) 414: 84 62 ff 68 l.lwz r3,0xffffff68(r2) 418: d8 03 20 00 l.sb 0x0(r3),r4 41c: 84 41 00 00 l.lwz r2,0x0(r1) 420: 44 00 48 00 l.jr r9 424: 9c 21 00 bc l.addi r1,r1,0xbc 00000428 <_uart_putc>: 428: 9c 21 ff 9c l.addi r1,r1,0xffffff9c 42c: d4 01 10 00 l.sw 0x0(r1),r2 430: 9c 41 00 64 l.addi r2,r1,0x64 434: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 438: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) 43c: db e2 1f f7 l.sb 0xfffffff7(r2),r3 440: 8c 82 ff f7 l.lbz r4,0xfffffff7(r2) 444: db e2 27 ff l.sb 0xffffffff(r2),r4 448: 18 60 90 00 l.movhi r3,0x9000 44c: d7 e2 1f ec l.sw 0xffffffec(r2),r3 450: 84 82 ff ec l.lwz r4,0xffffffec(r2) 454: a8 84 00 05 l.ori r4,r4,0x5 458: d7 e2 27 f0 l.sw 0xfffffff0(r2),r4 45c: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) 460: 8c 63 00 00 l.lbz r3,0x0(r3) 464: db e2 1f eb l.sb 0xffffffeb(r2),r3 468: 8c 82 ff eb l.lbz r4,0xffffffeb(r2) 46c: db e2 27 fe l.sb 0xfffffffe(r2),r4 470: 8c 62 ff fe l.lbz r3,0xfffffffe(r2) 474: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 478: 84 82 ff e4 l.lwz r4,0xffffffe4(r2) 47c: a4 84 00 20 l.andi r4,r4,0x20 480: d7 e2 27 e0 l.sw 0xffffffe0(r2),r4 484: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) 488: bc 23 00 00 l.sfnei r3,0x0 48c: 10 00 00 04 l.bf 49c <_uart_putc+0x74> 490: 15 00 00 00 l.nop 0x0 494: 03 ff ff ed l.j 448 <_uart_putc+0x20> 498: 15 00 00 00 l.nop 0x0 49c: 18 80 90 00 l.movhi r4,0x9000 4a0: d7 e2 27 dc l.sw 0xffffffdc(r2),r4 4a4: 8c 62 ff ff l.lbz r3,0xffffffff(r2) 4a8: db e2 1f db l.sb 0xffffffdb(r2),r3 4ac: 8c 62 ff db l.lbz r3,0xffffffdb(r2) 4b0: 84 82 ff dc l.lwz r4,0xffffffdc(r2) 4b4: d8 04 18 00 l.sb 0x0(r4),r3 4b8: 90 82 ff ff l.lbs r4,0xffffffff(r2) 4bc: d7 e2 27 d4 l.sw 0xffffffd4(r2),r4 4c0: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) 4c4: bc 23 00 0a l.sfnei r3,0xa 4c8: 10 00 00 20 l.bf 548 <_uart_putc+0x120> 4cc: 15 00 00 00 l.nop 0x0 4d0: 18 80 90 00 l.movhi r4,0x9000 4d4: d7 e2 27 cc l.sw 0xffffffcc(r2),r4 4d8: 84 62 ff cc l.lwz r3,0xffffffcc(r2) 4dc: a8 63 00 05 l.ori r3,r3,0x5 4e0: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 4e4: 84 82 ff d0 l.lwz r4,0xffffffd0(r2) 4e8: 8c 84 00 00 l.lbz r4,0x0(r4) 4ec: db e2 27 cb l.sb 0xffffffcb(r2),r4 4f0: 8c 62 ff cb l.lbz r3,0xffffffcb(r2) 4f4: db e2 1f fe l.sb 0xfffffffe(r2),r3 4f8: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) 4fc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 500: 84 62 ff c4 l.lwz r3,0xffffffc4(r2) 504: a4 63 00 20 l.andi r3,r3,0x20 508: d7 e2 1f c0 l.sw 0xffffffc0(r2),r3 50c: 84 82 ff c0 l.lwz r4,0xffffffc0(r2) 510: bc 24 00 00 l.sfnei r4,0x0 514: 10 00 00 04 l.bf 524 <_uart_putc+0xfc> 518: 15 00 00 00 l.nop 0x0 51c: 03 ff ff ed l.j 4d0 <_uart_putc+0xa8> 520: 15 00 00 00 l.nop 0x0 524: 18 60 90 00 l.movhi r3,0x9000 528: d7 e2 1f bc l.sw 0xffffffbc(r2),r3 52c: 9c 80 00 0d l.addi r4,r0,0xd 530: d7 e2 27 b8 l.sw 0xffffffb8(r2),r4 534: 84 62 ff b8 l.lwz r3,0xffffffb8(r2) 538: db e2 1f b7 l.sb 0xffffffb7(r2),r3 53c: 8c 62 ff b7 l.lbz r3,0xffffffb7(r2) 540: 84 82 ff bc l.lwz r4,0xffffffbc(r2) 544: d8 04 18 00 l.sb 0x0(r4),r3 548: 18 80 90 00 l.movhi r4,0x9000 54c: d7 e2 27 ac l.sw 0xffffffac(r2),r4 550: 84 62 ff ac l.lwz r3,0xffffffac(r2) 554: a8 63 00 05 l.ori r3,r3,0x5 558: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 55c: 84 82 ff b0 l.lwz r4,0xffffffb0(r2) 560: 8c 84 00 00 l.lbz r4,0x0(r4) 564: db e2 27 ab l.sb 0xffffffab(r2),r4 568: 8c 62 ff ab l.lbz r3,0xffffffab(r2) 56c: db e2 1f fe l.sb 0xfffffffe(r2),r3 570: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) 574: d7 e2 27 a4 l.sw 0xffffffa4(r2),r4 578: 84 62 ff a4 l.lwz r3,0xffffffa4(r2) 57c: a4 63 00 60 l.andi r3,r3,0x60 580: d7 e2 1f a0 l.sw 0xffffffa0(r2),r3 584: 84 82 ff a0 l.lwz r4,0xffffffa0(r2) 588: bc 04 00 60 l.sfeqi r4,0x60 58c: 10 00 00 04 l.bf 59c <_uart_putc+0x174> 590: 15 00 00 00 l.nop 0x0 594: 03 ff ff ed l.j 548 <_uart_putc+0x120> 598: 15 00 00 00 l.nop 0x0 59c: 84 41 00 00 l.lwz r2,0x0(r1) 5a0: 44 00 48 00 l.jr r9 5a4: 9c 21 00 64 l.addi r1,r1,0x64 000005a8 <_uart_getc>: 5a8: 9c 21 ff d0 l.addi r1,r1,0xffffffd0 5ac: d4 01 10 00 l.sw 0x0(r1),r2 5b0: 9c 41 00 30 l.addi r2,r1,0x30 5b4: 18 60 90 00 l.movhi r3,0x9000 5b8: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 5bc: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) 5c0: a8 63 00 05 l.ori r3,r3,0x5 5c4: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 5c8: 84 62 ff f4 l.lwz r3,0xfffffff4(r2) 5cc: 8c 63 00 00 l.lbz r3,0x0(r3) 5d0: db e2 1f ef l.sb 0xffffffef(r2),r3 5d4: 8c 62 ff ef l.lbz r3,0xffffffef(r2) 5d8: db e2 1f ff l.sb 0xffffffff(r2),r3 5dc: 8c 62 ff ff l.lbz r3,0xffffffff(r2) 5e0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 5e4: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) 5e8: ac 63 00 01 l.xori r3,r3,0x1 5ec: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 5f0: 84 62 ff e4 l.lwz r3,0xffffffe4(r2) 5f4: a4 63 00 01 l.andi r3,r3,0x1 5f8: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 5fc: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) 600: bc 03 00 00 l.sfeqi r3,0x0 604: 10 00 00 04 l.bf 614 <_uart_getc+0x6c> 608: 15 00 00 00 l.nop 0x0 60c: 03 ff ff ea l.j 5b4 <_uart_getc+0xc> 610: 15 00 00 00 l.nop 0x0 614: 18 60 90 00 l.movhi r3,0x9000 618: d7 e2 1f dc l.sw 0xffffffdc(r2),r3 61c: 84 62 ff dc l.lwz r3,0xffffffdc(r2) 620: 8c 63 00 00 l.lbz r3,0x0(r3) 624: db e2 1f db l.sb 0xffffffdb(r2),r3 628: 8c 62 ff db l.lbz r3,0xffffffdb(r2) 62c: db e2 1f fe l.sb 0xfffffffe(r2),r3 630: 90 62 ff fe l.lbs r3,0xfffffffe(r2) 634: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 638: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) 63c: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 640: 85 62 ff f8 l.lwz r11,0xfffffff8(r2) 644: 84 41 00 00 l.lwz r2,0x0(r1) 648: 44 00 48 00 l.jr r9 64c: 9c 21 00 30 l.addi r1,r1,0x30 00000650 <_main>: 650: 9c 21 ff c4 l.addi r1,r1,0xffffffc4 654: d4 01 10 04 l.sw 0x4(r1),r2 658: 9c 41 00 3c l.addi r2,r1,0x3c 65c: d4 01 48 00 l.sw 0x0(r1),r9 660: 07 ff fe e8 l.jal 200 <_uart_init> 664: 15 00 00 00 l.nop 0x0 668: 18 60 00 00 l.movhi r3,0x0 66c: a8 63 07 44 l.ori r3,r3,0x744 670: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 674: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) 678: 84 63 00 00 l.lwz r3,0x0(r3) 67c: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 680: 84 62 ff f4 l.lwz r3,0xfffffff4(r2) 684: d7 e2 1f fc l.sw 0xfffffffc(r2),r3 688: 84 62 ff fc l.lwz r3,0xfffffffc(r2) 68c: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 690: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) 694: 90 63 00 00 l.lbs r3,0x0(r3) 698: d7 e2 1f ec l.sw 0xffffffec(r2),r3 69c: 84 62 ff ec l.lwz r3,0xffffffec(r2) 6a0: bc 03 00 00 l.sfeqi r3,0x0 6a4: 10 00 00 13 l.bf 6f0 <_main+0xa0> 6a8: 15 00 00 00 l.nop 0x0 6ac: 84 62 ff fc l.lwz r3,0xfffffffc(r2) 6b0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 6b4: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) 6b8: 90 63 00 00 l.lbs r3,0x0(r3) 6bc: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 6c0: 84 62 ff e4 l.lwz r3,0xffffffe4(r2) 6c4: 07 ff ff 59 l.jal 428 <_uart_putc> 6c8: 15 00 00 00 l.nop 0x0 6cc: 84 62 ff fc l.lwz r3,0xfffffffc(r2) 6d0: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 6d4: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) 6d8: 9c 63 00 01 l.addi r3,r3,0x1 6dc: d7 e2 1f dc l.sw 0xffffffdc(r2),r3 6e0: 84 62 ff dc l.lwz r3,0xffffffdc(r2) 6e4: d7 e2 1f fc l.sw 0xfffffffc(r2),r3 6e8: 03 ff ff e8 l.j 688 <_main+0x38> 6ec: 15 00 00 00 l.nop 0x0 6f0: 07 ff ff ae l.jal 5a8 <_uart_getc> 6f4: 15 00 00 00 l.nop 0x0 6f8: d7 e2 5f d8 l.sw 0xffffffd8(r2),r11 6fc: 84 62 ff d8 l.lwz r3,0xffffffd8(r2) 700: 9c 63 00 01 l.addi r3,r3,0x1 704: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 708: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) 70c: b8 63 00 18 l.slli r3,r3,0x18 710: d7 e2 1f cc l.sw 0xffffffcc(r2),r3 714: 84 62 ff cc l.lwz r3,0xffffffcc(r2) 718: b8 63 00 98 l.srai r3,r3,0x18 71c: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 720: 84 62 ff d0 l.lwz r3,0xffffffd0(r2) 724: 07 ff ff 41 l.jal 428 <_uart_putc> 728: 15 00 00 00 l.nop 0x0 72c: 03 ff ff f1 l.j 6f0 <_main+0xa0> 730: 15 00 00 00 l.nop 0x0 734: 85 21 00 00 l.lwz r9,0x0(r1) 738: 84 41 00 04 l.lwz r2,0x4(r1) 73c: 44 00 48 00 l.jr r9 740: 9c 21 00 3c l.addi r1,r1,0x3c ----- Original Message ----- From: Robert Cragie<rcc@j...> To: Date: Thu Nov 22 11:30:49 CET 2007 Subject: [openrisc] how to run hello world in on-chip ram? > Can you post the disassembly of your hello.or32 file?: > > or32-uclinux-objdump -d hello.or32 > > That will give a clearer picture of where everything is. > > Robert > > Robert Cragie, Design Engineer > __ > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > http://www.jennic.com Tel: +44 (0) 114 281 2655 > _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
RE: how to run hello world in on-chip ram?OK, I guess the Intelhex bit ended up being misleading. I have never
actually attempted what you are doing. With respect to the addresses, again I guess that the address bus to the memory actually starts at address bit 2, with address bits 1 and 0 decoded for the byte lanes of 32-bit wide memory. Therefore it seems reasonable to me that the address *lines* will appear to be shifted by 2 as you state. Robert Robert Cragie, Design Engineer _______________________________________________________________ Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK http://www.jennic.com Tel: +44 (0) 114 281 2655 _______________________________________________________________ > -----Original Message----- > From: openrisc-bounces@... > [mailto:openrisc-bounces@...]On Behalf Of charlie yang > Sent: 23 November 2007 01:58 > To: openrisc@... > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > Thanks Robert. > I find where is the problem ,but dont' know why. > When I use or32-uclinux-objcopy command to get the ram.hex, > the "_start" physical address in RAM is 0x100, and CPU cannot jump > there. > But if i use orp_soc/sw/utils/bin2hex to convert the hello.bin to > hello.hex > (it's not the intel hex format),then copy the content of hello.hex to > altera ram.hex, my hello-uart runs ok. But in this condition the physical > address of "_start" is 0x40 (right shift 2 bit than 0x100). These two > kinds of hex files come from the same hello.bin or hello.or32, why make > out the different start address? > > > The following is the file using "or32-uclinux-dump -d hello.or32": > > > hello.or32: file format elf32-or32 > > Disassembly of section .vectors: > > 00000000 <_start-0x100>: > ... > > 00000100 <_start>: > 100: 18 20 00 00 l.movhi r1,0x0 > 104: a8 21 0d 52 l.ori r1,r1,0xd52 > 108: 9c 40 ff fd l.addi r2,r0,0xfffffffd > 10c: e0 21 10 03 l.and r1,r1,r2 > 110: 18 40 00 00 l.movhi r2,0x0 > 114: a8 42 06 50 l.ori r2,r2,0x650 > 118: 44 00 10 00 l.jr r2 > 11c: 9c 40 00 00 l.addi r2,r0,0x0 > > 00000120 <___main>: > 120: 44 00 48 00 l.jr r9 > 124: 15 00 00 00 l.nop 0x0 > Disassembly of section .text: > > 00000200 <_uart_init>: > 200: 9c 21 ff 44 l.addi r1,r1,0xffffff44 > 204: d4 01 10 00 l.sw 0x0(r1),r2 > 208: 9c 41 00 bc l.addi r2,r1,0xbc > 20c: 18 60 90 00 l.movhi r3,0x9000 > 210: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > 214: 84 82 ff f4 l.lwz r4,0xfffffff4(r2) > 218: a8 84 00 02 l.ori r4,r4,0x2 > 21c: d7 e2 27 f8 l.sw 0xfffffff8(r2),r4 > 220: 9c 60 ff c7 l.addi r3,r0,0xffffffc7 > 224: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > 228: 84 82 ff f0 l.lwz r4,0xfffffff0(r2) > 22c: db e2 27 ef l.sb 0xffffffef(r2),r4 > 230: 8c 82 ff ef l.lbz r4,0xffffffef(r2) > 234: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) > 238: d8 03 20 00 l.sb 0x0(r3),r4 > 23c: 18 60 90 00 l.movhi r3,0x9000 > 240: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 244: 84 82 ff e4 l.lwz r4,0xffffffe4(r2) > 248: a8 84 00 01 l.ori r4,r4,0x1 > 24c: d7 e2 27 e8 l.sw 0xffffffe8(r2),r4 > 250: 9c 60 00 00 l.addi r3,r0,0x0 > 254: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 > 258: 84 82 ff e0 l.lwz r4,0xffffffe0(r2) > 25c: db e2 27 df l.sb 0xffffffdf(r2),r4 > 260: 8c 82 ff df l.lbz r4,0xffffffdf(r2) > 264: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) > 268: d8 03 20 00 l.sb 0x0(r3),r4 > 26c: 18 60 90 00 l.movhi r3,0x9000 > 270: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 > 274: 84 82 ff d4 l.lwz r4,0xffffffd4(r2) > 278: a8 84 00 03 l.ori r4,r4,0x3 > 27c: d7 e2 27 d8 l.sw 0xffffffd8(r2),r4 > 280: 9c 60 00 03 l.addi r3,r0,0x3 > 284: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 > 288: 84 82 ff d0 l.lwz r4,0xffffffd0(r2) > 28c: db e2 27 cf l.sb 0xffffffcf(r2),r4 > 290: 8c 82 ff cf l.lbz r4,0xffffffcf(r2) > 294: 84 62 ff d8 l.lwz r3,0xffffffd8(r2) > 298: d8 03 20 00 l.sb 0x0(r3),r4 > 29c: 9c 60 00 41 l.addi r3,r0,0x41 > 2a0: d7 e2 1f c8 l.sw 0xffffffc8(r2),r3 > 2a4: 84 82 ff c8 l.lwz r4,0xffffffc8(r2) > 2a8: d7 e2 27 fc l.sw 0xfffffffc(r2),r4 > 2ac: 18 60 90 00 l.movhi r3,0x9000 > 2b0: d7 e2 1f c0 l.sw 0xffffffc0(r2),r3 > 2b4: 84 82 ff c0 l.lwz r4,0xffffffc0(r2) > 2b8: a8 84 00 03 l.ori r4,r4,0x3 > 2bc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 > 2c0: 18 60 90 00 l.movhi r3,0x9000 > 2c4: d7 e2 1f b8 l.sw 0xffffffb8(r2),r3 > 2c8: 84 82 ff b8 l.lwz r4,0xffffffb8(r2) > 2cc: a8 84 00 03 l.ori r4,r4,0x3 > 2d0: d7 e2 27 bc l.sw 0xffffffbc(r2),r4 > 2d4: 84 62 ff bc l.lwz r3,0xffffffbc(r2) > 2d8: 8c 63 00 00 l.lbz r3,0x0(r3) > 2dc: db e2 1f b7 l.sb 0xffffffb7(r2),r3 > 2e0: 9c 60 ff 80 l.addi r3,r0,0xffffff80 > 2e4: 8c 82 ff b7 l.lbz r4,0xffffffb7(r2) > 2e8: e0 64 18 04 l.or r3,r4,r3 > 2ec: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 > 2f0: 84 82 ff b0 l.lwz r4,0xffffffb0(r2) > 2f4: db e2 27 af l.sb 0xffffffaf(r2),r4 > 2f8: 8c 82 ff af l.lbz r4,0xffffffaf(r2) > 2fc: 84 62 ff c4 l.lwz r3,0xffffffc4(r2) > 300: d8 03 20 00 l.sb 0x0(r3),r4 > 304: 18 60 90 00 l.movhi r3,0x9000 > 308: d7 e2 1f a8 l.sw 0xffffffa8(r2),r3 > 30c: 84 82 ff fc l.lwz r4,0xfffffffc(r2) > 310: d7 e2 27 a4 l.sw 0xffffffa4(r2),r4 > 314: 9c 60 ff ff l.addi r3,r0,0xffffffff > 318: d7 e2 1f 9c l.sw 0xffffff9c(r2),r3 > 31c: 84 82 ff 9c l.lwz r4,0xffffff9c(r2) > 320: db e2 27 a3 l.sb 0xffffffa3(r2),r4 > 324: 84 62 ff a4 l.lwz r3,0xffffffa4(r2) > 328: db e2 1f 9b l.sb 0xffffff9b(r2),r3 > 32c: 8c 82 ff 9b l.lbz r4,0xffffff9b(r2) > 330: 8c 62 ff a3 l.lbz r3,0xffffffa3(r2) > 334: e0 84 18 03 l.and r4,r4,r3 > 338: d7 e2 27 94 l.sw 0xffffff94(r2),r4 > 33c: 84 82 ff 94 l.lwz r4,0xffffff94(r2) > 340: db e2 27 93 l.sb 0xffffff93(r2),r4 > 344: 8c 82 ff 93 l.lbz r4,0xffffff93(r2) > 348: 84 62 ff a8 l.lwz r3,0xffffffa8(r2) > 34c: d8 03 20 00 l.sb 0x0(r3),r4 > 350: 18 60 90 00 l.movhi r3,0x9000 > 354: d7 e2 1f 88 l.sw 0xffffff88(r2),r3 > 358: 84 82 ff 88 l.lwz r4,0xffffff88(r2) > 35c: a8 84 00 01 l.ori r4,r4,0x1 > 360: d7 e2 27 8c l.sw 0xffffff8c(r2),r4 > 364: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > 368: d7 e2 1f 80 l.sw 0xffffff80(r2),r3 > 36c: 84 82 ff 80 l.lwz r4,0xffffff80(r2) > 370: b8 84 00 88 l.srai r4,r4,0x8 > 374: d7 e2 27 84 l.sw 0xffffff84(r2),r4 > 378: 9c 60 ff ff l.addi r3,r0,0xffffffff > 37c: d7 e2 1f 78 l.sw 0xffffff78(r2),r3 > 380: 84 82 ff 78 l.lwz r4,0xffffff78(r2) > 384: db e2 27 7f l.sb 0xffffff7f(r2),r4 > 388: 84 62 ff 84 l.lwz r3,0xffffff84(r2) > 38c: db e2 1f 77 l.sb 0xffffff77(r2),r3 > 390: 8c 82 ff 77 l.lbz r4,0xffffff77(r2) > 394: 8c 62 ff 7f l.lbz r3,0xffffff7f(r2) > 398: e0 84 18 03 l.and r4,r4,r3 > 39c: d7 e2 27 70 l.sw 0xffffff70(r2),r4 > 3a0: 84 82 ff 70 l.lwz r4,0xffffff70(r2) > 3a4: db e2 27 6f l.sb 0xffffff6f(r2),r4 > 3a8: 8c 82 ff 6f l.lbz r4,0xffffff6f(r2) > 3ac: 84 62 ff 8c l.lwz r3,0xffffff8c(r2) > 3b0: d8 03 20 00 l.sb 0x0(r3),r4 > 3b4: 18 60 90 00 l.movhi r3,0x9000 > 3b8: d7 e2 1f 64 l.sw 0xffffff64(r2),r3 > 3bc: 84 82 ff 64 l.lwz r4,0xffffff64(r2) > 3c0: a8 84 00 03 l.ori r4,r4,0x3 > 3c4: d7 e2 27 68 l.sw 0xffffff68(r2),r4 > 3c8: 18 60 90 00 l.movhi r3,0x9000 > 3cc: d7 e2 1f 5c l.sw 0xffffff5c(r2),r3 > 3d0: 84 82 ff 5c l.lwz r4,0xffffff5c(r2) > 3d4: a8 84 00 03 l.ori r4,r4,0x3 > 3d8: d7 e2 27 60 l.sw 0xffffff60(r2),r4 > 3dc: 9c 60 00 7f l.addi r3,r0,0x7f > 3e0: d7 e2 1f 54 l.sw 0xffffff54(r2),r3 > 3e4: 84 82 ff 54 l.lwz r4,0xffffff54(r2) > 3e8: db e2 27 5b l.sb 0xffffff5b(r2),r4 > 3ec: 84 62 ff 60 l.lwz r3,0xffffff60(r2) > 3f0: 8c 63 00 00 l.lbz r3,0x0(r3) > 3f4: db e2 1f 53 l.sb 0xffffff53(r2),r3 > 3f8: 8c 82 ff 53 l.lbz r4,0xffffff53(r2) > 3fc: 8c 62 ff 5b l.lbz r3,0xffffff5b(r2) > 400: e0 84 18 03 l.and r4,r4,r3 > 404: d7 e2 27 4c l.sw 0xffffff4c(r2),r4 > 408: 84 82 ff 4c l.lwz r4,0xffffff4c(r2) > 40c: db e2 27 4b l.sb 0xffffff4b(r2),r4 > 410: 8c 82 ff 4b l.lbz r4,0xffffff4b(r2) > 414: 84 62 ff 68 l.lwz r3,0xffffff68(r2) > 418: d8 03 20 00 l.sb 0x0(r3),r4 > 41c: 84 41 00 00 l.lwz r2,0x0(r1) > 420: 44 00 48 00 l.jr r9 > 424: 9c 21 00 bc l.addi r1,r1,0xbc > > 00000428 <_uart_putc>: > 428: 9c 21 ff 9c l.addi r1,r1,0xffffff9c > 42c: d4 01 10 00 l.sw 0x0(r1),r2 > 430: 9c 41 00 64 l.addi r2,r1,0x64 > 434: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 > 438: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) > 43c: db e2 1f f7 l.sb 0xfffffff7(r2),r3 > 440: 8c 82 ff f7 l.lbz r4,0xfffffff7(r2) > 444: db e2 27 ff l.sb 0xffffffff(r2),r4 > 448: 18 60 90 00 l.movhi r3,0x9000 > 44c: d7 e2 1f ec l.sw 0xffffffec(r2),r3 > 450: 84 82 ff ec l.lwz r4,0xffffffec(r2) > 454: a8 84 00 05 l.ori r4,r4,0x5 > 458: d7 e2 27 f0 l.sw 0xfffffff0(r2),r4 > 45c: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) > 460: 8c 63 00 00 l.lbz r3,0x0(r3) > 464: db e2 1f eb l.sb 0xffffffeb(r2),r3 > 468: 8c 82 ff eb l.lbz r4,0xffffffeb(r2) > 46c: db e2 27 fe l.sb 0xfffffffe(r2),r4 > 470: 8c 62 ff fe l.lbz r3,0xfffffffe(r2) > 474: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 478: 84 82 ff e4 l.lwz r4,0xffffffe4(r2) > 47c: a4 84 00 20 l.andi r4,r4,0x20 > 480: d7 e2 27 e0 l.sw 0xffffffe0(r2),r4 > 484: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) > 488: bc 23 00 00 l.sfnei r3,0x0 > 48c: 10 00 00 04 l.bf 49c <_uart_putc+0x74> > 490: 15 00 00 00 l.nop 0x0 > 494: 03 ff ff ed l.j 448 <_uart_putc+0x20> > 498: 15 00 00 00 l.nop 0x0 > 49c: 18 80 90 00 l.movhi r4,0x9000 > 4a0: d7 e2 27 dc l.sw 0xffffffdc(r2),r4 > 4a4: 8c 62 ff ff l.lbz r3,0xffffffff(r2) > 4a8: db e2 1f db l.sb 0xffffffdb(r2),r3 > 4ac: 8c 62 ff db l.lbz r3,0xffffffdb(r2) > 4b0: 84 82 ff dc l.lwz r4,0xffffffdc(r2) > 4b4: d8 04 18 00 l.sb 0x0(r4),r3 > 4b8: 90 82 ff ff l.lbs r4,0xffffffff(r2) > 4bc: d7 e2 27 d4 l.sw 0xffffffd4(r2),r4 > 4c0: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) > 4c4: bc 23 00 0a l.sfnei r3,0xa > 4c8: 10 00 00 20 l.bf 548 <_uart_putc+0x120> > 4cc: 15 00 00 00 l.nop 0x0 > 4d0: 18 80 90 00 l.movhi r4,0x9000 > 4d4: d7 e2 27 cc l.sw 0xffffffcc(r2),r4 > 4d8: 84 62 ff cc l.lwz r3,0xffffffcc(r2) > 4dc: a8 63 00 05 l.ori r3,r3,0x5 > 4e0: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 > 4e4: 84 82 ff d0 l.lwz r4,0xffffffd0(r2) > 4e8: 8c 84 00 00 l.lbz r4,0x0(r4) > 4ec: db e2 27 cb l.sb 0xffffffcb(r2),r4 > 4f0: 8c 62 ff cb l.lbz r3,0xffffffcb(r2) > 4f4: db e2 1f fe l.sb 0xfffffffe(r2),r3 > 4f8: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) > 4fc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 > 500: 84 62 ff c4 l.lwz r3,0xffffffc4(r2) > 504: a4 63 00 20 l.andi r3,r3,0x20 > 508: d7 e2 1f c0 l.sw 0xffffffc0(r2),r3 > 50c: 84 82 ff c0 l.lwz r4,0xffffffc0(r2) > 510: bc 24 00 00 l.sfnei r4,0x0 > 514: 10 00 00 04 l.bf 524 <_uart_putc+0xfc> > 518: 15 00 00 00 l.nop 0x0 > 51c: 03 ff ff ed l.j 4d0 <_uart_putc+0xa8> > 520: 15 00 00 00 l.nop 0x0 > 524: 18 60 90 00 l.movhi r3,0x9000 > 528: d7 e2 1f bc l.sw 0xffffffbc(r2),r3 > 52c: 9c 80 00 0d l.addi r4,r0,0xd > 530: d7 e2 27 b8 l.sw 0xffffffb8(r2),r4 > 534: 84 62 ff b8 l.lwz r3,0xffffffb8(r2) > 538: db e2 1f b7 l.sb 0xffffffb7(r2),r3 > 53c: 8c 62 ff b7 l.lbz r3,0xffffffb7(r2) > 540: 84 82 ff bc l.lwz r4,0xffffffbc(r2) > 544: d8 04 18 00 l.sb 0x0(r4),r3 > 548: 18 80 90 00 l.movhi r4,0x9000 > 54c: d7 e2 27 ac l.sw 0xffffffac(r2),r4 > 550: 84 62 ff ac l.lwz r3,0xffffffac(r2) > 554: a8 63 00 05 l.ori r3,r3,0x5 > 558: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 > 55c: 84 82 ff b0 l.lwz r4,0xffffffb0(r2) > 560: 8c 84 00 00 l.lbz r4,0x0(r4) > 564: db e2 27 ab l.sb 0xffffffab(r2),r4 > 568: 8c 62 ff ab l.lbz r3,0xffffffab(r2) > 56c: db e2 1f fe l.sb 0xfffffffe(r2),r3 > 570: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) > 574: d7 e2 27 a4 l.sw 0xffffffa4(r2),r4 > 578: 84 62 ff a4 l.lwz r3,0xffffffa4(r2) > 57c: a4 63 00 60 l.andi r3,r3,0x60 > 580: d7 e2 1f a0 l.sw 0xffffffa0(r2),r3 > 584: 84 82 ff a0 l.lwz r4,0xffffffa0(r2) > 588: bc 04 00 60 l.sfeqi r4,0x60 > 58c: 10 00 00 04 l.bf 59c <_uart_putc+0x174> > 590: 15 00 00 00 l.nop 0x0 > 594: 03 ff ff ed l.j 548 <_uart_putc+0x120> > 598: 15 00 00 00 l.nop 0x0 > 59c: 84 41 00 00 l.lwz r2,0x0(r1) > 5a0: 44 00 48 00 l.jr r9 > 5a4: 9c 21 00 64 l.addi r1,r1,0x64 > > 000005a8 <_uart_getc>: > 5a8: 9c 21 ff d0 l.addi r1,r1,0xffffffd0 > 5ac: d4 01 10 00 l.sw 0x0(r1),r2 > 5b0: 9c 41 00 30 l.addi r2,r1,0x30 > 5b4: 18 60 90 00 l.movhi r3,0x9000 > 5b8: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > 5bc: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) > 5c0: a8 63 00 05 l.ori r3,r3,0x5 > 5c4: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > 5c8: 84 62 ff f4 l.lwz r3,0xfffffff4(r2) > 5cc: 8c 63 00 00 l.lbz r3,0x0(r3) > 5d0: db e2 1f ef l.sb 0xffffffef(r2),r3 > 5d4: 8c 62 ff ef l.lbz r3,0xffffffef(r2) > 5d8: db e2 1f ff l.sb 0xffffffff(r2),r3 > 5dc: 8c 62 ff ff l.lbz r3,0xffffffff(r2) > 5e0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 > 5e4: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) > 5e8: ac 63 00 01 l.xori r3,r3,0x1 > 5ec: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 5f0: 84 62 ff e4 l.lwz r3,0xffffffe4(r2) > 5f4: a4 63 00 01 l.andi r3,r3,0x1 > 5f8: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 > 5fc: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) > 600: bc 03 00 00 l.sfeqi r3,0x0 > 604: 10 00 00 04 l.bf 614 <_uart_getc+0x6c> > 608: 15 00 00 00 l.nop 0x0 > 60c: 03 ff ff ea l.j 5b4 <_uart_getc+0xc> > 610: 15 00 00 00 l.nop 0x0 > 614: 18 60 90 00 l.movhi r3,0x9000 > 618: d7 e2 1f dc l.sw 0xffffffdc(r2),r3 > 61c: 84 62 ff dc l.lwz r3,0xffffffdc(r2) > 620: 8c 63 00 00 l.lbz r3,0x0(r3) > 624: db e2 1f db l.sb 0xffffffdb(r2),r3 > 628: 8c 62 ff db l.lbz r3,0xffffffdb(r2) > 62c: db e2 1f fe l.sb 0xfffffffe(r2),r3 > 630: 90 62 ff fe l.lbs r3,0xfffffffe(r2) > 634: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 > 638: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) > 63c: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 > 640: 85 62 ff f8 l.lwz r11,0xfffffff8(r2) > 644: 84 41 00 00 l.lwz r2,0x0(r1) > 648: 44 00 48 00 l.jr r9 > 64c: 9c 21 00 30 l.addi r1,r1,0x30 > > 00000650 <_main>: > 650: 9c 21 ff c4 l.addi r1,r1,0xffffffc4 > 654: d4 01 10 04 l.sw 0x4(r1),r2 > 658: 9c 41 00 3c l.addi r2,r1,0x3c > 65c: d4 01 48 00 l.sw 0x0(r1),r9 > 660: 07 ff fe e8 l.jal 200 <_uart_init> > 664: 15 00 00 00 l.nop 0x0 > 668: 18 60 00 00 l.movhi r3,0x0 > 66c: a8 63 07 44 l.ori r3,r3,0x744 > 670: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 > 674: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) > 678: 84 63 00 00 l.lwz r3,0x0(r3) > 67c: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > 680: 84 62 ff f4 l.lwz r3,0xfffffff4(r2) > 684: d7 e2 1f fc l.sw 0xfffffffc(r2),r3 > 688: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > 68c: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > 690: 84 62 ff f0 l.lwz r3,0xfffffff0(r2) > 694: 90 63 00 00 l.lbs r3,0x0(r3) > 698: d7 e2 1f ec l.sw 0xffffffec(r2),r3 > 69c: 84 62 ff ec l.lwz r3,0xffffffec(r2) > 6a0: bc 03 00 00 l.sfeqi r3,0x0 > 6a4: 10 00 00 13 l.bf 6f0 <_main+0xa0> > 6a8: 15 00 00 00 l.nop 0x0 > 6ac: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > 6b0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 > 6b4: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) > 6b8: 90 63 00 00 l.lbs r3,0x0(r3) > 6bc: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 6c0: 84 62 ff e4 l.lwz r3,0xffffffe4(r2) > 6c4: 07 ff ff 59 l.jal 428 <_uart_putc> > 6c8: 15 00 00 00 l.nop 0x0 > 6cc: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > 6d0: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 > 6d4: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) > 6d8: 9c 63 00 01 l.addi r3,r3,0x1 > 6dc: d7 e2 1f dc l.sw 0xffffffdc(r2),r3 > 6e0: 84 62 ff dc l.lwz r3,0xffffffdc(r2) > 6e4: d7 e2 1f fc l.sw 0xfffffffc(r2),r3 > 6e8: 03 ff ff e8 l.j 688 <_main+0x38> > 6ec: 15 00 00 00 l.nop 0x0 > 6f0: 07 ff ff ae l.jal 5a8 <_uart_getc> > 6f4: 15 00 00 00 l.nop 0x0 > 6f8: d7 e2 5f d8 l.sw 0xffffffd8(r2),r11 > 6fc: 84 62 ff d8 l.lwz r3,0xffffffd8(r2) > 700: 9c 63 00 01 l.addi r3,r3,0x1 > 704: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 > 708: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) > 70c: b8 63 00 18 l.slli r3,r3,0x18 > 710: d7 e2 1f cc l.sw 0xffffffcc(r2),r3 > 714: 84 62 ff cc l.lwz r3,0xffffffcc(r2) > 718: b8 63 00 98 l.srai r3,r3,0x18 > 71c: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 > 720: 84 62 ff d0 l.lwz r3,0xffffffd0(r2) > 724: 07 ff ff 41 l.jal 428 <_uart_putc> > 728: 15 00 00 00 l.nop 0x0 > 72c: 03 ff ff f1 l.j 6f0 <_main+0xa0> > 730: 15 00 00 00 l.nop 0x0 > 734: 85 21 00 00 l.lwz r9,0x0(r1) > 738: 84 41 00 04 l.lwz r2,0x4(r1) > 73c: 44 00 48 00 l.jr r9 > 740: 9c 21 00 3c l.addi r1,r1,0x3c > > > > ----- Original Message ----- > From: Robert Cragie<rcc@j...> > To: > Date: Thu Nov 22 11:30:49 CET 2007 > Subject: [openrisc] how to run hello world in on-chip ram? > > > Can you post the disassembly of your hello.or32 file?: > > > > or32-uclinux-objdump -d hello.or32 > > > > That will give a clearer picture of where everything is. > > > > Robert > > > > Robert Cragie, Design Engineer > > > _____________________________________________________________ > __ > > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > > http://www.jennic.com Tel: +44 (0) 114 281 2655 > > > _______________________________________________ > http://www.opencores.org/mailman/listinfo/openrisc _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram?You are right. the on_chip_ram address instantiated as:
altsyncram altsyncram_component ( .wren_a (we), .clock0 (wb_clk_i), .byteena_a (be_i), .address_a (wb_adr_i[aw+1:2]), ****This should be point. .data_a (wb_dat_i), .q_a (wb_dat_o) ) ----- Original Message ----- From: Robert Cragie<rcc@j...> To: Date: Fri Nov 23 10:46:34 CET 2007 Subject: [openrisc] how to run hello world in on-chip ram? > OK, I guess the Intelhex bit ended up being misleading. I have > never > actually attempted what you are doing. With respect to the > addresses, again > I guess that the address bus to the memory actually starts at > address bit 2, > with address bits 1 and 0 decoded for the byte lanes of 32-bit wide > memory. > Therefore it seems reasonable to me that the address *lines* will > appear to > be shifted by 2 as you state. > Robert > Robert Cragie, Design Engineer > __ > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > http://www.jennic.com Tel: +44 (0) 114 281 2655 > _____________________________________________________________ __ > > -----Original Message----- > > From: openrisc-bounces at opencores.org > > [mailto:openrisc-bounces at opencores.org]On Behalf Of charlie > yang > > Sent: 23 November 2007 01:58 > > To: openrisc at opencores.org > > Subject: Re: [openrisc] how to run hello world in on-chip ram? > > > > > > Thanks Robert. > > I find where is the problem ,but dont' know why. > > When I use or32-uclinux-objcopy command to get the ram.hex, > > the "_start" physical address in RAM is 0x100, and > CPU cannot jump > > there. > > But if i use orp_soc/sw/utils/bin2hex to convert the hello.bin > to > > hello.hex > > (it's not the intel hex format),then copy the content of > hello.hex to > > altera ram.hex, my hello-uart runs ok. But in this condition > the physical > > address of "_start" is 0x40 (right shift 2 bit than > 0x100). These two > > kinds of hex files come from the same hello.bin or hello.or32, > why make > > out the different start address? > > > > > > The following is the file using "or32-uclinux-dump -d > hello.or32": > > > > > > hello.or32: file format elf32-or32 > > > > Disassembly of section .vectors: > > > > 00000000 <_start-0x100>: > > ... > > > > 00000100 <_start>: > > 100: 18 20 00 00 l.movhi r1,0x0 > > 104: a8 21 0d 52 l.ori r1,r1,0xd52 > > 108: 9c 40 ff fd l.addi r2,r0,0xfffffffd > > 10c: e0 21 10 03 l.and r1,r1,r2 > > 110: 18 40 00 00 l.movhi r2,0x0 > > 114: a8 42 06 50 l.ori r2,r2,0x650 > > 118: 44 00 10 00 l.jr r2 > > 11c: 9c 40 00 00 l.addi r2,r0,0x0 > > > > 00000120 <___main>: > > 120: 44 00 48 00 l.jr r9 > > 124: 15 00 00 00 l.nop 0x0 > > Disassembly of section .text: > > > > 00000200 <_uart_init>: > > 200: 9c 21 ff 44 l.addi r1,r1,0xffffff44 > > 204: d4 01 10 00 l.sw 0x0(r1),r2 > > 208: 9c 41 00 bc l.addi r2,r1,0xbc > > 20c: 18 60 90 00 l.movhi r3,0x9000 > > 210: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > > 214: 84 82 ff f4 l.lwz r4,0xfffffff4(r2) > > 218: a8 84 00 02 l.ori r4,r4,0x2 > > 21c: d7 e2 27 f8 l.sw 0xfffffff8(r2),r4 > > 220: 9c 60 ff c7 l.addi r3,r0,0xffffffc7 > > 224: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > > 228: 84 82 ff f0 l.lwz r4,0xfffffff0(r2) > > 22c: db e2 27 ef l.sb 0xffffffef(r2),r4 > > 230: 8c 82 ff ef l.lbz r4,0xffffffef(r2) > > 234: 84 62 ff f8 l.lwz r3,0xfffffff8(r2) > > 238: d8 03 20 00 l.sb 0x0(r3),r4 > > 23c: 18 60 90 00 l.movhi r3,0x9000 > > 240: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > > 244: 84 82 ff e4 l.lwz r4,0xffffffe4(r2) > > 248: a8 84 00 01 l.ori r4,r4,0x1 > > 24c: d7 e2 27 e8 l.sw 0xffffffe8(r2),r4 > > 250: 9c 60 00 00 l.addi r3,r0,0x0 > > 254: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 > > 258: 84 82 ff e0 l.lwz r4,0xffffffe0(r2) > > 25c: db e2 27 df l.sb 0xffffffdf(r2),r4 > > 260: 8c 82 ff df l.lbz r4,0xffffffdf(r2) > > 264: 84 62 ff e8 l.lwz r3,0xffffffe8(r2) > > 268: d8 03 20 00 l.sb 0x0(r3),r4 > > 26c: 18 60 90 00 l.movhi r3,0x9000 > > 270: d7 e2 1f d4 l.sw 0xffffffd4(r2),r3 > > 274: 84 82 ff d4 l.lwz r4,0xffffffd4(r2) > > 278: a8 84 00 03 l.ori r4,r4,0x3 > > 27c: d7 e2 27 d8 l.sw 0xffffffd8(r2),r4 > > 280: 9c 60 00 03 l.addi r3,r0,0x3 > > 284: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 > > 288: 84 82 ff d0 l.lwz r4,0xffffffd0(r2) > > 28c: db e2 27 cf l.sb 0xffffffcf(r2),r4 > > 290: 8c 82 ff cf l.lbz r4,0xffffffcf(r2) > 294: 84 62 ff > d8 l.lwz r3,0xffffffd8(r2) > 298: d8 03 20 00 l.sb 0x0(r3),r4 > > 29c: 9c 60 00 41 l.addi r3,r0,0x41 > 2a0: d7 e2 1f c8 > l.sw 0xffffffc8(r2),r3 > 2a4: 84 82 ff c8 l.lwz > r4,0xffffffc8(r2) > 2a8: d7 e2 27 fc l.sw 0xfffffffc(r2),r4 > > 2ac: 18 60 90 00 l.movhi r3,0x9000 > 2b0: d7 e2 1f c0 > l.sw 0xffffffc0(r2),r3 > 2b4: 84 82 ff c0 l.lwz > r4,0xffffffc0(r2) > 2b8: a8 84 00 03 l.ori r4,r4,0x3 > > 2bc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 > 2c0: 18 60 90 00 > l.movhi r3,0x9000 > 2c4: d7 e2 1f b8 l.sw 0xffffffb8 > > 2c8: 84 82 ff b8 l.lwz r4,0xffffffb8(r2) > 2cc: a8 84 00 > 03 l.ori r4,r4,0x3 > 2d0: d7 e2 27 bc l.sw 0xffffffbc (r2),r4 > > 2d4: 84 62 ff bc l.lwz r3,0xffffffbc(r2) > 2d8: 8c 63 00 > 00 l.lbz r3,0x0(r3) > 2dc: db e2 1f b7 l.sb 0xffffffb7 (r2),r3 > > 2e0: 9c 60 ff 80 l.addi r3,r0,0xffffff80 > 2e4: 8c 82 ff > b7 l.lbz r4,0xffffffb7(r2) > 2e8: e0 64 18 04 l.or r3,r4,r3 > > 2ec: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 > 2f0: 84 82 ff b0 > l.lwz r4,0xffffffb0(r2) > 2f4: db e2 27 af l.sb > 0xffffffaf(r2),r4 > 2f8: 8c 82 ff af l.lbz r4,0xffffffaf(r2) > > 2fc: 84 62 ff c4 l.lwz r3,0xffffffc4(r2) > 300: d8 03 20 > 00 l.sb 0x0(r3),r4 > 304: 18 60 90 00 l.movhi r3,0x9000 > > 308: d7 e2 1f a8 l.sw 0xffffffa8(r2),r3 > 30c: 84 82 ff fc > l.lwz r4,0xfffffffc(r2) > 310: d7 e2 27 a4 l.sw > 0xffffffa4(r2),r4 > 314: 9c 60 ff ff l.addi r3,r0,0xffffffff > > 318: d7 e2 1f 9c l.sw 0xffffff9c(r2),r3 > 31c: 84 82 ff 9c > l.lwz r4,0xffffff9c(r2) > 320: db e2 27 a3 l.sb > 0xffffffa3(r2),r4 > 324: 84 62 ff a4 l.lwz r3,0xffffffa4(r2) > > 328: db e2 1f 9b l.sb 0xffffff9b(r2),r3 > 32c: 8c 82 ff 9b > l.lbz r4,0xffffff9b(r2) > 330: 8c 62 ff a3 l.lbz > r3,0xffffffa3(r2) > 334: e0 84 18 03 l.and r4,r4,r3 > > 338: d7 e2 27 94 l.sw 0xffffff94(r2),r4 > 33c: 84 82 ff 94 > l.lwz r4,0xffffff94(r2) > 340: db e2 27 93 l.sb > 0xffffff93(r2),r4 > 344: 8c 82 ff 93 l.lbz r4,0xffffff93(r2) > > 348: 84 62 ff a8 l.lwz r3,0xffffffa8(r2) > 34c: d8 03 20 > 00 l.sb 0x0(r3),r4 > 350: 18 60 90 00 l.movhi > 354: d7 e2 1f 88 l.sw 0xffffff88(r2),r3 > 358: 84 82 ff 88 > l.lwz r4,0xffffff88(r2) > 35c: a8 84 00 01 l.ori r4,r4,0x1 > > 360: d7 e2 27 8c l.sw 0xffffff8c(r2),r4 > 364: 84 62 ff fc > l.lwz r3,0xfffffffc(r2) > 368: d7 e2 1f 80 l.sw > 0xffffff80(r2),r3 > 36c: 84 82 ff 80 l.lwz r4,0xffffff80(r2) > > 370: b8 84 00 88 l.srai r4,r4,0x8 > 374: d7 e2 27 84 l.sw > 0xffffff84(r2),r4 > 378: 9c 60 ff ff l.addi r3,r0,0xffffffff > > 37c: d7 e2 1f 78 l.sw 0xffffff78(r2),r3 > 380: 84 82 ff 78 > l.lwz r4,0xffffff78(r2) > 384: db e2 27 7f l.sb > 0xffffff7f(r2),r4 > 388: 84 62 ff 84 l.lwz r3,0xffffff84(r2) > > 38c: db e2 1f 77 l.sb 0xffffff77(r2),r3 > 390: 8c 82 ff 77 > l.lbz r4,0xffffff77(r2) > 394: 8c 62 ff 7f l.lbz > r3,0xffffff7f(r2) > 398: e0 84 18 03 l.and r4,r4,r3 > > 39c: d7 e2 27 70 l.sw 0xffffff70(r2),r4 > 3a0: 84 82 ff 70 > l.lwz r4,0xffffff70(r2) > 3a4: db e2 27 6f l.sb > 0xffffff6f(r2),r4 > 3a8: 8c 82 ff 6f l.lbz r4,0xffffff6f(r2) > > 3ac: 84 62 ff 8c l.lwz r3,0xffffff8c(r2) > 3b0: d8 03 20 > 00 l.sb 0x0(r3),r4 > 3b4: 18 60 90 00 l.movhi > 3b8: d7 e2 1f 64 l.sw 0xffffff64(r2),r3 > 3bc: 84 82 ff 64 > l.lwz r4,0xffffff64(r2) > 3c0: a8 84 00 03 l.ori r4,r4,0x3 > > 3c4: d7 e2 27 68 l.sw 0xffffff68(r2),r4 > 3c8: 18 60 90 00 > l.movhi r3,0x9000 > 3cc: d7 e2 1f 5c l.sw 0xffffff5c (r2),r3 > > 3d0: 84 82 ff 5c l.lwz r4,0xffffff5c(r2) > 3d4: a8 84 00 > 03 l.ori r4,r4,0x3 > 3d8: d7 e2 27 60 l.sw 0xffffff60 (r2),r4 > > 3dc: 9c 60 00 7f l.addi r3,r0,0x7f > 3e0: d7 e2 1f 54 > l.sw 0xffffff54(r2),r3 > 3e4: 84 82 ff 54 l.lwz > r4,0xffffff54(r2) > 3e8: db e2 27 5b l.sb 0xffffff5b(r2),r4 > > 3ec: 84 62 ff 60 l.lwz r3,0xffffff60(r2) > 3f0: 8c 63 00 > 00 l.lbz r3,0x0(r3) > 3f4: db e2 1f 53 l.sb 0xffffff53 (r2),r3 > > 3f8: 8c 82 ff 53 l.lbz r4,0xffffff53(r2) > 3fc: 8c 62 ff > 5b l.lbz r3,0xffffff5b(r2) > 400: e0 84 18 03 l.and r4,r4,r3 > > 404: d7 e2 27 4c l.sw 0xffffff4c(r2),r4 > 408: 84 82 ff 4c > l.lwz r4,0xffffff4c(r2) > 40c: db e2 27 4b l.sb > 0xffffff4b(r2),r4 > 410: 8c 82 ff 4b l.lbz r4,0xffffff4b(r2) > > 414: 84 62 ff 68 l.lwz r3,0xffffff68(r2) > 418: d8 03 20 > 00 l.sb 0x0(r3),r4 > 41c: 84 41 00 00 l.lwz r2,0x0 (r1) > > 420: 44 00 48 00 l.jr r9 > 424: 9c 21 00 bc l.addi r1,r1,0xbc > > > 00000428 <_uart_putc>: > 428: 9c 21 ff 9c > l.addi r1,r1,0xffffff9c > 42c: d4 01 10 00 l.sw 0x0(r1),r2 > > 430: 9c 41 00 64 l.addi r2,r1,0x64 > 434: d7 e2 1f f8 > l.sw 0xfffffff8(r2),r3 > 438: 84 62 ff f8 l.lwz > r3,0xfffffff8(r2) > 43c: db e2 1f f7 l.sb 0xfffffff7(r2),r3 > > 440: 8c 82 ff f7 l.lbz r4,0xfffffff7(r2) > 444: db e2 27 > ff l.sb 0xffffffff(r2),r4 > 448: 18 60 90 00 l.movhi r3,0x9000 > > 44c: d7 e2 1f ec l.sw 0xffffffec(r2),r3 > 450: 84 82 ff ec > l.lwz r4,0xffffffec(r2) > 454: a8 84 00 05 l.ori r4,r4,0x5 > > 458: d7 e2 27 f0 l.sw 0xfffffff0(r2),r4 > 45c: 84 62 ff f0 > l.lwz r3,0xfffffff0(r2) > 460: 8c 63 00 00 l.lbz r3,0x0(r3) > > 464: db e2 1f eb l.sb 0xffffffeb(r2),r3 > 468: 8c 82 ff eb > l.lbz r4,0xffffffeb(r2) > 46c: db e2 27 fe l.sb > 0xfffffffe(r2),r4 > 470: 8c 62 ff fe l.lbz r3,0xfffffffe(r2) > > 474: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 478: 84 82 ff e4 > l.lwz r4,0xffffffe4(r2) > 47c: a4 84 00 20 l.andi r4,r4,0x20 > > 480: d7 e2 27 e0 l.sw 0xffffffe0(r2),r4 > 484: 84 62 ff e0 > l.lwz r3,0xffffffe0(r2) > 488: bc 23 00 00 l.sfnei r3,0x0 > > 48c: 10 00 00 04 l.bf 49c <_uart_putc+0x74> > 490: 15 00 > 00 00 l.nop 0x0 > 494: 03 ff ff ed l.j 448 > <_uart_putc+0x20> > 498: 15 00 00 00 l.nop 0x0 > > 49c: 18 80 90 00 l.movhi r4,0x9000 > 4a0: d7 e2 27 dc l.sw > 0xffffffdc(r2),r4 > 4a4: 8c 62 ff ff l.lbz r3,0xffffffff(r2) > > 4a8: db e2 1f db l.sb 0xffffffdb(r2),r3 > 4ac: 8c 62 ff db > l.lbz r3,0xffffffdb(r2) > 4b0: 84 82 ff dc l.lwz > r4,0xffffffdc(r2) > 4b4: d8 04 18 00 l.sb 0x0(r4),r3 > > 4b8: 90 82 ff ff l.lbs r4,0xffffffff(r2) > 4bc: d7 e2 27 d4 > l.sw 0xffffffd4(r2),r4 > 4c0: 84 62 ff d4 l.lwz > r3,0xffffffd4(r2) > 4c4: bc 23 00 0a l.sfnei r3,0xa > > 4c8: 10 00 00 20 l.bf 548 <_uart_putc+0x120> > 4cc: 15 00 > 00 00 l.nop 0x0 > 4d0: 18 80 90 00 l.movhi r4,0x9000 > > 4d4: d7 e2 27 cc l.sw 0xffffffcc(r2),r4 > 4d8: 84 62 ff cc > l.lwz r3,0xffffffcc(r2) > 4dc: a8 63 00 05 l.ori r3,r3,0x5 > > 4e0: d7 e2 1f d0 l.sw 0xffffffd0(r2),r3 > 4e4: 84 82 ff d0 > l.lwz r4,0xffffffd0(r2) > 4e8: 8c 84 00 00 l.lbz r4,0x0(r4) > > 4ec: db e2 27 cb l.sb 0xffffffcb(r2),r4 > 4f0: 8c 62 ff cb > l.lbz r3,0xffffffcb(r2) > 4f4: db e2 1f fe l.sb > 0xfffffffe(r2),r3 > 4f8: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) > > 4fc: d7 e2 27 c4 l.sw 0xffffffc4(r2),r4 > 500: 84 62 ff c4 > l.lwz r3,0xffffffc4(r2) > 504: a4 63 00 20 l.andi > > 508: d7 e2 1f c0 l.sw 0xffffffc0(r2),r3 > 50c: 84 82 ff c0 > l.lwz r4,0xffffffc0(r2) > 510: bc 24 00 00 l.sfnei r4,0x0 > > 514: 10 00 00 04 l.bf 524 <_uart_putc+0xfc> > 518: 15 00 > 00 00 l.nop 0x0 > 51c: 03 ff ff ed l.j 4d0 > <_uart_putc+0xa8> > 520: 15 00 00 00 l.nop 0x0 > > 524: 18 60 90 00 l.movhi r3,0x9000 > 528: d7 e2 1f bc l.sw > 0xffffffbc(r2),r3 > 52c: 9c 80 00 0d l.addi r4,r0,0xd > > 530: d7 e2 27 b8 l.sw 0xffffffb8(r2),r4 > 534: 84 62 ff b8 > l.lwz r3,0xffffffb8(r2) > 538: db e2 1f b7 l.sb > 0xffffffb7(r2),r3 > 53c: 8c 62 ff b7 l.lbz r3,0xffffffb7(r2) > > 540: 84 82 ff bc l.lwz r4,0xffffffbc(r2) > 544: d8 04 18 > 00 l.sb 0x0(r4),r3 > 548: 18 80 90 00 l.movhi r4,0x9000 > > 54c: d7 e2 27 ac l.sw 0xffffffac(r2),r4 > 550: 84 62 ff ac > l.lwz r3,0xffffffac(r2) > 554: a8 63 00 05 l.ori r3,r3,0x5 > > 558: d7 e2 1f b0 l.sw 0xffffffb0(r2),r3 > 55c: 84 82 ff b0 > l.lwz r4,0xffffffb0(r2) > 560: 8c 84 00 00 l.lbz r4,0x0(r4) > > 564: db e2 27 ab l.sb 0xffffffab(r2),r4 > 568: 8c 62 ff ab > l.lbz r3,0xffffffab(r2) > 56c: db e2 1f fe l.sb > 0xfffffffe(r2),r3 > 570: 8c 82 ff fe l.lbz r4,0xfffffffe(r2) > > 574: d7 e2 27 a4 l.sw 0xffffffa4(r2),r4 > 578: 84 62 ff a4 > l.lwz r3,0xffffffa4(r2) > 57c: a4 63 00 60 l.andi r3,r3,0x60 > > 580: d7 e2 1f a0 l.sw 0xffffffa0(r2),r3 > 584: 84 82 ff a0 > l.lwz r4,0xffffffa0(r2) > 588: bc 04 00 60 l.sfeqi r4,0x60 > > 58c: 10 00 00 04 l.bf 59c <_uart_putc+0x174> > > 590: 15 00 00 00 l.nop 0x0 > 594: 03 ff ff ed l.j 548 > <_uart_putc+0x120> > 598: 15 00 00 00 l.nop 0x0 > > 59c: 84 41 00 00 l.lwz r2,0x0(r1) > 5a0: 44 00 48 00 l.jr r9 > > 5a4: 9c 21 00 64 l.addi r1,r1,0x64 > > 000005a8 > <_uart_getc>: > 5a8: 9c 21 ff d0 l.addi r1,r1,0xffffffd0 > > 5ac: d4 01 10 00 l.sw 0x0(r1),r2 > 5b0: 9c 41 00 30 > l.addi r2,r1,0x30 > 5b4: 18 60 90 00 l.movhi r3,0x9000 > > 5b8: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > 5bc: 84 62 ff f0 > l.lwz r3,0xfffffff0(r2) > 5c0: a8 63 00 05 l.ori r3,r3,0x5 > > 5c4: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > 5c8: 84 62 ff f4 > l.lwz r3,0xfffffff4(r2) > 5cc: 8c 63 00 00 l.lbz r3,0x0(r3) > > 5d0: db e2 1f ef l.sb 0xffffffef(r2),r3 > 5d4: 8c 62 ff ef > l.lbz r3,0xffffffef(r2) > 5d8: db e2 1f ff l.sb > 0xffffffff(r2),r3 > 5dc: 8c 62 ff ff l.lbz r3,0xffffffff(r2) > > 5e0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 > 5e4: 84 62 ff e8 > l.lwz r3,0xffffffe8(r2) > 5e8: ac 63 00 01 l.xori r3,r3,0x1 > > 5ec: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 5f0: 84 62 ff e4 > l.lwz r3,0xffffffe4(r2) > 5f4: a4 63 00 01 l.andi r3,r3,0x1 > > 5f8: d7 e2 1f e0 l.sw 0xffffffe0(r2),r3 > 5fc: 84 62 ff e0 > l.lwz r3,0xffffffe0(r2) > 600: bc 03 00 00 l.sfeqi r3,0x0 > > 604: 10 00 00 04 l.bf 614 <_uart_getc+0x6c> > 608: 15 > 00 00 l.nop 0x0 > 60c: 03 ff ff ea l.j 5b4 > <_uart_getc+0xc> > 610: 15 00 00 00 l.nop 0x0 > > 614: 18 60 90 00 l.movhi r3,0x9000 > 618: d7 e2 1f dc l.sw > 0xffffffdc(r2),r3 > 61c: 84 62 ff dc l.lwz r3,0xffffffdc(r2) > > 620: 8c 63 00 00 l.lbz r3,0x0(r3) > 624: db e2 1f db l.sb > 0xffffffdb(r2),r3 > 628: 8c 62 ff db l.lbz r3,0xffffffdb(r2) > > 62c: db e2 1f fe l.sb 0xfffffffe(r2),r3 > 630: 90 62 ff fe > l.lbs r3,0xfffffffe(r2) > 634: d7 e2 1f d4 l.sw > 0xffffffd4(r2),r3 > 638: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) > > 63c: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 > 640: 85 62 ff f8 > l.lwz r11,0xfffffff8(r2) > 644: 84 41 00 00 l.lwz r2,0x0(r1) > > 648: 44 00 48 00 l.jr r9 > 64c: 9c 21 00 30 l.addi > r1,r1,0x30 > > 00000650 <_main>: > 650: 9c 21 ff c4 > l.addi r1,r1,0xffffffc4 > 654: d4 01 10 04 l.sw 0x4(r1),r2 > > 658: 9c 41 00 3c l.addi r2,r1,0x3c > 65c: d4 01 48 00 > l.sw 0x0(r1),r9 > 660: 07 ff fe e8 l.jal 200 > <_uart_init> > 664: 15 00 00 00 l.nop 0x0 > 668: 18 60 > 00 00 l.movhi r3,0x0 > 66c: a8 63 07 44 l.ori r3,r3,0x744 > > 670: d7 e2 1f f8 l.sw 0xfffffff8(r2),r3 > 674: 84 62 ff f8 > l.lwz r3,0xfffffff8(r2) > 678: 84 63 00 00 l.lwz r3,0x0 (r3) > > 67c: d7 e2 1f f4 l.sw 0xfffffff4(r2),r3 > 680: 84 62 ff f4 > l.lwz r3,0xfffffff4(r2) > 684: d7 e2 1f fc l.sw > 0xfffffffc(r2),r3 > 688: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > > 68c: d7 e2 1f f0 l.sw 0xfffffff0(r2),r3 > 690: 84 62 ff f0 > l.lwz r3,0xfffffff0(r2) > 694: 90 63 00 00 l.lbs r3,0x0(r3) > > 698: d7 e2 1f ec l.sw 0xffffffec(r2),r3 > 69c: 84 62 ff ec > l.lwz r3,0xffffffec(r2) > 6a0: bc 03 00 00 l.sfeqi r3,0x0 > > 6a4: 10 00 00 13 l.bf 6f0 <_main+0xa0> > 6a8: 15 00 00 00 > l.nop 0x0 > 6ac: 84 62 ff fc l.lwz r3,0xfffffffc(r2) > > 6b0: d7 e2 1f e8 l.sw 0xffffffe8(r2),r3 > 6b4: 84 62 ff e8 > l.lwz r3,0xffffffe8(r2) > 6b8: 90 63 00 00 l.lbs r3,0x0(r3) > > 6bc: d7 e2 1f e4 l.sw 0xffffffe4(r2),r3 > 6c0: 84 62 ff e4 > l.lwz r3,0xffffffe4(r2) > 6c4: 07 ff ff 59 l.jal 428 > <_uart_putc> > 6c8: 15 00 00 00 l.nop 0x0 > 6cc: 84 62 > ff fc l.lwz r3,0xfffffffc(r2) > 6d0: d7 e2 1f e0 l.sw > 0xffffffe0(r2),r3 > 6d4: 84 62 ff e0 l.lwz r3,0xffffffe0(r2) > > 6d8: 9c 63 00 01 l.addi r3,r3,0x1 > 6dc: d7 e2 1f dc l.sw > 0xffffffdc(r2),r3 > 6e0: 84 62 ff dc l.lwz r3,0xffffffdc(r2) > > 6e4: d7 e2 1f fc l.sw 0xfffffffc(r2),r3 > 6e8: 03 ff ff e8 > l.j 688 <_main+0x38> > 6ec: 15 00 00 00 l.nop 0x0 > > 6f0: 07 ff ff ae l.jal 5a8 <_uart_getc> > 6f4: 15 00 00 > 00 l.nop 0x0 > 6f8: d7 e2 5f d8 l.sw 0xffffffd8(r2),r11 > > 6fc: 84 62 ff d8 l.lwz r3,0xffffffd8(r2) > 700: 9c 63 00 01 > l.addi r3,r3,0x1 > 704: d7 e2 1f d4 l.sw 0xffffffd4 (r2),r3 > > 708: 84 62 ff d4 l.lwz r3,0xffffffd4(r2) > 70c: b8 63 00 > 18 l.slli r3,r3,0x18 > 710: d7 e2 1f cc l.sw 0xffffffcc (r2),r3 > > 714: 84 62 ff cc l.lwz r3,0xffffffcc(r2) > 718: b8 63 00 > 98 l.srai r3,r3,0x18 > 71c: d7 e2 1f d0 l.sw 0xffffffd0 (r2),r3 > > 720: 84 62 ff d0 l.lwz r3,0xffffffd0(r2) > 724: 07 ff ff > 41 l.jal 428 <_uart_putc> > 728: 15 00 00 00 l.nop 0x0 > > 72c: 03 ff ff f1 l.j 6f0 <_main+0xa0> > 730: 15 00 > 00 00 l.nop 0x0 > 734: 85 21 00 00 l.lwz r9,0x0(r1) > > 738: 84 41 00 04 l.lwz r2,0x4(r1) > 73c: 44 00 48 00 l.jr r9 > > 740: 9c 21 00 3c l.addi r1,r1,0x3c > > > > ----- > Original Message ----- > From: Robert Cragie<rcc at j...> > > To: > Date: Thu Nov 22 11:30:49 CET 2007 > Subject: > [openrisc] how to run hello world in on-chip ram? > > > > Can you post the disassembly of your hello.or32 file?: > > > > > or32-uclinux-objdump -d hello.or32 > > > > > That will give a clearer picture of where everything is. > > > > > Robert > > > > Robert Cragie, Design Engineer > > > > > > > __ > > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > > > http://www.jennic.com Tel: +44 (0) 114 281 2655 > > > > _______________________________________________ > > http://www.opencores.org/mailman/listinfo/openrisc > _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
Re: how to run hello world in on-chip ram?hi, charlie yang:
now,i also do the same thing as you for "hello world" appearing on my dev_board(cycloneII),and now i deal with hardware(or1200 uart debud onchip_ram) according to hardware toturial,but some error coming!do you know how i do ? quenstions as follows: 1:according to the author ,adjust"or1200_pc.v",but there is no this file in source files~~~ 2:on_chip_ram,how do i do ? 3:when compiling,erros....i dont resolve...please help me ,,,i am real real need it ... thank you advanced!!!!! can you give me some advise?
|
| Free embeddable forum powered by Nabble | Forum Help |