FAQ

Speed is important on our project. How do we know the generated code will be fast enough? The register access macros provided with Bits should compile down to very few instructions by any decent compiler. Check it by compiling to assembly code and examining the assembly. The macros bits use are not that complicated and if there are issues, then likely you will have had similar issues even if not using Bits.  The beauty of Bits, is that since it uses templates in generating code, any speed enhancements can be made in one place and benefit the entire project.

Is Bits one of those tools that changes our entire development paradigm?   No, and lets stay away from the word paradigm. Bits is simple.  You can generate your code and then choose to maintain your register access code either outside of or within Bits.  Bits will generate source files that you can use how you like.  One note though, if you ever choose to modify the template files which Bit used to generate your code, you’ll probably want to use the original files you used in Bits so you can regenerate your register access code.

Does Bits run on Linux, Unix or Windows? Yes. Currently it has only been tested on Windows.  However it is developed in Jython, which compiles to Java code.  Bits should be able to run in any of these environments.

When will Bits be tested on Unix and Linux then? Development is unclear on this point.  Probably at the first sign that someone is ready to use it in these environments.

I have a register that needs to be written to, but cannot be read from.  Does the code generated by Bits remember the previous value written so any updates to some bits in the register wont destroy values in the other bits? Yes. In fact, bits supports the concept of a “cached” register. A cached register is one which remembers its value in memory so that future calls to update a field within the register allow the other fields to remain unaffected.

Does caching work for memory regions as well? Yes.

My project has one device with three registers.  Is Bits useful for this?  Its like this: if you are a attaching a knob to a piece of wood and you have a screwdriver in your hand, is it worth going to the garage to get the power drill? On the other hand, if you are assembling a piece of furniture, or building a deck, then get the power drill, and don’t forget the Bits.

We would like to extend the table of information to include other fields, like some information for diagnostics. Are the data input tables extendable? Not at this point. Arrangements could be made for customizations.

We would like to change the format of the code templates.  Is this easy to do?   It depends. The code templates have their own notation and this notation is documented in a sample template file.  Basically, one can perform iterations over the registers and register fields and substitute values based on information in the data entry tables. Furthermore, Bits is written in Jython, and supports extensibility, so you could even add Jython code for anything really fancy.  As an example, the register masks are generated from an external piece of Jython code giving an example of how this would be done.  In short, some changes can be easy, but if you like, arrangements can be made here for further customizations as well.

We are in the middle of our project.   Is it possible to start using Bits? If you have new devices that need programming then it could be worthwhile.   Also, if you are looking to enhance your debugging or simulation abilities then you may want to convert your register accessors to those generated by Bits. While Bits itself doesn’t do simulation or debugging, it provides an architecture that supports these things.