Closed kasbah closed 6 years ago
The examples in the README are parts from examples/small
. To run the examples do cd examples/small
and run make all
But I agree the documentation isn't very good, it's still all very unstable, and the example doesn't autoroute unless you disable this line because there isn't multilayer support yet and the packing is to dense #7
Hmm, looks like the module isn't properly exported.
$ make all
make build
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
python3 small.py
Traceback (most recent call last):
File "small.py", line 6, in <module>
from pycircuit.formats import *
ImportError: No module named 'pycircuit.formats'
Makefile:4: recipe for target 'build' failed
make[1]: *** [build] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: [all] Error 2 (ignored)
make place
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
rm -f small.out.pcpl
python3 ../../placer/place.py small.pcpl
Traceback (most recent call last):
File "../../placer/place.py", line 1, in <module>
from z3 import *
ImportError: No module named 'z3'
Makefile:7: recipe for target 'place' failed
make[1]: *** [place] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2
If I copy the source directory over
$ cp -r ../../pycircuit/ .
$ make all
make build
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
python3 small.py
Traceback (most recent call last):
File "small.py", line 154, in <module>
pcb.from_pcpl('small.out.pcpl')
File "/home/kaspar/projects/pycircuit/examples/small/pycircuit/formats/pcpl.py", line 28, in from_pcpl
with open(filename) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'small.out.pcpl'
Makefile:4: recipe for target 'build' failed
make[1]: *** [build] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: [all] Error 2 (ignored)
make place
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
rm -f small.out.pcpl
python3 ../../placer/place.py small.pcpl
Traceback (most recent call last):
File "../../placer/place.py", line 1, in <module>
from z3 import *
ImportError: No module named 'z3'
Makefile:7: recipe for target 'place' failed
make[1]: *** [place] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2
If I install z3:
$ pip install z3
$ make all
make build
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
python3 small.py
Traceback (most recent call last):
File "small.py", line 154, in <module>
pcb.from_pcpl('small.out.pcpl')
File "/home/kaspar/projects/pycircuit/examples/small/pycircuit/formats/pcpl.py", line 28, in from_pcpl
with open(filename) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'small.out.pcpl'
Makefile:4: recipe for target 'build' failed
make[1]: *** [build] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: [all] Error 2 (ignored)
make place
make[1]: Entering directory '/home/kaspar/projects/pycircuit/examples/small'
rm -f small.out.pcpl
python3 ../../placer/place.py small.pcpl
Traceback (most recent call last):
File "../../placer/place.py", line 77, in <module>
result = place(input)
File "../../placer/place.py", line 11, in place
box = Z3Box.from_dict(node)
File "/home/kaspar/projects/pycircuit/placer/box.py", line 84, in from_dict
return cls(int(d['id']), d['width'], d['height'])
File "/home/kaspar/projects/pycircuit/placer/box.py", line 92, in __init__
self.const_rx = int(math.ceil(width / 2))
NameError: name 'math' is not defined
Makefile:7: recipe for target 'place' failed
make[1]: *** [place] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2
I am slowly getting there. Just compiling monosat. Will send a pull-request with fixes.
It would be nice to have the examples in the README be runnable in ipython or whatever if this is installed. I think that's what people would expect. Can I change the README?
This is what I have in my .zshrc
file:
export PYTHONPATH=$PYTHONPATH:~/repos/pykicad:~/repos/pycircuit2:~/repos/monosat/src/monosat/api/python:~/repos/build/z3/python
Can I change the README?
Yes
Ok, I managed to run it fully by installing the monosat python package and copying the compiled libmonosat.so into it ($PYTHONPATH would do it too). Looks like it can't solve the routing though, is that expected?
Solving in Monosat...
s UNSATISFIABLE
Makefile:11: recipe for target 'route' failed
make[1]: *** [route] Error 1
make[1]: Leaving directory '/home/kaspar/projects/pycircuit/examples/small'
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2
Regarding all the packaging trouble I have opened up an issue on monosat which will need to be packaged to handle the dependencies properly.
Yes, as I mentioned, to solve the routing multilayer support is required since the packing is too dense.
But I agree the documentation isn't very good, it's still all very unstable, and the example doesn't autoroute unless you disable this line because there isn't multilayer support yet and the packing is to dense #7
Also note that it's still very slow, there are some options that can be enabled and the routing time is most affected by the pcb area. I needed a 0.05mm grid for the pads on the QFN package to be represented correctly, if you reduce the grid to 0.15mm spacing it will be a lot faster.
Hey, I just had my first go at trying to run this. I am assuming it is for python3 as I get
SyntaxError
s with python2. So I have done:When I run the examples from the readme it gives:
Devices
Footprints
Assign footprints
And I haven run the remaining ones because they seem to require
circuit
.