trabucayre / openFPGALoader

Universal utility for programming FPGA
https://trabucayre.github.io/openFPGALoader/
Apache License 2.0
1.21k stars 258 forks source link

efinix: program reports success (returns 0) when programming fails #476

Open AndrewD opened 3 months ago

AndrewD commented 3 months ago

Efinix: programming errors still result in a success return code so there is no way for a script to detect errors from the return value.

This interface needs to be able to propagate errors (not return void): https://github.com/trabucayre/openFPGALoader/blob/a39524636bcc0846a799ed1fb874c891fc350c1b/src/efinix.hpp#L30

trabucayre commented 3 months ago

In fact for all vendor's drivers program method throw exceptions when something is wrong. But it's true, changing program to a non void method may be more easy to manage And for efinix most of errors doesn't produces exception.

AndrewD commented 3 months ago

If throwing an exception is the existing pattern then following this for Efinix would be sufficient for now - openfpgaloader just returning a non-zero value on error is all we need.

trabucayre commented 3 months ago

with this commit all errors are correctly handled by program() method. It's good to you?