Hi, I am new to C++ and trying to develop custom HLA analyzer by following instruction from Analyzer_API.md.
Document has below statement but I couldn’t able to find any reference or further explanation about DataBuilder. I was wondering Is DataBuilder a standard class in C++? I tried to google it but no luck.
" Similar, but reversed, is the DataBuilder class, but as this generally used for collecting data, we’ll talk more about it then."
Thanks for writing in! Sorry for the confusion with this.
First some additional background:
We have two different ways to create analyzers for the software.
We have high level analyzers (HLAs) which are written in python, and can create new results, by processing the results produced by our low level analyzers.
Second, we have low level analyzers (usually just called analyzers). These are written in C++, and are able to produce data by processing the raw digital signals that are recorded.
Low level analyzers are best for processing a new protocol format that can’t be decoded by any of our existing analyzers.
High level analyzers are best for post-processing existing results. For example, our low level I2C analyzer just decodes address and data bytes. However, an HLA could be created to interpret the register values for a particular IC, producing much more descriptive results.
The Analyzer_API.md file really needs to be updated, and it only applies to our C++ low level analyzer API.
You mentioned you were developing a custom HLA analyzer. If you’re just developing an HLA (as described above) you will use Python, and should start here:
However, if you’re trying to develop a low level analyzer, either by itself, or with the intent of creating an HLA along with your LLA, then you should start here:
Finally, to answer your question about DataBuilder.
DataBuilder is a class that we provide as part of the C++ low level logic analyzer class. It’s a convenience class that tries to make it easy to gather individual bits into words, where you can specify how many bits per word and what order the bits are in (LSB or MSB first).
You can see an example of it in action here:
the mMosiResult class member is an instance of the DataBuilder class.
In this example, the SPI analyzer can be configured by the user for a specific number of bits per word. In most cases, this is either 8 or 16 bits per word. The user can also specify if the bits are LSB first, or MSB first. This class makes it easy to add one bit at a time, and then once complete, you can copy out the complete word.
If you are writing your own C++ analyzer, I strongly recommend reviewing some of our C++ analyzers, and potentially start by modifying one of them, rather than starting from the SampleAnalyzer.
You can find the source for all of our C++ analyzers, and our python HLAs, on our github organization here: