Skip to content

Commit 3556c91

Browse files
committed
Updating pythondata-cpu-mor1kx to 5.0.post124
Updated data to v5.0-76-g06e2e46 based on 06e2e46 from https://github.com/openrisc/mor1kx.git. > commit 06e2e46 > Author: JaewonHur <[email protected]> > Date: Mon Dec 23 01:23:20 2019 +0900 > > Fix mor1kx_decode to accept valid l.fl1 (l.ff1) instructions (#110) > > * Fix mor1kx_decode to only accept valid l.fl1 and l.ff1 instructions > > Both l.fl1 and l.ff1 have bit 9 set in the insruction as port of their op codes, > mor1kx_decode does not currently properly check this > Updated using 0.0.post48 from https://github.com/litex-hub/litex-data-auto
1 parent 1a365aa commit 3556c91

File tree

5 files changed

+107
-34
lines changed

5 files changed

+107
-34
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
graft litex/data/cpu/mor1kx/verilog/
1+
graft pythondata_cpu_mor1kx/verilog/
22
global-exclude *.py[cod]

README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,92 @@
1-
# litex-data-cpu-mor1kx
1+
# pythondata-cpu-mor1kx
22

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
47
[LiteX](https://github.com/enjoy-digital/litex.git).
58

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.
811

912
Example of getting the data file directly;
1013
```python
11-
import litex.data.cpu.mor1kx
14+
import pythondata_cpu_mor1kx
1215

1316
my_data_file = "abc.txt"
1417

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:
1619
print(f.read())
1720
```
1821

1922
Example of getting the data file using `litex.data.find` API;
2023
```python
21-
from litex.data.find import find_data
24+
from pythondata_cpu_mor1kx import data_file
2225

2326
my_data_file = "abc.txt"
2427

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:
2629
print(f.read())
2730
```
2831

2932

3033
The data files come from https://github.com/openrisc/mor1kx.git
3134
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).
3336

3437

3538

36-
## Installing
39+
## Installing from git repository
3740

3841
## Manually
3942

4043
You can install the package manually, however this is **not** recommended.
4144

4245
```
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
4548
sudo python setup.py install
4649
```
4750

48-
## Using [pip](https://pip.pypa.io/)
51+
## Using [pip](https://pip.pypa.io/) with git repository
4952

5053
You can use [pip](https://pip.pypa.io/) to install the data package directly
5154
from github using;
5255

5356
```
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
5558
```
5659

5760
If you want to install for the whole system rather than just the current user,
5861
you need to remove the `--user` argument and run as sudo like so;
5962

6063
```
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
6265
```
6366

6467
You can install a specific revision of the repository using;
6568
```
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>
6972
```
7073

7174
### With `requirements.txt` file
7275

7376
Add to your Python `requirements.txt` file using;
7477
```
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
7679
```
7780

7881
To use a specific revision of the repository, use the following;
7982
```
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
8192
```

pythondata_cpu_mor1kx/__init__.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import os.path
2+
__dir__ = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0]
3+
data_location = os.path.join(__dir__, "verilog")
4+
src = "https://github.com/openrisc/mor1kx.git"
5+
6+
# Module version
7+
version_str = "5.0.post124"
8+
version_tuple = (5, 0, 124)
9+
try:
10+
from packaging.version import Version as V
11+
pversion = V("5.0.post124")
12+
except ImportError:
13+
pass
14+
15+
# Data version info
16+
data_version_str = "5.0.post76"
17+
data_version_tuple = (5, 0, 76)
18+
try:
19+
from packaging.version import Version as V
20+
pdata_version = V("5.0.post76")
21+
except ImportError:
22+
pass
23+
data_git_hash = "06e2e46afbad62572c31bde88e8f2424e23ecda2"
24+
data_git_describe = "v5.0-76-g06e2e46"
25+
data_git_msg = """\
26+
commit 06e2e46afbad62572c31bde88e8f2424e23ecda2
27+
Author: JaewonHur <[email protected]>
28+
Date: Mon Dec 23 01:23:20 2019 +0900
29+
30+
Fix mor1kx_decode to accept valid l.fl1 (l.ff1) instructions (#110)
31+
32+
* Fix mor1kx_decode to only accept valid l.fl1 and l.ff1 instructions
33+
34+
Both l.fl1 and l.ff1 have bit 9 set in the insruction as port of their op codes,
35+
mor1kx_decode does not currently properly check this
36+
37+
"""
38+
39+
# Tool version info
40+
tool_version_str = "0.0.post48"
41+
tool_version_tuple = (0, 0, 48)
42+
try:
43+
from packaging.version import Version as V
44+
ptool_version = V("0.0.post48")
45+
except ImportError:
46+
pass
47+
48+
49+
def data_file(f):
50+
"""Get absolute path for file inside pythondata_cpu_mor1kx."""
51+
fn = os.path.join(data_location, f)
52+
fn = os.path.abspath(fn)
53+
if not os.path.exists(fn):
54+
raise IOError("File {f} doesn't exist in pythondata_cpu_mor1kx".format(f))
55+
return fn

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
with open("README.md", "r") as fh:
44
long_description = fh.read()
55

