edalize icon indicating copy to clipboard operation
edalize copied to clipboard

Pre/Post run hooks not executed when using flow API

Open ivanvig opened this issue 9 months ago • 1 comments

I'm not sure if this is a bug or an intended change, and whether I should be using a different method. I wanted to generate a coverage report using verilator_coverage, so I added a post_run hook to run the command and generate the report, but the hook is never executed.

Looking at the code, I see that the hook is correctly added to the command chain in Edaflow's __init__ method. However, the run implementation in the Sim flow ignores the command chain and only executes the tool command.

I believe the run method in Edaflow shouldn’t be empty. Instead, it should execute the pre_run, run, and post_run commands. Each subclass of Edaflow should provide its own run command, but leaving the responsibility of executing the hooks to individual flow implementations is too error-prone.

I'm willing to provide a fix if this is indeed an issue, but I’d like to discuss the best way to implement it first.

ivanvig avatar Feb 10 '25 21:02 ivanvig

It might very well be broken. I recently fixed pre_build scripts not being run properly (e438f9fc874db2b937c76f) but I haven't had time to check the run scripts. If you have a solution in mind, feel free to come up with a proposal or an implementation.

olofk avatar Feb 13 '25 17:02 olofk