add openFPGAloader programmer
[litex.git] / litex / __init__.py
1 import sys
2
3 from litex.tools.litex_client import RemoteClient
4
5 def get_data_mod(data_type, data_name):
6 """Get the pythondata-{}-{} module or raise a useful error message."""
7 imp = "import pythondata_{}_{} as dm".format(data_type, data_name)
8 try:
9 l = {}
10 exec(imp, {}, l)
11 dm = l['dm']
12 return dm
13 except ImportError as e:
14 raise ImportError("""\
15 pythondata-{dt}-{dn} module not installed! Unable to use {dn} {dt}.
16 {e}
17
18 You can install this by running;
19 pip install git+https://github.com/litex-hub/pythondata-{dt}-{dn}.git
20 """.format(dt=data_type, dn=data_name, e=e))