Skip to content

Conversation

@LukasVik
Copy link
Contributor

@LukasVik LukasVik commented Jan 9, 2020

In my run.py I want to do different things depending on what simulator the user is running. That might be things like using different locations for precompiled simlib, not adding some sources when using ghdl, etc.

This PR is a suggestion for a simple interface that solves my use case. Feel free to provide feedback.

@eine
Copy link
Collaborator

eine commented Jan 9, 2020

Hi @LukasVik! Taking https://github.com/VHDL/Compliance-Tests/blob/master/run.py as a reference, might this work?

from vunit.sim_if.factory import SIMULATOR_FACTORY
SIMULATOR_FACTORY.select_simulator().name

@kraigher kraigher merged commit 17a63f3 into VUnit:master Jan 9, 2020
@kraigher
Copy link
Collaborator

kraigher commented Jan 9, 2020

It is probably good to have this on the public api. I avoided it before to not exclude running tests for multiple simulators in the same run. I do not think that will happen or is so important though so we can merge this.

@LukasVik
Copy link
Contributor Author

Thanks for the tip @eine. I really like you avatar. Monkey Island is great.

It is probably good to have this on the public api.

I agree. The design pattern is probably common enough among VUnit users that it makes sense to add to the public api. While I realise we don't want to clutter the api, this makes it more convenient than the previously available solution.

Thanks for merging!

@eine
Copy link
Collaborator

eine commented Jan 10, 2020

I really like you avatar. Monkey Island is great.

Thanks! You are actually the first one that made a reference to it ;)

this makes it more convenient than the previously available solution.

It is!

@LukasVik LukasVik deleted the get_simulator_name branch October 1, 2020 06:07
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.

3 participants