6 from collections
import OrderedDict
9 current_path
= os
.path
.dirname(os
.path
.realpath(__file__
))
11 # name, (url, recursive clone, develop)
14 ("migen", ("https://github.com/m-labs/", True, True)),
17 ("litex", ("https://github.com/enjoy-digital/", True, True)),
19 # LiteX cores ecosystem
20 ("liteeth", ("https://github.com/enjoy-digital/", False, True)),
21 ("litedram", ("https://github.com/enjoy-digital/", False, True)),
22 ("litepcie", ("https://github.com/enjoy-digital/", False, True)),
23 ("litesata", ("https://github.com/enjoy-digital/", False, True)),
24 ("litesdcard", ("https://github.com/enjoy-digital/", False, True)),
25 ("liteiclink", ("https://github.com/enjoy-digital/", False, True)),
26 ("litevideo", ("https://github.com/enjoy-digital/", False, True)),
27 ("litescope", ("https://github.com/enjoy-digital/", False, True)),
28 ("litejesd204b", ("https://github.com/enjoy-digital/", False, True)),
29 ("litespi", ("https://github.com/litex-hub/", False, True)),
31 # LiteX boards support
32 ("litex-boards", ("https://github.com/litex-hub/", False, True)),
34 repos
= OrderedDict(repos
)
37 print("Available commands:")
39 print("- install (add --user to install to user directory)")
43 if "init" in sys
.argv
[1:]:
44 for name
in repos
.keys():
45 url
, need_recursive
, need_develop
= repos
[name
]
46 # clone repo (recursive if needed)
47 print("[cloning " + name
+ "]...")
49 opts
= "--recursive" if need_recursive
else ""
50 subprocess
.check_call(
51 "git clone " + full_url
+ " " + opts
,
54 if "install" in sys
.argv
[1:]:
55 for name
in repos
.keys():
56 url
, need_recursive
, need_develop
= repos
[name
]
58 print("[installing " + name
+ "]...")
60 os
.chdir(os
.path
.join(current_path
, name
))
61 if "--user" in sys
.argv
[1:]:
62 subprocess
.check_call(
63 "python3 setup.py develop --user",
66 subprocess
.check_call(
67 "python3 setup.py develop",
70 if "update" in sys
.argv
[1:]:
71 for name
in repos
.keys():
73 print("[updating " + name
+ "]...")
74 os
.chdir(os
.path
.join(current_path
, name
))
75 subprocess
.check_call(