Reply
Posts: 267
Registered: ‎03-14-2014

Grown Up Discussion on Compiler's

Slightly flammable title sorry, I have tried to have this discussion on other forums lately and its descended into flame wars each time! I DONT WANT any flaming, I am after opinion.

So to explain, I have used Keil (limited code size) and GCC (free), but I know there are many other's. I could download them all and try them myself, but 1 that would take ages and the little disk space I have left.

2. A lot on here have huge experience of many compilers, and I am after opinion as well as fact.

 

I am trying to invent something for my dads company, I had an idea after trying out the sensor expander board, I tried a couple of simple test's and got some results that make me think my idea might work. I told my dad and his boss about it, they really like the idea, so the deal is they will pay 3/4 of the price of a full compiler for me, this is so I can develop my idea, if I get to the end and can prove if it will/will not work, then they will pay for the other 1/4 Robot Very Happy.

At the moment the idea dosnt matter, I will be posting for help on that soon anyway. So I have a chance to get a full compiler and I want to get a good one, so what are the pro's and con's of each?

The kind of information I am interested in discussing includes.

Optimization, how good is it compared to x or Y compiler.

Ease of use, plus ease of integrating with sim studio.

I forgot to add it's actually two I am after, 32 bit and 8051.

How compliant with ANSI C

What do you like/dislike about it?

Etc etc etc

I have downloaded IAR today, so far I am not impressed, mostly because of the hassle I had to install etc, but also I dont like the feel of the IDE, it feels old and tired and a little clunky.

I normally use GCC, simply because it's free, I dont have much to compare it against, so far it seem's to do it's job, but hw does the optimization stack up against the others? What are the downsides to it?

Anyway you know the kind of information I am after, so thought's and opinion's please, then I can make a short list of ones I want to try, and ultimately choose one to get.

Price dosnt matter (YAY), the 1/4 I have to stump up first, will be lent to me, as long as I take the project through to a conclusion, I get the money back anyway.

PLEASE can we keep it nice, I dont mind XorY is C@@p, as long as you explain why you think so.

 

Kind regards

LG

 

P.S the project will be an invention, it's a imaging system for eggs, nothing like it exists solely for eggs, there are other techniques that could be used, but they cost too much to be practical, plus this is (IMHO) a elegant solution.

Posts: 7,951
Registered: ‎08-13-2003

Re: Grown Up Discussion on Compiler's

parsing your tome and insering a few comments

 

 

Optimization, how good is it compared to x or Y compiler.

you do not want optimization, it screws up your debugging

 

Ease of use, plus ease of integrating with sim studio.

totally subjective, difficult

 

I forgot to add it's actually two I am after, 32 bit and 8051.

for the '51 you will not get anything noteably better than the free SILabs Keil

 

How compliant with ANSI C

supposedly all are (for the 'embedded subset')

 

 hw does the optimization stack up against the others?

worry about code efficiency, not optimization

 

What are the downsides to it?

whatever you choose, you are basically stuck with it

 

I travel around (typically work in 3 or more places per year) and work with whatever is the standard for the place I work and my opinion is that it is all "useable crap".  One note: it is virtually impossible to get chip supplier support if you are not using their "recommended compiler"

erik
Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

Well Keil is free for 8051 so that isnt a problem, I like the Keil IDE for EMF, so maybe get the full compiler. Sil Lbas supplies free 051 compiler from Keil, but I get the feeling they push IAR??? Every box I have seen from them has the IAR CD in, when the University kit arrived for dad, all the box's only had IAR disk in.

So on the one hand it looks like they push Keil, but on the other it looks like IAR, I have been using IAR today (first time), I dont like the feel of the IDE. It might be good, I wouldnt know yet, but it dosnt feel as good as uvision5, or even sil labs own one.

I am used to C18 and C30, I did use XC8 for a short time with mplabX, XC8 and labX are total rubbish, 2 1/2 years from release and still not even beta quality its that buggy. C18 was ok but mplab8, felt tired and didnt have many features, I dont want bells and whistle that do nothing, but it lacked even decent watch window.

