« Return to Thread: how to run hello world in on-chip ram?

Re: how to run hello world in on-chip ram?

by charlie yang :: Rate this Message:

Reply to Author | View in Thread

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

 « Return to Thread: how to run hello world in on-chip ram?