Is the Multiply-Accumulate (MAC) Unit supported by the C51 compiler for the cygnal c8051f12x devices? How to use it?
The whole point of all the 8051 derivatives is that they all have the same instruction set - the only differences are in the SFRs. Unless Cygnal has broken this, there will be no specific compiler suppport - it's just down to you to read the data sheet and find out what SFRs are involved, and what you need to do with them...
It's Section 13 in the data sheet
thank you for your reply. it's troublesome to write a lot of codes to realize a multiply operations with the MAC,will the future C51 compiler be support the MAC in the C8051F12x.
"it's troublesome to write a lot of codes to realize a multiply operations with the MAC" Some people are never satisfied! Try doing it without a MAC! "will the future C51 compiler be support the MAC in the C8051F12x." See my original asnwer - this is not a compiler issue! Perhaps you should talk to Cygnal (SiLabs) about providing a support library - eg, like the Triscend SDK http://www.triscend.com/developmenttools/sdk.htm
thank you.As we know,A MAC Unit is available in the ST10F2xx, ST10R2xx, and Infineon XC16x devices. It was first supported by intrinsic function in C166 Version 4.02,why the MAC isn't supported by the C51?
From a quick look at the C166 Instruction Set, it looks like the Multiply instruction uses the hardware multiplier implicitly. The compiler is concerned with generating instructions, so it has to support it! This is completely different from the Cygnal, where no specific instructions are involved - the MAC is just another peripheral, like the Timers, ADC, etc.
You're pretty arrogant, Andy. You can claim what you want but the MAC definately SHOULD be supported. The instruction set has nothing to do with it. You don't have native floating point support in any 8051 or in the C166/167/ST10 family, but you have a floating point library that provides the support. If you have an ST10 the floating point library is different and supports the MAC. The only excuse for not supporting the MAC on the F120 is that Keil doesn't want to put the effort into it, which doesn't say much for Keil. Considering what I paid for this development platform AND the claim that the F120 was supported, I expected the MAC to be used in floating point. Pretty pitiful if you ask me, as were your rather rude posts concerning this matter.
You can claim what you want but the MAC definately SHOULD be supported If Keil were to support derivative specific operations, then where is the limit. The MAC IS supported, Keil let you write to any specified SFR. If you have a problem, why not write your own library routines. Erik
First, I've been down that road before. I wrote a significantly faster floating point library for the C167 because I was doing a fair amount of signal processing (real time motion control application) and I can tell you it was a LOT of work. In this (8051) instance I spent the extra money to get floating point support so I wouldn't have to go through that again. Anyone who wants to use fixed point math in things like DSP functions can raise their hand now. I know I don't want to (it's too easy to make mistakes and painful to maintain / modify). Using the MAC for floating point is not the same as supporting every peripheral on every vendors chip. It's something that should be there, and floating point IS a compiler related issue. If you can produce a floating point library then you should be able to produce a version that uses MAC (and Keil does this for the C166/ST10 products). The modifying their existing library to take advantage of MAC is not such a big thing to do - IF you have the source code. Once it's done and released it wouldn't be hard for a user to tailor it to a different chip, and you can bet other vendors will include MAC capabilities in their hardware (there may already be some - haven't checked).
While I'm still on this subject, you might note that according to the Keil documentation the compiler DOES support math operations (using special hardware) on some of the other chips (Infineon 517, Dallas...) and those chips work similarly to the F120 - they mapped the functionality in via SFRs, not as native instructions. I guess now you'll have another excuse...
the compiler DOES support math operations (using special hardware) on some of the other chips .... I guess now you'll have another excuse nope, If they support special hardware on some chips (which I did not know, not using much math - it is, even with MACs etc. too slow for my purposes) they should (at least eventually) support it across the board. Erik
Actually, in the C51 v7.20 release notes, we find: "Added support for the Silicon Labs C8051F12x multiply and accumulate unit (MAC0). The MDU_F120 directive enables use of MAC0 for int and long multiplication and long shift operations." http://www.keil.com/update/relnotes/c51v750.htm So there you have it - objection withdrawn, m'lud.
THANK YOU! THANK YOU! THANK YOU! This looks like what I really want! Now, I get to show my ignorance. I'm not as familiar with the Keil tools as I'd like to be (sorry but until this 8051 based project I've been using Tasking tools - I prefer a C++ compiler). For the most part I've been using Keil's tools through the silabs IDE (which looks like a modified version of the Keil IDE). Here is the "stupid" question... How do I use (invoke) this "MDU_F120" directive? No picking at me about the C++ comment please - there are lots of advantages to a C++ compiler, even in an embedded environment. You just have to understand what will be generated if you get carried away with things (and I used it with C167 and ST10, which are much more capable than an 8051).
In uVision, Open the Project Options Dialog and click on the C51 tab. Under Miscellaneous, enter MDU_F120. Jon
how is that cone from the commandline? Erik