I might have to try a few more, at least unlike pics you dont get things like MIKROC, I tried that but it was a real pain, and I didnt like the closed files and Libs. I will keep optimization in mind when debugging.

Talking of which back to the datasheet!

 

 

Posts: 122
Registered: ‎10-25-2012

Re: Grown Up Discussion on Compiler's

Don't give up on IAR too quickly. I use both IAR and Keil (although uvision3) and I prefer IAR. I just find setting up the Keil compiler more difficult.

 

On a separate note, there is nothing to stop you having two targets; one unoptimised for debugging and a fully optimised one for release code.

 

Posts: 7,951
Registered: ‎08-13-2003

Re: Grown Up Discussion on Compiler's

[ Edited ]

On a separate note, there is nothing to stop you having two targets; one unoptimised for debugging and a fully optimised one for release code.

 

nothing stopping - yes, recommended NO! go by NASA "we fly what we test".

 

re IAR and Keil, in my opinion one is a six, the other is half a dozen. 

 

I can, however, not recommend Raisonance

erik
Posts: 7,951
Registered: ‎08-13-2003

Re: Grown Up Discussion on Compiler's

I just find setting up the Keil compiler more difficult.

 

i find that the wrong approach to selection.  If a compiler is more difficult to set up, but generates better code, that one should still be the choice.

erik
Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

For me the IDE is also important, I need to feel comfortable with it, I dont like too many option's and window's, but I also dont like very basic. I seem to be using GCC most at the moment, mainly because no code size limit's and it's free. I like uV5, and the old studio (sim parts), The sil labs one in sim studio is also ok. IAR IDE, I dont like, I dont like there attitude to customer's. My dad spoke with them about trialing it, when it all went boobs up, they were not much help, so he cancelled a work order for 24 Licenses.

 

I dont hear much on Atolic?

 

I like the old 32bit studio, but I dont like the code red compiler, it give's me loads of errors using the Badger board.

LG

Posts: 428
Registered: ‎01-18-2004

Re: Grown Up Discussion on Compiler's


LG11 wrote:

For me the IDE is also important, I need to feel comfortable with it, I dont like too many option's and window's, but I also dont like very basic. I seem to be using GCC most at the moment, mainly because no code size limit's and it's free. I like uV5, and the old studio (sim parts), The sil labs one in sim studio is also ok. IAR IDE, I dont like, I dont like there attitude to customer's. My dad spoke with them about trialing it, when it all went boobs up, they were not much help, so he cancelled a work order for 24 Licenses.

 

I dont hear much on Atolic?

 

I like the old 32bit studio, but I dont like the code red compiler, it give's me loads of errors using the Badger board.


Totally off topic, and I know that you're a kid and your other details, but PLEASE -- the apostrophe is not used to indicate a plural! 

 

Thank you. Carry on.

Posts: 428
Registered: ‎01-18-2004

Re: Grown Up Discussion on Compiler's

For the 8-bit stuff, the Keil tools provided by Silicon Labs are excellent and fine for production use. Unless you are compelled to support other vendors' 8051 variants, you really don't need to look any further. It supports the SiLabs USB programming dongle.

 

For the 32-bit stuff, since I've only used the Si3M devices and not the Energy Micro parts, I've been using the Precision32 IDE and it has been fine. It's the learning curve for Eclipse that can be steep.

 

I've installed the Simplicity Studio (also Eclipse-based) and have only looked it as an overview. Once SiLabs merges the support for the SiM3 parts into it (and adds support for OS X!) I will look at it in more detail.

 

-a

Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

No idea if it was me or the spell checker. But yes I struggle with grammar and such, partly because I am dyslexic, but mostly because with my syndrome you tend to be what I am told are called logical thinkers, Language is rarely logical, so we struggle. I get extra lessons at school but to be honest your stuck with some of my quirks Robot Very Happy.

Just be thankful I am probably the only under 20 you will ever meet who does not use TXT speak.

Posts: 122
Registered: ‎10-25-2012

