EmbeddedRelated.com
Forums

Embedded software interview question collection

Started by Unknown September 12, 2006
its the arc core and it has a extension of .di which can be used in both ld 
and st (ld.di and st.di) which is what the compiler produces for volatile 
read/writes

if you turn this off then when you read a real volatile like the rs232 
registers then the cache comes into play and you dont see the change in the 
say status register.

So the only way i can see of getting this to work is by placing all 
volatiles into a seperate region and then selectivly going through my code 
and using a pragma turn on/off the compiler switch for the .di

joolz

<steve_schefter@hotmail.com> wrote in message 
news:1158177254.312298.274000@i42g2000cwa.googlegroups.com...
> Julian Gardner wrote: >> Thats one of the problems, they have no cache area, just all memory and >> the >> compiler also uses another instruction to access volatile. > > What processor is that? I've not run into ones that have special > machine instructions for volatile. Rather, the compiler mostly > avoids using registers for the memory in question, so that it > accesses the real location each time the variable is used. > >> Now when the cache is off then the two different commands work the same >> but >> with the cache on a non-volatile write goes to cache (no write through) >> but >> a volatile write bypasses the cache altogether, only when you move to a >> different cache line is it written into memory. so if you have a volatile >> variable in the middle of a block of data and you write to it then as >> soon >> as you read/write outside the cached area the variable gets its old value >> back. > > Cache is certainly an issue for the keeping things consistent, but > in my experience this is not related to "volatile". Rather, the cache > problem is avoided by explicitly turning off the cache where > necessary. For example, if I map a hardware register to a virtual > address, I tell the routine that gives me the virtual address that > caching should be turned off here. Not related to the compiler > like volatile is. > > But if there is a processor with special machine instruction to > bypass cache, well, I learn something new every day... Not > sure I'd want to take advantage of it though since it sounds > rather unportable. > > Regards, > Steve >
Tim Wescott wrote:
> Peter Dickerson wrote: > > > "Steve at fivetrees" <steve@NOSPAMTAfivetrees.com> wrote in message > > news:yeWdnRhvg58HJJrYnZ2dnUVZ8tadnZ2d@pipex.net... > > > >>"Tim Wescott" <tim@seemywebsite.com> wrote in message > >>news:bemdnaBBKJ-zA5rYnZ2dnUVZ_vKdnZ2d@web-ster.com... > >> > >>>dreamguy007@hotmail.com wrote: > >>> > >>>>Hi all, > >>>> > >>>>Lately I've been assigned to interview many candidates. Sometimes it's > >>>>hard to ask questions that actually can reveal candidate's true > >>>>potential, skills, etc. > >>>> > >>>>I'm trying to collect some good interview questions for embedded > >>>>software engineer positions > >>>>Can anyone contribute? Thanks! > >>>> > >>> > >>>We would: > >>> > >>>* Ask them to calculate the number of pixels on the screen that > >>>corresponded to some real-world distance. > >>> > >>>* Ask them to write said calculation in C (it was just one line -- at > >>>least if we were going to hire them). > >>> > >>>* Ask them to rewrite said calculation without using floating point. > >> > >>Huh? Why would calculating the number of pixels on a screen involve > > > > floating > > > >>point? > > > > > > I took it that Tim was asking about distance on-screen, which I took could > > be diagonal. In that case, assuming the screen was flat, the natural > > solution would require a square root. Performing the calculation without > > floating point would demonstrate some skills useful in low-end embedded > > systems - how to get good enough answers. Of couse it might just be a trick > > question as in max(abs(x1-x2),abs(y1-y2))... > > > > Well, that was my interpretation anyway. > > > > Peter > > > > > No square roots -- it's more like you need > > distance_on_screen = distance_out_there * scale_factor, > > and the scaling factor isn't an integer. > > Besides, you could always do integer square roots.
Some many years ago [about 15, as I recall] I had to deal with with 'rate centres' (as they are known to BellCore) and wrote a program to plot the picture on the screen of a VGA screen, using appropriate scaling, of all known rate centres. It was a nice map of the USA showing the major Interstates in lower density regions. Interesting to do, certainly, and I had to do it in integer mathematics as I had to provide pixel addresses :) Cheers PeteS
> > -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com > > Posting from Google? See http://cfaj.freeshell.org/google/ > > "Applied Control Theory for Embedded Systems" came out in April. > See details at http://www.wescottdesign.com/actfes/actfes.html
I once completely stumped a candidate with the simple question [1]:

'What is an embedded system?'

The poor guy floundered, which told me he had problems dealing with
'new' (perhaps unknown) territory, so he was ultimately rejected.

I am always interested in just what the candidate thinks what an
embedded system *is*; then we can move on to what *my* embedded systems
are :)

I also want to know how a person will react when confronted with
completely new things, which is common in embedded systems (those who
have been in it more than 20 years will understand this ;)


[1] There is enough debate about this amongst those of us who have been
doing it for decades. I can't expect someone new to *know* what it is
as we can't agree on what it is.
Indeed, if someone claimed to *know* what it is, as a definable object,
I would be very sceptical indeed; there's a difference between
confidence and arrogance (although it's not arrogance if you're right
;)

Cheers

PeteS

Kelly Hall wrote:

