Bit of a status update. Maybe at some point I should make a dedicated thread for this.
Anyway, I'm mostly done with bitstream parsing and display. I'm working on tracing paths now.
(btw, the code is over at
https://github.com/Arisotura/xc3000/tree/main if it's of any interest)
This is what we have:
This example seems to be the vertical counter in the Lapis PCS bitstreams. There's a 10-bit counter going from DD to AF, and the logic in the middle seems to check for specific values to produce the VSYNC pulses and reset the counter when needed.
At this point I'm able to build proper nets from the interconnect data. I figured that giving them different colors would make it easier to tell them apart in the lack of better analysis solutions.
I'm looking at the bitstreams to try and see if I have any bugs, and I still do. For example, I just fixed a bug where the connection from AG.Y to BF.B and BG.B up there was missing. There are more -- for example I'm not seeing any clock input to the horizontal counter section, which is definitely odd.
A thing worth noting is that I do attempt to optimize nets by removing unused inputs. If you've looked at the XC2064 or XC2018 tools, you might have seen it was quite a mess. Technically, input muxes don't have a 'no input selected' setting, so there is always one input PIP active for each input. Additionally, production bitstreams will have all unused inputs tied together, which can create quite a mess. To get around this, I try to determine which inputs are relevant. For example, O and T inputs on IOBs will only be considered if the IOB is configured as an output, or tristate output, respectively. For CLBs we can just look at the LUTs, split them in two halves for a given input and see if these two halves are different.
Another example of a bug/oddity:
The CLB visual for one of the counter elements above. I'm not sure why the G equation is weird like that, A isn't even used as an input. The equation is supposed to be "G = (B ^ QY) * ~D". I think the equation code doesn't support XOR functions, but I'm not sure why it's pulling in A. Also, I might want to think of something regarding the length of the equation, because up there it doesn't fit the box.
All in all, it's coming together nicely I think. I'm thinking of eventually backporting it to the XC2064/18. Compared to the tracing code I had written in the XC2018 tool, this path system makes things so much easier to deal with.