Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor simulator functions to allow separate compile and run target… #106

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

Risto97
Copy link
Contributor

@Risto97 Risto97 commented Dec 2, 2024

…s, which allows adding tests with CTest

@Risto97
Copy link
Contributor Author

Risto97 commented Dec 2, 2024

With this update, it is possible to create a compilation target without run target for modelsim, iverilog, xcelium, verilator using NO_RUN_TARGET argument.
Additionally, on subsequent calls to each of the functions, it is possible to create the run target.
Along with RUN_TARGET_NAME it is possible to specify the name of the created run target.

This is useful when creating CTest tests, in cases where different test scenarios are for example passed with $plusargs CLI arguments.
For example:

iverilog(${IP} NO_RUN_TARGET) # Create only compilation target

foreach(test_name hexfile IN ZIP_LISTS test_list hex_list) # Loop through list of cross compiled C tests
    iverilog(${IP}
        RUN_ARGS +firmware=${hexfile}               # Pass path to compiled hexfile to simulation
        RUN_TARGET_NAME run_${test_name}            # Create a target for running the hex file test
        )
    add_dependencies(run_${test_name} ${test_name}) # Make sure hex file is compiled before simulation is invoked
    add_test(NAME run_${test_name}                  # Create a CTest that will run the simulation target
        COMMAND make run_${test_name})
endforeach()

@Risto97 Risto97 merged commit aeb2097 into develop Dec 4, 2024
1 check passed
@Risto97 Risto97 deleted the sim_refactor branch December 4, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant