Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python relative import #26

Open
mihelog opened this issue Jun 3, 2022 · 3 comments
Open

Python relative import #26

mihelog opened this issue Jun 3, 2022 · 3 comments

Comments

@mihelog
Copy link

mihelog commented Jun 3, 2022

This is with Python 3.9 in cygwin. Is it a python version issue?

$ python3 examples/main.py
Traceback (most recent call last):
File "/home/mixel/pymtl3-net/examples/main.py", line 22, in
from meshnet.MeshNetworkCL import MeshNetworkCL
File "/home/mixel/pymtl3-net/build/lib/pymtl3_net/meshnet/init.py", line 1, in
from .MeshNetworkCL import MeshNetworkCL
File "/home/mixel/pymtl3-net/build/lib/pymtl3_net/meshnet/MeshNetworkCL.py", line 12, in
from ..ocnlib.cl import BoundaryUnit
ImportError: attempted relative import beyond top-level package

Thanks in advance.

@yo96
Copy link
Contributor

yo96 commented Jun 5, 2022

Thanks for the message! The examples/main.py is deprecated and not maintained anymore. I will remove it in the next release to avoid confusion. The new frontend script is script/pymtl3-net. You can try $ python3 script/pymtl3-net -h to see the available options.

@mihelog
Copy link
Author

mihelog commented Jun 7, 2022

Thanks for answering! That works indeed but I wonder if there is a listing of available flags? Looking at the source code I see there are parameters such as the number of virtual channels and size, but I couldn't find how to pass those on to the frontend script. I'm talking about "flags" here:

usage: ./pymtl3-net gen []'

@yo96
Copy link
Contributor

yo96 commented Jun 7, 2022

You can also do $ python3 script/pymtl3-net gen -h to see the available topologies for gen. Then say if you want to generate a ring network you can try $ python3 script/pymtl3-net gen ring -h to see the available parameters for the ring network.

Alternatively, you can also create your own python file, import pymtl3_net, instantiate a network module with desired parameters, and apply pymtl3 translation pass to generate the verilog, or apply the simulation pass and create your own simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants