FPGAwars / apio

:seedling: Open source ecosystem for open FPGA boards
https://github.com/FPGAwars/apio/wiki
GNU General Public License v2.0
772 stars 131 forks source link

Added to the apio sim an optional -testbench flag #341

Closed zapta closed 4 months ago

zapta commented 4 months ago

This PR adds an optional --testbench flag to the apio sim command. It introduces support for a multi testbench project, and allow to select the testbench to simulate. If the --testbench flag is not specified, the sim command maintains the old behavior of picking the first testbench that was listed by the Glob function.

If and when this PR will get approved and checked in, I can do the following additional changes:

  1. The sim command will fail if --testbench flag is not specified an more than one testbench is found (instead of picking the first one in the Glob order).

  2. Have the apio clean command cleaning all the tb.out and tb.vcd files rather than just of one testbench. Alternatively, the .out and .vcd can have a fixed name that is independent of the testbench name, similar to the generated hardware.x files.

zapta commented 4 months ago

Thanks Juan!

On Mon, Feb 19, 2024 at 3:19 PM Juan Gonzalez-Gomez < @.***> wrote:

Merged #341 https://github.com/FPGAwars/apio/pull/341 into develop.

— Reply to this email directly, view it on GitHub https://github.com/FPGAwars/apio/pull/341#event-11855021585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQVMQOWEIRHOQLSMNFXLWTYUPMWTAVCNFSM6AAAAABDQDOACOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHA2TKMBSGE2TQNI . You are receiving this because you authored the thread.Message ID: @.***>

zapta commented 4 months ago

@Obijuan, What do you think about these two changes? (I can make them)

  1. apio sim with no --testbench flag and with more than 1 test bench file results in a fatal error rather than picking the first one in Glob order.
  2. Sim clean deletes the .out and .vcd files al all test benches rather than just of one testbench. E.g. if you sim 3 test benches and then run api clean, it will clean all the three test benches.
Obijuan commented 4 months ago

I agree with both proposals. It makes sense

zapta commented 4 months ago

Thanks @Obijuan. I just sent you a PR for the cleanup. https://github.com/FPGAwars/apio/pull/342