Re: Grown Up Discussion on Compiler's

I did not say not to test the release version. Of course you must test it, thoroughly. The purpose of the debug version is to have a means of detecting logical errors in your code to enable you to get to a release version faster, which you then test.

 

"For me the IDE is also important, I need to feel comfortable with it,..."

 

I agree with the LG11 that ease of use is important.

Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

Speaking of eclipse, I downloaded DS-5. I am going to give it a try, I dont normally swap about like this, but I want to get a feel for what's out there before I settle on one.

It seems like most of the others, but somehow feels different. I will report back later Robot Very Happy. At least there is a better choice compared with pics, I hated the new XC8. A few months ago microchip got rid of C18, you couldnt get the student version and all links were removed to the latest one, so many people complained that within a week it was back. They are trying really hard to force people into XC8 and MPLABX, in many peoples view its barely past Alpha let alone release candidate.

They took over Hi Tech (great compiler and IDE), then mashed it into MplabX, the IDE when it works is not bad (when it works), the compiler is awful! really bad.

It was another reason my dads company started looking around at different chips, they had been using Freescale ARM stuff before, but kept getting bad batches of chips, so ended up here Robot Very Happy, the main reason I think was the support side was good and the chips seem to cover all there bases.

 

Posts: 7,951
Registered: ‎08-13-2003

Re: Grown Up Discussion on Compiler's

 I just find setting up the Keil compiler more difficult.

what does that have to do with

I agree with the LG11 that ease of use is important.

 

I did not say not to test the release version.

of course, you did not, but what are you going to do id the 'debug version' works and the 'release version' does not (not an uncommon problem)

erik
Posts: 122
Registered: ‎10-25-2012

Re: Grown Up Discussion on Compiler's

"what are you going to do id the 'debug version' works and the 'release version' does not"

I would look for the differences introduced in the release version (e.g. optimisation or timing differences) safe in the knowledge that I have proven the logic of the code.

What would you do when your release version does not work and you don't have a working debug version to compare it to?

Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

This has slightly confused me, keep in mind I am used to 'other' tool's, there seems to be a difference here with what I used to have. With C18 I would set up the limited options for optimization, then you just pick if your debugging or if its release.

Am I correct in thinking that what your saying here is, with ARM tools you use a different setting for optimization depending on if your debugging or its a release version?

That dosnt make much sense to me?? Surely you are better to use the same settings throughout? It dosnt makes sense to get something working in debug, only to have to start messing with the code again because the release version dosnt work.

I have always set things up depending on need, so say I am tight on space for code, I would choose a higher level of optimization from the start,then once working in debug I build a release version using exactly the same settings.

Why is this the wrong way to do it?

Doing it this way means if my code dosnt work in debug then there is little chance it will work in release, so to me anyway its more sensible to get it working with what your going to use.

Although the major difference is I have no constraints on what I do, all my stuff is for me. So I admit I dont have to follow a plan of any description, nor do I have to conform to a company 'way' of doing things. But I had assumed everyone set optimization and such like first, then built there code up??

Of course everybody has there own method of working, the same as when it comes to writing code most people have there own 'style' and preferences, for example I am not a big fan at the moment of using all the C short cuts, I find it difficult at times to read it back and have it make sense. I prefer to write some things the long way.

Maybe that will change once I am better at coding, but at the moment I look at some C code and find it too cryptic to follow. It is interesting to hear how others work though, I also like looking at how others lay out code, I tend to be a bit messy at the moment and my indenting isnt great, because I am self taught I have also mixed up conventions when it comes to naming variable and macro's. I often get moaned at for having variable in capital letters, but when I first started I didnt know any better and just did what I found easier to understand, now its kind of stuck.

I have been trying to get the Ethernet code working with IAR, I had it down to just 2 errors, but no matter how I try and add the file paths it still tells me it cant find the files GRRRRrr. I really am going off IAR, so far I have found little I like abut it.

Posts: 122
Registered: ‎10-25-2012

Re: Grown Up Discussion on Compiler's

[ Edited ]

