fusesoc
                                
                                 fusesoc copied to clipboard
                                
                                    fusesoc copied to clipboard
                            
                            
                            
                        Add errors key for targets to report error conditions
This adds a new key to targets named 'errors' and a get_errors CAPI function. Any item in the errors list that evaluates to a non-empty string will be treated as an error condition and the string will be printed out before exiting FuseSoC. Use-cases include erroring out for unsupported combinations of flags, or disallowing the use of certain simulators
Hm, this approach feels a bit too rough to me and not explicit enough.
Could you give an example use case to better illustrate the problem you're trying to solve? What we possibly want to specify is not "a list of errors", but a list of conditions under which a target is usable, and throw an error otherwise.
Another way to think about it: flags could be a requirement (as in something that the dependency solver takes care of) or a conflict.
One common use for this would be to set errors: ["!tool_verilator? (Testbench only supports Verilator)"]
It could also be used to check for invalid combinations of use flags errors: ["!spi? (boot_from_spi? (spi must be enabled to boot from SPI))"]