|
1 |
| -# litex-data-cpu-mor1kx |
| 1 | +# pythondata-cpu-mor1kx |
2 | 2 |
|
3 |
| -Non-Python data files required to use the mor1kx with |
| 3 | +Non-Python files needed for the cpu mor1kx packaged |
| 4 | +into a Python module so they can be used with Python libraries and tools. |
| 5 | + |
| 6 | +This Useful for usage with tools like |
4 | 7 | [LiteX](https://github.com/enjoy-digital/litex.git).
|
5 | 8 |
|
6 |
| -The data files can be found under the Python module `litex.data.cpu.mor1kx`. The |
7 |
| -`litex.data.cpu.mor1kx.location` value can be used to find the files on the file system. |
| 9 | +The data files can be found under the Python module `pythondata_cpu_mor1kx`. The |
| 10 | +`pythondata_cpu_mor1kx.location` value can be used to find the files on the file system. |
8 | 11 |
|
9 | 12 | Example of getting the data file directly;
|
10 | 13 | ```python
|
11 |
| -import litex.data.cpu.mor1kx |
| 14 | +import pythondata_cpu_mor1kx |
12 | 15 |
|
13 | 16 | my_data_file = "abc.txt"
|
14 | 17 |
|
15 |
| -with open(os.path.join(litex.data.cpu.mor1kx.data_location, my_data_file)) as f: |
| 18 | +with open(os.path.join(pythondata_cpu_mor1kx.data_location, my_data_file)) as f: |
16 | 19 | print(f.read())
|
17 | 20 | ```
|
18 | 21 |
|
19 | 22 | Example of getting the data file using `litex.data.find` API;
|
20 | 23 | ```python
|
21 |
| -from litex.data.find import find_data |
| 24 | +from pythondata_cpu_mor1kx import data_file |
22 | 25 |
|
23 | 26 | my_data_file = "abc.txt"
|
24 | 27 |
|
25 |
| -with open(os.path.join(find_data("cpu", "mor1kx"), my_data_file)) as f: |
| 28 | +with open(data_file(my_data_file)) as f: |
26 | 29 | print(f.read())
|
27 | 30 | ```
|
28 | 31 |
|
29 | 32 |
|
30 | 33 | The data files come from https://github.com/openrisc/mor1kx.git
|
31 | 34 | and are imported using `git subtrees` to the directory
|
32 |
| -[litex/data/cpu/mor1kx/verilog](litex/data/cpu/mor1kx/verilog). |
| 35 | +[pythondata_cpu_mor1kx/verilog](pythondata_cpu_mor1kx/verilog). |
33 | 36 |
|
34 | 37 |
|
35 | 38 |
|
36 |
| -## Installing |
| 39 | +## Installing from git repository |
37 | 40 |
|
38 | 41 | ## Manually
|
39 | 42 |
|
40 | 43 | You can install the package manually, however this is **not** recommended.
|
41 | 44 |
|
42 | 45 | ```
|
43 |
| -git clone https://github.com/litex-hub/litex-data-cpu-mor1kx.git |
44 |
| -cd litex-data-cpu-mor1kx |
| 46 | +git clone https://github.com/litex-hub/pythondata-cpu-mor1kx.git |
| 47 | +cd pythondata-cpu-mor1kx |
45 | 48 | sudo python setup.py install
|
46 | 49 | ```
|
47 | 50 |
|
48 |
| -## Using [pip](https://pip.pypa.io/) |
| 51 | +## Using [pip](https://pip.pypa.io/) with git repository |
49 | 52 |
|
50 | 53 | You can use [pip](https://pip.pypa.io/) to install the data package directly
|
51 | 54 | from github using;
|
52 | 55 |
|
53 | 56 | ```
|
54 |
| -pip install --user git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git |
| 57 | +pip install --user git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git |
55 | 58 | ```
|
56 | 59 |
|
57 | 60 | If you want to install for the whole system rather than just the current user,
|
58 | 61 | you need to remove the `--user` argument and run as sudo like so;
|
59 | 62 |
|
60 | 63 | ```
|
61 |
| -sudo pip install git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git |
| 64 | +sudo pip install git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git |
62 | 65 | ```
|
63 | 66 |
|
64 | 67 | You can install a specific revision of the repository using;
|
65 | 68 | ```
|
66 |
| -pip install --user git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git@<tag> |
67 |
| -pip install --user git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git@<branch> |
68 |
| -pip install --user git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git@<hash> |
| 69 | +pip install --user git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git@<tag> |
| 70 | +pip install --user git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git@<branch> |
| 71 | +pip install --user git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git@<hash> |
69 | 72 | ```
|
70 | 73 |
|
71 | 74 | ### With `requirements.txt` file
|
72 | 75 |
|
73 | 76 | Add to your Python `requirements.txt` file using;
|
74 | 77 | ```
|
75 |
| --e git+https://github.com/litex-hub/litex-data-cpu-mor1kx.git |
| 78 | +-e git+https://github.com/litex-hub/pythondata-cpu-mor1kx.git |
76 | 79 | ```
|
77 | 80 |
|
78 | 81 | To use a specific revision of the repository, use the following;
|
79 | 82 | ```
|
80 |
| --e https://github.com/litex-hub/litex-data-cpu-mor1kx.git@<hash> |
| 83 | +-e https://github.com/litex-hub/pythondata-cpu-mor1kx.git@<hash> |
| 84 | +``` |
| 85 | + |
| 86 | +## Installing from [PyPi](https://pypi.org/project/pythondata-cpu-mor1kx/) |
| 87 | + |
| 88 | +## Using [pip](https://pip.pypa.io/) |
| 89 | + |
| 90 | +``` |
| 91 | +pip install --user pythondata-cpu-mor1kx |
81 | 92 | ```
|
0 commit comments