TL;DR, the output of openFPGALoader --scan-usb is difficult to parse programmatically because it field widths that are inconsistent between rows.
Apio is an open source toolset for designing FPGAs and we would like to migrate to it as the primary FPGA programming tool. However, the problem that we encounter is that the output of openFPGALoader --scan-usb hard to parse because it generate inconsistent column widths.
Below is an example, notice how the manufacturer column values causes an inconsistent start of the serial column. Also, since the manufacturer values can contains arbitrary chars, including spaces, it's impossible to derive the column boundaries by the space characters.
Bus device vid:pid probe type manufacturer serial product
000 001 0x0403:0x6010 FTDI2232 AlhambraBits none Alhambra II v1.0A - B09-335
001 001 0x0403:0x6010 FTDI2232 tinyVision.ai FT94RQ8V UPduino v3.1c
002 001 0x0403:0x6010 FTDI2232 tinyVision.ai.v3 FT94RQ8V UPduino v3.1c
We request to make the output of the openFPGALoader --scan-usb more parsable, for example by one of these methods:
Method 1 - Keep consistent column widths across the header and the rows. That is, first determine dynamically at runtime the necessary widths and then use them for all the rows.
Method 2* - Have a new flag --csv-list which causes the header and rows to be printed in csv format or allow the user to specify the separator.
Method 3 - Have flag that causes the data to be printed as a json doc. This is probably the cleaner for parsing with python and similar languages but am not sure if it's parsable by shell scripts such as bash.
Method 4 - Anything else that allows to safely parse the header and rows.
TL;DR, the output of
openFPGALoader --scan-usbis difficult to parse programmatically because it field widths that are inconsistent between rows.Apio is an open source toolset for designing FPGAs and we would like to migrate to it as the primary FPGA programming tool. However, the problem that we encounter is that the output of
openFPGALoader --scan-usbhard to parse because it generate inconsistent column widths.Below is an example, notice how the
manufacturercolumn values causes an inconsistent start of theserialcolumn. Also, since themanufacturervalues can contains arbitrary chars, including spaces, it's impossible to derive the column boundaries by the space characters.We request to make the output of the
openFPGALoader --scan-usbmore parsable, for example by one of these methods:Method 1 - Keep consistent column widths across the header and the rows. That is, first determine dynamically at runtime the necessary widths and then use them for all the rows.
Method 2* - Have a new flag
--csv-listwhich causes the header and rows to be printed in csv format or allow the user to specify the separator.Method 3 - Have flag that causes the data to be printed as a
jsondoc. This is probably the cleaner for parsing with python and similar languages but am not sure if it's parsable by shell scripts such as bash.Method 4 - Anything else that allows to safely parse the header and rows.