This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use the MAC in keil?

Is the Multiply-Accumulate (MAC) Unit supported by the C51 compiler for the cygnal c8051f12x devices? How to use it?

Parents
  • 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

Reply
  • 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

Children
  • 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

  • I probably should have elaborated a little more. The silabs IDE uses the keil compiler, linker, etc but invokes it via command line. What I need to know is how to issue the directive as a command line argument.

    I'd much rather use the Keil tools than the silabs IDE but I don't know how to do that. The silabs development boards come with their own little JTAG adapter (download and debug) and the Keil tools don't recognize it, so I'm stuck with the silabs IDE (and they don't seem to have a command line interface to their JTAG adapter).

  • uVision shows you the command-line it generates - so just get uVision to show you?

    The C51 Manual describes both command-line invocation, and the corresponding uVision options.

  • What I need to know is how to issue the directive as a command line argument.

    Enter MDU_F120 on the command line.

    Jon