Hi <@U016EM8L91B>, I'm trying to get cace going fo...
# analog-design
t
Hi @Tim Edwards, I'm trying to get cace going for characterization but I'm running into this python issue talking about a "circular import"? Do you know what the fix is?
Copy code
tom@tom:~/repos/projects/sky130_sg_ip$ ../../edatools/cace/cace/cace_gui.py 
../../edatools/cace/cace/cace_gui.py: line 20: $'\nThis is a Python tkinter script that handles local\nproject management.  Much of this involves the\nrunning of ng-spice for characterization, allowing\nthe user to determine where a circuit is failing\ncharacterization.\n': command not found
../../edatools/cace/cace/cace_gui.py: line 22: import: command not found
../../edatools/cace/cace/cace_gui.py: line 23: import: command not found
../../edatools/cace/cace/cace_gui.py: line 24: import: command not found
../../edatools/cace/cace/cace_gui.py: line 25: import: command not found
../../edatools/cace/cace/cace_gui.py: line 26: import: command not found
../../edatools/cace/cace/cace_gui.py: line 27: import: command not found
../../edatools/cace/cace/cace_gui.py: line 28: import: command not found
../../edatools/cace/cace/cace_gui.py: line 29: import: command not found
../../edatools/cace/cace/cace_gui.py: line 30: import: command not found
../../edatools/cace/cace/cace_gui.py: line 31: import: command not found
../../edatools/cace/cace/cace_gui.py: line 32: import: command not found
../../edatools/cace/cace/cace_gui.py: line 34: import: command not found
../../edatools/cace/cace/cace_gui.py: line 35: from: command not found
../../edatools/cace/cace/cace_gui.py: line 36: from: command not found
../../edatools/cace/cace/cace_gui.py: line 38: from: command not found
../../edatools/cace/cace/cace_gui.py: line 40: from: command not found
../../edatools/cace/cace/cace_gui.py: line 42: from: command not found
../../edatools/cace/cace/cace_gui.py: line 43: from: command not found
../../edatools/cace/cace/cace_gui.py: line 44: from: command not found
../../edatools/cace/cace/cace_gui.py: line 45: from: command not found
../../edatools/cace/cace/cace_gui.py: line 46: from: command not found
../../edatools/cace/cace/cace_gui.py: line 47: from: command not found
../../edatools/cace/cace/cace_gui.py: line 48: from: command not found
../../edatools/cace/cace/cace_gui.py: line 49: from: command not found
../../edatools/cace/cace/cace_gui.py: line 50: from: command not found
../../edatools/cace/cace/cace_gui.py: line 51: from: command not found
../../edatools/cace/cace/cace_gui.py: line 52: from: command not found
../../edatools/cace/cace/cace_gui.py: line 56: from: command not found
../../edatools/cace/cace/cace_gui.py: line 58: syntax error near unexpected token `('
../../edatools/cace/cace/cace_gui.py: line 58: `from .logging import ('
tom@tom:~/repos/projects/sky130_sg_ip$ python3 ../../edatools/cace/cace/cace_gui.py 
Traceback (most recent call last):
  File "/media/tom/Storage/Linux/repos/projects/sky130_sg_ip/../../edatools/cace/cace/cace_gui.py", line 30, in <module>
    import logging
  File "/media/tom/Storage/Linux/repos/edatools/cace/cace/logging/__init__.py", line 22, in <module>
    from .logger import (
  File "/media/tom/Storage/Linux/repos/edatools/cace/cace/logging/logger.py", line 20, in <module>
    import rich.console
  File "/usr/lib/python3/dist-packages/rich/console.py", line 51, in <module>
    from ._log_render import FormatTimeCallable, LogRender
  File "/usr/lib/python3/dist-packages/rich/_log_render.py", line 5, in <module>
    from .text import Text, TextType
  File "/usr/lib/python3/dist-packages/rich/text.py", line 21, in <module>
    from .align import AlignMethod
  File "/usr/lib/python3/dist-packages/rich/align.py", line 10, in <module>
    from .constrain import Constrain
  File "/usr/lib/python3/dist-packages/rich/constrain.py", line 3, in <module>
    from .jupyter import JupyterMixin
  File "/usr/lib/python3/dist-packages/rich/jupyter.py", line 7, in <module>
    from .segment import Segment
  File "/usr/lib/python3/dist-packages/rich/segment.py", line 4, in <module>
    from logging import getLogger
ImportError: cannot import name 'getLogger' from partially initialized module 'logging' (most likely due to a circular import) (/media/tom/Storage/Linux/repos/edatools/cace/cace/logging/__init__.py)
t
cace_gui
is probably broken at the moment; you can ask @Leo Moser (Leo Moser) about its status. However, the specific problem you have is that
cace_gui.py
does not have a shebang ("#!") line at the top telling the OS what interpreter to use. So you will need to run it using
python3 ../../edatools/cace/cace/cace_gui.py
.
t
Oh I tried that too actually Tim which you can see about half way down. It's complaining about getLogger
t
Hopefully Leo can help you there. But again, the GUI is not necessarily operable right now, and the command line interface is necessary until we have stabilized it enough to re-build the GUI around it.
t
I see. Thanks, @tim
l
@Tom That is correct,
cace_gui
was disabled during the refactor and the supported way to run cace is through the command line interface. A simple call to
cace
should be sufficient to start it. What method of installation did you use? The recommended method is to use Nix, as we can define the environment under which CACE runs. You are of course free to install CACE via pip and manage the tools yourself. https://cace.readthedocs.io/en/latest/getting_started/installation_overview.html After installation, you can try this simple example to verify the correct setup: https://github.com/mole99/ota-5t Feel free to join the cace channel here on Slack.
t
Thanks, @Leo Moser. To install it I just cloned the GitHub repo following @Tim Edwards ' instructions on the chipalooza webinar. The only tool I'm running within a container is openlane2 and I'm using docker for that currently
l
You're welcome. It is better to follow the installation instructions in the online documentation, as they are getting updates. After you have cloned the repository, you should install CACE with
python3 -m pip install .
, or you can install CACE directly from PyPI using
python3 -m pip install --upgrade cace
. This will give you a wrapper
cace
that calls
cace_cli.py
. Alright, but Nix is not a container. Nix sets the environment of your program in such a way that it is reproducible across different machines, but the program runs natively. You can also run OpenLane 2 with Nix if you would like to.