> dreamguy007@hotmail.com wrote: >> I'm trying to collect some good interview questions for embedded >> software engineer positions >> Can anyone contribute? Thanks! > > Ask them about their favorite programming language, CPU, or EDA > software, bench scope, etc. Ask them what features in it they hate the > most. > > A person who can't list the faults or shortcomings in their tools > haven't used them enough. > > Kelly
Having used quite a variety of different tools (of all sorts) I never found that the shortcomings of any of them were more than a mere minor niggle. I would expect any embedded engineer to be able to work around a few minor shortcomings in the equipment and tools he is using and still turn out a dependable system. Then, I never went in for needing extremely complex equipment or tools in the first place. I would be impressed if, given a non-working logic board, the candidate could diagnose the probable fault with the simplest available tools. -- ******************************************************************** Paul E. Bennett ....................<email://peb@amleth.demon.co.uk> Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/> Mob: +44 (0)7811-639972 Tel: +44 (0)1235-811095 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************
PeteS wrote:
> I once completely stumped a candidate with the simple question [1]: > > 'What is an embedded system?' > > The poor guy floundered, which told me he had problems dealing with > 'new' (perhaps unknown) territory, so he was ultimately rejected. > > I am always interested in just what the candidate thinks what an > embedded system *is*; then we can move on to what *my* embedded systems > are :) > > I also want to know how a person will react when confronted with > completely new things, which is common in embedded systems (those who > have been in it more than 20 years will understand this ;) > > > [1] There is enough debate about this amongst those of us who have been > doing it for decades. I can't expect someone new to *know* what it is > as we can't agree on what it is. > Indeed, if someone claimed to *know* what it is, as a definable object, > I would be very sceptical indeed; there's a difference between > confidence and arrogance (although it's not arrogance if you're right
Are you old enough to remember the time before the term was used. In the 70's and early 80's it was "dedicated computer system" or possibly "OEM computer". I saw lots of PDP8's embedded in the bellies of instruments, typesetters and cnc machines and none of them were referred to as "embedded" I think EDN or Electronic Design coined the term "embedded system"
On 13 Sep 2006 14:51:52 -0700, PeteS wrote:
> I once completely stumped a candidate with the simple question [1]: > > 'What is an embedded system?' > > The poor guy floundered, which told me he had problems dealing with > 'new' (perhaps unknown) territory, so he was ultimately rejected. > > I am always interested in just what the candidate thinks what an > embedded system *is*; then we can move on to what *my* embedded systems > are :)
I wouldn't mind if someone would describe what an embedded system is. I tried to describe an ARM board with dynamic RAM and Linux as the OS as embedded and caught a bit of trouble for it. And before anyone gets too into it. I'm not a programmer (I know a little software) and not a hardware engineer (EET by schooling). My last 16 years have been in networking. -- Linux Home Automation Neil Cherry ncherry@linuxha.com http://www.linuxha.com/ Main site http://linuxha.blogspot.com/ My HA Blog http://home.comcast.net/~ncherry/ Backup site
Clifford Heath wrote:

>> I'm trying to collect some good interview questions for embedded >> software engineer positions > > Describe a situation where you had to diagnose a bug caused by priority > inversion.
And do not hire a good person who just have not worked with such problems. Unless you are looking for very specific RTOS experience. -- WBR, Yuriy. "Resistance is futile"
Tom Lucas wrote:

>> I'm trying to collect some good interview questions for embedded >> software engineer positions > > I would ask what they have done outside of work that is relevent. If > someone is passionate about something then they will do it for fun as > well as when they have to.
As long as they are young. Then come wife, kids, house (not necessary in this particular sequence :)). -- WBR, Yuriy. "Resistance is futile"
CBFalconer wrote:
> "Michael N. Moran" wrote: > >>Julian Gardner wrote: >> >>>Well ive been arguing with a company because they cant get to >>>grips what volatile really does and because of this the new piece >>>of hardware they have released witb an embedded processor does >>>not work if the cache is switched on!!!! >>> >>>I have tried for 2 years to get them to understand but they still >>>screw the design up. >>> >>>I now need to got through all my code and try to move every >>>variable into a seperate block of memory so there will be no >>>memory corruption. >> >>Off topic, but ... maybe it's because my brain hasn't clicked on >>yet, but what has the use of volatile got to do with cache? > > > Say the variable is really a hardware status bit, memory mapped. > If declared volatile in the code there will be a memory access for > each read. If the hardware diverts that read to the cached value, > it will no longer reflect reality. So the system needs some means > of automatically invalidating the cache. To me, this is a primary > objection to using memory mapped i/o ports, which can easily be > avoided with a separate i/o space.
In cached systems, the MMU (or similar) is configured to prevent caching to memory mapped I/O regions. Even if you have memory mapped I/O registers (incorrectly) configured as cached, using volatile will not help you. Volatile only prevents the compiler from eliminating (optimizing away) what it views as redundant loads or stores. Compilers don't even know if the generated code is operating in/on cached or uncached regions of memory. Even more interesting is that volatile by itself doesn't even ensure that loads and stores are performed in program specified order if the processor employs out-of-order execution. In this case, the programmer must insert memory barrier instructions such as the PPC eieio instruction between the appropriate loads and stores (to volatile locations). -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." The Eagles, "Already Gone" The Beatles were wrong: 1 & 1 & 1 is 1
Julian Gardner wrote:
> Thats one of the problems, they have no cache area, just all memory and the > compiler also uses another instruction to access volatile. > > Now when the cache is off then the two different commands work the same but > with the cache on a non-volatile write goes to cache (no write through) but > a volatile write bypasses the cache altogether, only when you move to a > different cache line is it written into memory. so if you have a volatile > variable in the middle of a block of data and you write to it then as soon > as you read/write outside the cached area the variable gets its old value > back. >
Please don't top-post. It sounds like you have an I/O region with caching enabled. Don't do that, it hurts ;-) You need to set up your MMU /page tables correctly to avoid this. -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." The Eagles, "Already Gone" The Beatles were wrong: 1 & 1 & 1 is 1