If you run an optimised version in a debugger, you may not be able to set a breakpoint where you want it in the source code. Because of the optimisation, the path followed by the release version may not match exactly with the source code. This makes debugging a pain. If you debug with an unoptimised debug version, then this problem should not occur.

The unoptimised (debug) version will take more memory than an optimised version, but you may also have more memory available on the debugger than you have on the target device. In this case you can make use of that fact when developing code and not keep running out of memory. You only need the final version to fit in the available memory, so give yourself some elbow room.

 

The reason you can have different targets (debug and release) is so you can apply different settings for the different requirements. If you use the same settings for both then you only need the one target.

 

In summary, the debug target is easier to use in a debugger. Easier to use means you find and fix the problems faster. You can then proceed to a release target with the required optimisations. You then need to test that, starting with a debugger and then as the stand-alone final product. If you have done any woodwork you would know that when sanding you start with a coarse sandpaper and finish off with the fine sandpaper. The debug target is the coarse sandpaper and the release target the fine. Doing it all with fine sandpaper is doing it the hard way.

 

By the way, you can often (usually?) apply optimisations on a file by file basis. This can be useful where you want to keep the code size down but have some code you want to run as fast as possible. Just apply different optimisations to the appropriate files. Also, if you want to minimise power consumption, then optimising for fastest speed will reduce the number of cycles required for your code. So, as long as you are using the low power modes the micro will be awake for fewer cycles thus saving power.

 

EDIT. I wanted to say that you will never get agreement on formatting and style. Everyone thinks everyone else is wrong.

Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

There seems to be some conventions with code that are fairly universal, I didnt know anything about them until I started posting question's on MChip forum, I got so fed up being told that variables should be this case or that case and dont name macros like do it like this, I gave up posting code there in the end.

I agree with indenting though, I hate trying to read code all in one long block, but again I am still learning so my indenting isnt the greatest, being dyslexic etc I write and layout code in a way I find easy to read back, so it dosnt always make it easy for others. My other sin is often over commenting code, although I am starting to get better with that.

Its fascinating to read how others debug and the reasons behind it, alot of it makes sense.

Posts: 7,951
Registered: ‎08-13-2003

Re: Grown Up Discussion on Compiler's

My other sin is often over commenting code

 

may be unnecessary, but definitely not a sin.  Commenting in lieu of variable names that make sense, however is a sin

erik
Posts: 267
Registered: ‎03-14-2014

Re: Grown Up Discussion on Compiler's

I am pretty good naming variables, I try and be as descriptive as I can, I absolutely HATE code with one or two letter variables for everything. Drives me mad, it dosnt take any longer to type tacho_count, than it does to type tc.

 

Highlighted
Posts: 203
Registered: ‎02-04-2013

Re: Grown Up Discussion on Compiler's

  I know I'm late to the party. But I'll throw in my thoughts anyway. 

 

  On the 8-bit side I'd definitely go with Keil. It rarely does stupid things (which for 8051 compilers is important). That's also the compiler that we (Silabs) do 99% of our work and testing with.

 

  On the arm side both IAR and Keil are basically equivalent in my opinion. GCC is ok. It used to have a pretty bad standard library but the new version targeted at embedded applications is pretty good [code space efficient] (though still not as good a the IAR or Keil versions). 

  If it were me I'd choose Keil over IAR simply because you can't go wrong using the compiler built by the same people that made the core. (Keil is owned by ARM). 

  Note that in terms of Simplicity Studio integration GCC is the clear winner, and again we we use to develop 99% of our content. Currently hooking another compiler into Studio is a bit of a chore. I expect that Keil and IAR integration into Studio will happen but I can't say when.

 

  As for an IDE that's a personal preference Robot Happy. I really like the Simplicity IDE and work almost exclusively in that (I even use it to do non-mcu related things like working with python, or xml).  But, I'm a pretty big fan of eclipse in general so that colors my opinion quite a bit.

 

 

 

 

 

----------------------------
Josh Norem
Senior Applications Engineer
Silicon Labs