fix: enforce canonical ordering for tile port directions#698
fix: enforce canonical ordering for tile port directions#698KelvinChung2000 wants to merge 5 commits into
Conversation
Make ``Direction`` orderable in canonical (NORTH, EAST, SOUTH, WEST, JUMP) order and sort tile ports by direction in ``parseTilesCSV`` so generated wire orderings are deterministic regardless of input row order.
IAmMarcelJung
left a comment
There was a problem hiding this comment.
Just some minor comments, rest LGTM. Also, the functool docs mention that also __eq__ should be defined, but probably we don't need it here since we won't have this case anyway (and it's a should, not a must after all)?
|
I thought this was safe since Python's sorting is stable. It is probably that we do not sort at 1.0. Then sorting starts at 2.0 but that sort on sort changes something. This is looking like sorting at "W,E,b", not "b,W,E" |
|
At some point, we need to update the bitstream spec generation so that it remains stable regardless of how we change the front side from a random value. This is too annoying to deal with. |
Yes, this is really annoying. |
|
I did this one because https://github.com/FPGA-Research/fabulous-tiles/blob/main/tiles/classic/E_IO/E_IO.csv is not in the correct order of NESW, the sort is to make this not matter. I will see what should be done. |
Overall the sort makes sense, but sadly this breaks things. I've added FABulous 2.0b4 demos to the reference tests, to ensure that we don't add regression in the spec generation in the future. |

Make
Directionorderable in canonical (NORTH, EAST, SOUTH, WEST, JUMP) order and sort tile ports by direction inparseTilesCSVso generated wire orderings are deterministic regardless of input row order.