5 from collections
import OrderedDict
8 current_path
= os
.path
.dirname(os
.path
.realpath(__file__
))
10 # name, (url, recursive clone, develop)
13 ("migen", ("https://github.com/m-labs/", True, True)),
16 ("litex", ("https://github.com/enjoy-digital/", True, True)),
18 # LiteX cores ecosystem
19 ("liteeth", ("https://github.com/enjoy-digital/", False, True)),
20 ("litedram", ("https://github.com/enjoy-digital/", False, True)),
21 ("litepcie", ("https://github.com/enjoy-digital/", False, True)),
22 ("litesata", ("https://github.com/enjoy-digital/", False, True)),
23 ("litesdcard", ("https://github.com/enjoy-digital/", False, True)),
24 ("liteiclink", ("https://github.com/enjoy-digital/", False, True)),
25 ("litevideo", ("https://github.com/enjoy-digital/", False, True)),
26 ("litescope", ("https://github.com/enjoy-digital/", False, True)),
27 ("litejesd204b", ("https://github.com/enjoy-digital/", False, True)),
29 # LiteX boards support
30 ("litex-boards", ("https://github.com/litex-hub/", False, True)),
32 repos
= OrderedDict(repos
)
35 print("Available commands:")
37 print("- install (add --user to install to user directory)")
41 if "init" in sys
.argv
[1:]:
42 for name
in repos
.keys():
43 url
, need_recursive
, need_develop
= repos
[name
]
44 # clone repo (recursive if needed)
45 print("[cloning " + name
+ "]...")
47 opts
= "--recursive" if need_recursive
else ""
48 os
.system("git clone " + full_url
+ " " + opts
)
50 if "install" in sys
.argv
[1:]:
51 for name
in repos
.keys():
52 url
, need_recursive
, need_develop
= repos
[name
]
54 print("[installing " + name
+ "]...")
56 os
.chdir(os
.path
.join(current_path
, name
))
57 if "--user" in sys
.argv
[1:]:
58 os
.system("python3 setup.py develop --user")
60 os
.system("python3 setup.py develop")
62 if "update" in sys
.argv
[1:]:
63 for name
in repos
.keys():
65 print("[updating " + name
+ "]...")
66 os
.chdir(os
.path
.join(current_path
, name
))