From jim at fiocca.net Tue Nov 13 18:38:13 2007 From: jim at fiocca.net (Jim Fiocca) Date: Tue Nov 13 18:51:24 2007 Subject: [Icc-mot] BSS in reverse order? In-Reply-To: <200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com> <4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com> <200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> Message-ID: <473A5F95.9030908@fiocca.net> ICC12-V7 questions: 1) In the generated map file (.mp), why are the memory addresses in the BSS section (area) in the reverse order that they were allocated in the program? 2) Is there some sort of data alignment pragma? Or other mechanism to align data on a specific boundary? Thanks, Jim From ekarpicz at freemail.lt Tue Nov 13 23:03:58 2007 From: ekarpicz at freemail.lt (Edward Karpicz) Date: Tue Nov 13 23:17:10 2007 Subject: [Icc-mot] BSS in reverse order? References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com><4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com><200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net> Message-ID: <000601c8268c$8748c7f0$0400a8c0@edvardo> Jim Fiocca wrote: > ICC12-V7 questions: > > 1) In the generated map file (.mp), why are the memory addresses in the > BSS section (area) in the reverse order that they were allocated in the > program? Does ANSI C specify the order static vars are allocated? I don't think so. For portability and compatibility with future ICC versions, I think you shouldn't assume any order of allocation. Maybe tell us what are you trying to do? Even structs get not portable as soon as someone starts assuming that char is 8 bits or assuming any struct packing etc struct { char a; short b; } ... ^^ there can be a unused memory space between a and b fields, just enable word alignment and see. The same way there can be a unused space between statically allocated vars... So are you sure you need specific order of allocation? > > 2) Is there some sort of data alignment pragma? Or other mechanism to > align data on a specific boundary? > There's a word alignment option. If you need specific address then you should use abs_address pragma or your custom memory area with specific start and end addresses. To get some every >2bytes alignment, I would use structs and unions of specific size and custom area to allocate only such structs. I think you should tell us more about what you are trying to achive. Edward > Thanks, > Jim > > > > _______________________________________________ > Icc-mot mailing list > Icc-mot@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-mot > From peter at sensair.com Thu Nov 15 04:22:08 2007 From: peter at sensair.com (Peter Lissenburg) Date: Thu Nov 15 04:36:21 2007 Subject: [Icc-mot] Opentcp and ICC12 In-Reply-To: <000601c8268c$8748c7f0$0400a8c0@edvardo> References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com><4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com><200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net> <000601c8268c$8748c7f0$0400a8c0@edvardo> Message-ID: <473C39F0.3060101@sensair.com> Hi all, working on getting opentcp working with ICC12 and NE64. I am looking closely at http://www.celestialaudio.com/MC9S12NE64/ but I know too little about codewarrior projects to figure out how to rearrange the project structure into something reasonable, that I may use the info from Jesse. I see a (non) link at http://www.imagecraft.com/pub/code_samples/CPU12/NO_FILE on the ICC12 demo download page, has anyone got some sort of "blank project" for this? Or a pointer to how I should proceed? As hardware, I have the NE64 demo board, and my own prototype. I would be happy to "publish" a ICC12 project for the demo board once I have got that far. Any thoughts most welcome. Thanks. Peter L. From jim at fiocca.net Thu Nov 15 05:41:31 2007 From: jim at fiocca.net (Jim Fiocca) Date: Thu Nov 15 05:54:49 2007 Subject: [Icc-mot] BSS in reverse order? In-Reply-To: <000601c8268c$8748c7f0$0400a8c0@edvardo> References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com><4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com><200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net> <000601c8268c$8748c7f0$0400a8c0@edvardo> Message-ID: <473C4C8B.4050401@fiocca.net> The reverse order of the BSS just makes debugging a little awkward. When I look at a variable or array in memory, I'm used to seeing the next variable I declared in the file as the next variable in memory. This just caught me a little off guard and makes debugging a little more cumbersome. Especially if you want to add a dummy padding array to force alignment, you have to add it after the object you want to align. So I was just wondering, from a compiler writer's point of view, why this was done; because I've never seen it done before. Thanks, Jim Edward Karpicz wrote: > Jim Fiocca wrote: > >> ICC12-V7 questions: >> >> 1) In the generated map file (.mp), why are the memory addresses in >> the BSS section (area) in the reverse order that they were allocated >> in the program? > > Does ANSI C specify the order static vars are allocated? I don't think > so. For portability and compatibility with future ICC versions, I > think you shouldn't assume any order of allocation. > Maybe tell us what are you trying to do? Even structs get not portable > as soon as someone starts assuming that char is 8 bits or assuming any > struct packing etc > > struct { > char a; > short b; > } ... > > ^^ there can be a unused memory space between a and b fields, just > enable word alignment and see. The same way there can be a unused > space between statically allocated vars... So are you sure you need > specific order of allocation? > > >> >> 2) Is there some sort of data alignment pragma? Or other mechanism >> to align data on a specific boundary? >> > > There's a word alignment option. If you need specific address then you > should use abs_address pragma or your custom memory area with specific > start and end addresses. To get some every >2bytes alignment, I would > use structs and unions of specific size and custom area to allocate > only such structs. > I think you should tell us more about what you are trying to achive. > > > Edward > >> Thanks, >> Jim >> >> >> >> _______________________________________________ >> Icc-mot mailing list >> Icc-mot@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-mot >> > > _______________________________________________ > Icc-mot mailing list > Icc-mot@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-mot From ekarpicz at freemail.lt Thu Nov 15 06:15:55 2007 From: ekarpicz at freemail.lt (Edward Karpicz) Date: Thu Nov 15 06:58:15 2007 Subject: [Icc-mot] BSS in reverse order? References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com><4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com><200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net><000601c8268c$8748c7f0$0400a8c0@edvardo> <473C4C8B.4050401@fiocca.net> Message-ID: <006c01c82792$09975400$0400a8c0@edvardo> Thanks for explanation. I never thought to align variables to ease debugging. It makes sense. Edward Jim Fiocca wrote: > The reverse order of the BSS just makes debugging a little awkward. When > I look at a variable or array in memory, I'm used to seeing the next > variable I declared in the file as the next variable in memory. This just > caught me a little off guard and makes debugging a little more cumbersome. > Especially if you want to add a dummy padding array to force alignment, > you have to add it after the object you want to align. > > So I was just wondering, from a compiler writer's point of view, why this > was done; because I've never seen it done before. > > Thanks, > Jim > > > Edward Karpicz wrote: >> Jim Fiocca wrote: >> >>> ICC12-V7 questions: >>> >>> 1) In the generated map file (.mp), why are the memory addresses in the >>> BSS section (area) in the reverse order that they were allocated in the >>> program? >> >> Does ANSI C specify the order static vars are allocated? I don't think >> so. For portability and compatibility with future ICC versions, I think >> you shouldn't assume any order of allocation. >> Maybe tell us what are you trying to do? Even structs get not portable as >> soon as someone starts assuming that char is 8 bits or assuming any >> struct packing etc >> >> struct { >> char a; >> short b; >> } ... >> >> ^^ there can be a unused memory space between a and b fields, just enable >> word alignment and see. The same way there can be a unused space between >> statically allocated vars... So are you sure you need specific order of >> allocation? >> >> >>> >>> 2) Is there some sort of data alignment pragma? Or other mechanism to >>> align data on a specific boundary? >>> >> >> There's a word alignment option. If you need specific address then you >> should use abs_address pragma or your custom memory area with specific >> start and end addresses. To get some every >2bytes alignment, I would use >> structs and unions of specific size and custom area to allocate only such >> structs. >> I think you should tell us more about what you are trying to achive. >> >> >> Edward >> >>> Thanks, >>> Jim >>> >>> >>> >>> _______________________________________________ >>> Icc-mot mailing list >>> Icc-mot@imagecraft.com >>> http://dragonsgate.net/mailman/listinfo/icc-mot >>> >> >> _______________________________________________ >> Icc-mot mailing list >> Icc-mot@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-mot > > _______________________________________________ > Icc-mot mailing list > Icc-mot@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-mot > From richard-lists at imagecraft.com Thu Nov 15 14:46:59 2007 From: richard-lists at imagecraft.com (Richard) Date: Thu Nov 15 15:00:44 2007 Subject: [Icc-mot] BSS in reverse order? In-Reply-To: <473C4C8B.4050401@fiocca.net> References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com> <4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com> <200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net> <000601c8268c$8748c7f0$0400a8c0@edvardo> <473C4C8B.4050401@fiocca.net> Message-ID: <200711152300.lAFN0hlc038547@dragonsgate2.imagecraft.com> It's just an artifact of the internal compiler architecture. That's no particular reason for it per se. Just how things fall out due to the algorithm and data structures we use. As Edward say, you should not depend on the order. In fact, the compiler is allowed to "randomize" the order if it provides better code. For example, on the HCS12, we may collect all byte size variables together so there would be no padding needed for word aligned fetches for the word sized items. At 05:41 AM 11/15/2007, Jim Fiocca wrote: >The reverse order of the BSS just makes debugging a little awkward. >When I look at a variable or array in memory, I'm used to seeing the >next variable I declared in the file as the next variable in memory. >This just caught me a little off guard and makes debugging a little >more cumbersome. Especially if you want to add a dummy padding >array to force alignment, you have to add it after the object you >want to align. > >So I was just wondering, from a compiler writer's point of view, why >this was done; because I've never seen it done before. > // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From jim at fiocca.net Thu Nov 22 07:59:33 2007 From: jim at fiocca.net (Jim Fiocca) Date: Thu Nov 22 08:13:11 2007 Subject: [Icc-mot] no 45-day demo from command line In-Reply-To: <200711152300.lAFN0hlc038547@dragonsgate2.imagecraft.com> References: <00cd01c7b9ab$02b5e610$6401a8c0@ddt2> <200706282040.l5SKe4xd099242@dragonsgate2.imagecraft.com> <06aa01c8020e$66846710$6901a8c0@ddt2> <200709282124.l8SLO7sp083844@dragonsgate2.imagecraft.com> <4706EF23.5040600@sensair.com> <001001c8084b$039f4c80$a300a8c0@REKS> <47085444.9030404@sensair.com> <4709CA25.3020101@sensair.com> <003401c80999$38559c00$0400a8c0@edvardo> <000601c8099d$fa5159d0$0400a8c0@edvardo> <47196356.7060405@sensair.com> <200710200520.l9K5KDAf071472@dragonsgate2.imagecraft.com> <473A5F95.9030908@fiocca.net> <000601c8268c$8748c7f0$0400a8c0@edvardo> <473C4C8B.4050401@fiocca.net> <200711152300.lAFN0hlc038547@dragonsgate2.imagecraft.com> Message-ID: <4745A765.7050007@fiocca.net> There really is no 45-day demo with ICC12 V7 if you build from a command line with a Makefile. I got this message right after installing the compiler: !E (0): Unlicensed compiler cannot be run in command line mode Regards, Jim From jeff at atsi-tester.com Thu Nov 29 13:41:33 2007 From: jeff at atsi-tester.com (Jeff McKnight) Date: Thu Nov 29 13:54:53 2007 Subject: [Icc-mot] test Message-ID: <474F320D.9070105@atsi-tester.com> From jeff at atsi-tester.com Thu Nov 29 14:01:10 2007 From: jeff at atsi-tester.com (Jeff McKnight) Date: Thu Nov 29 14:14:20 2007 Subject: [Icc-mot] test Message-ID: <474F36A6.8040900@atsi-tester.com>