Monday, April 18, 2016

Program on firmware for new fpga board, also working to restructure GUI program

Infected tooth, whole side of face swollen, and waiting for root canal on Tuesday with lots of painkillers. Not accomplishing much else.


Testing new board and Vivado toolchain results

After chasing a long and twisty set of requisites, I finally was able to compile the firmware for the USB module on my ztex fpga board. I had to have a Mingware unix environment on Windows, the Small Device C Compiler (SDCC), the ztex macros, the Java JDK, and all the files organized correctly. With the file generated, I went out to load it onto the board and check for functionality.

The latest file will show up as my SAC firmware and lets me communicate between the Python program and the new board. My B register display is not correct, which suggests that I have some of the assignments of fpga pins incorrect. Basic things like clock, phase A, reset and interrupt levels were correct. I will have to work through this carefully to get it right.

I still have the immensely annoying failure to boot from the bitstream that I loaded into flash. Everything reports back as if it is correct - right USB firmware, lists flash configuration support, shows the file successfully written to flash, but it powers up in the unconfigured mode.

I really wrestled with this problem back on the older version of the ztex board, sitting down with Richard Stofer to figure out what needed to be done by comparing his boards and mine, but at some point it all started working properly. Unfortunately, when the real cause of the problems is not known, and the steps which fixed the problem aren't understood, it is very hard to recreate the solution on the new board. Grrrrrrrrrrrrrrrrrrrrrrrrrr.

Restructuring the GUI

I did use the time to build up my knowledge of the wxWidgets for constructing a GUI, specifically the Python wrapper for the toolkit called wxPython. There are several layers of knowledge buried here - Python itself, wxPython binding, the wxWidgets toolkit/API, and then the underlying details of the GUI environment on Windows/Unix etc.

One of the things I will also be doing during this process is refactoring the code, making it more elegant and Pythonic (an adjective that is important to those that program in this language). Since I am also restructuring to the model-view-controller pattern, there is going to be a bit of code moved around.

No comments:

Post a Comment