The release of a new version took us over a year to complete, but it is finally here. With the new Python integration we hope to open new ways of using Kactus2. Repetitive tasks such as importing all RTL files in a given directory, resizing component ports and creating registers based on a C header file can all be automated now. Also, the majority of the current generator plugins can be run from Python, enabling e.g. RTL generation as a part of an automated design tool flow run.
The changes introduce two new dependencies in the project: Python development libraries and SWIG. We explored the option of using whatever Python version was already installed on the target machine and launching the interpreter as a sub-process of Kactus2. We saw two drawbacks with this approach: First, the interpreter could not be extended which we needed to do to properly embed the it as part of the tool. Second, we want to keep the installer self-contained without the need to install any other tools Kactus2 depends on, so that the installation process remains straight-forward. For these reasons the Python interpreter is included with the executable although at the cost of more complex compilation process.
SWIG is our tool of choice for creating the Python/C++ interface. It generates Python bindings for our PythonAPI C++ class which defines the interface for accessing Kactus2 from outside the application core. If we need to add new functionality in the interface later, the changes become available in Python by just re-running SWIG instead of doing this manually which would be a massive effort. The interface is immediately available in Kactus2, since it is automatically imported at application startup.
One of the known performance bottlenecks has been the visualization of memory maps within a component. With hundreds of registers and bit fields, the GUI would freeze for a long time when the register information was first viewed or whenever it was changed. Changing a register name would trigger a full recursive update in the visualization even though the layout does not change as a result. We have now changed the way updates are handled and the GUI response is noticeably faster.