6-
from litex.data.cpu.mor1kx import version_str
6+
from pythondata_cpu_mor1kx import version_str
77

88
setuptools.setup(
9-
name="litex-data-cpu-mor1kx",
9+
name="pythondata-cpu-mor1kx",
1010
version=version_str,
1111
author="LiteX Authors",
1212
author_email="[email protected]",
13-
description="Python module containing data files for using the OpenRISC1000 cpu with LiteX.",
13+
description="""\
14+
Python module containing verilog files for OpenRISC1000 cpu.""",
1415
long_description=long_description,
1516
long_description_content_type="text/markdown",
16-
url="https://github.com/litex-hub/litex-data-cpu-mor1kx",
17+
url="https://github.com/litex-hub/pythondata-cpu-mor1kx",
1718
classifiers=[
1819
"Programming Language :: Python :: 3",
1920
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
@@ -22,6 +23,12 @@
2223
python_requires='>=3.5',
2324
zip_safe=False,
2425
packages=setuptools.find_packages(),
25-
package_data={'litex.data.cpu.mor1kx': ['litex/data/cpu/mor1kx/verilog/**']},
26+
package_data={
27+
'cpu_mor1kx': ['cpu_mor1kx/verilog/**'],
28+
},
2629
include_package_data=True,
30+
project_urls={
31+
"Bug Tracker": "https://github.com/litex-hub/pythondata-cpu-mor1kx/issues",
32+
"Source Code": "https://github.com/litex-hub/pythondata-cpu-mor1kx",
33+
},
2734
)

test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/usr/bin/env python3
22
import os
33

4-
from litex.data.cpu import mor1kx
4+
import pythondata_cpu_mor1kx
55

6-
print("Found mor1kx @ version", mor1kx.version_str, "(with data", mor1kx.data_version_str, ")")
6+
print("Found mor1kx @ version", pythondata_cpu_mor1kx.version_str, "(with data", pythondata_cpu_mor1kx.data_version_str, ")")
77
print()
8-
print("Data is in", mor1kx.data_location)
9-
assert os.path.exists(mor1kx.data_location)
10-
print("Data is version", mor1kx.data_version_str, mor1kx.data_git_hash)
8+
print("Data is in", pythondata_cpu_mor1kx.data_location)
9+
assert os.path.exists(pythondata_cpu_mor1kx.data_location)
10+
print("Data is version", pythondata_cpu_mor1kx.data_version_str, pythondata_cpu_mor1kx.data_git_hash)
1111
print("-"*75)
12-
print(mor1kx.data_git_msg)
12+
print(pythondata_cpu_mor1kx.data_git_msg)
1313
print("-"*75)
1414
print()
1515
print("It contains:")
16-
for root, dirs, files in os.walk(mor1kx.data_location):
16+
for root, dirs, files in os.walk(pythondata_cpu_mor1kx.data_location):
1717
dirs.sort()
1818
for f in sorted(files):
19-
path = os.path.relpath(os.path.join(root, f), mor1kx.data_location)
19+
path = os.path.relpath(os.path.join(root, f), pythondata_cpu_mor1kx.data_location)
2020
print(" -", path)

0 commit comments

Comments
 (0)