Leo and I have made a number of upgrades to the CA...
# chipalooza
t
Leo and I have made a number of upgrades to the CACE system, and it is now registered on PiPI; the download and install instructions have been reduced to
Copy code
python3 -m pip install --upgrade cace
and to launch CACE, after installing per the instruction above, just do
Copy code
cace-gui
from the Linux command line. I also made a number of critical bug fixes today. Most notably, I figured out how to prevent ngspice from dropping back into the interpreter after hitting an error, which causes the ngspice process to stall but not exit and leaves the entire CACE system in a hung state. I suggest for anyone who has cloned the version from yesterday or before to remove that version and run the pip install command as shown above.
šŸ‘ 2
c
Welll …
Copy code
~/EDA/cace$ cace-gui 
Traceback (most recent call last):
  File "/home/cmaier/.local/bin/cace-gui", line 5, in <module>
    from cace.cace_gui import gui
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/cace_gui.py", line 56, in <module>
    from .gui.failreport import FailReport
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/gui/failreport.py", line 21, in <module>
    from ..common.cace_makeplot import *
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/common/cace_makeplot.py", line 18, in <module>
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
  File "/home/cmaier/.local/lib/python3.8/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in <module>
    from . import _backend_tk
  File "/home/cmaier/.local/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 15, in <module>
    from PIL import Image, ImageTk
ImportError: cannot import name 'ImageTk' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
So far, I have compiled magic, xschem, netgen, and ngspice, but haven't updated the sky130 process and haven't copied or written configuration files.
l
I have uploaded a new version of cace to PyPI. Can you test whether this fixes the issue?
python3 -m pip install --upgrade cace
c
It doesn't fix the issue that ImageTk is not explicitly documented anywhere an analog designer can easily find it. [https://medium.com/@codingpilot25/explicit-is-better-than-implicit-embracing-the-zen-of-python-498e2aa745b9] I can try out whether your patch works, though. (Where is ImageTk explicitly documented [if at all], anyhow?) If I cannot find the documentation of the patch in the source code of my downloaded repository, the correct solution is to design the analog circuit to avoid the necessity of using the CACE tool as much as possible. But first: Suppose I have found the cause of a whole series of compilation errors in ngspice 42 (the current main) with @Tim Edwards's recommended config settings, and I know whom to blame. How do I push back the error message:
Copy code
You are building a tool for analog designers with a software "engineer"'s minsdet of deliberately tangled hierarchies.
Throw out all the intermediate layers!!!
In the meantime, here's a fix that makes the make errors go away.
to the nonstandard ngspice repository and blame the guy whodunit in person?
@Leo Moser, any patch not documented in the source code, but hidden behind an automatic package installer is far less than useless, because it introduces hidden dependencies that get patched over instead of fixed, adding even more undocumented hidden dependencies. I'd rather design the analog building block separated from mine all by myself, than going through a software API where the answer "here's an abstraction layer to hide the root cause of your problem" is considered socially acceptable. Personal observation: If you foresee Software Engineer's attitude to be by far the biggest threat to the reliability of the shuttle, you should strategically pick "your own" building block for the minimum of something like an equivalent of the Erdős number: minimize the number of CACE-ish formal specifications between "your own" building block and any other in the design. If there is more than one CACE-ish formal specification between your building block and the others, don't just add up the CACE interfaces, but add the factorial of the number of formal CACE specifications to the shuttle unreliability figure, and have an excuse to do analog designs of any and all building blocks separated by an irredeemably unreliable CACE-ish API by yourself, as "test structures". Question to Mr Potbox: Now, if you conservatively choose only one, because the additional workload introduced "helpful" abstraction and documentation layers is completely unpredicable and tends to explode, which building block would you pick, given that unreliability metric? My brain is open …
The dependency f$ckup is at least consistent between cace-gui and cace.
Copy code
~/EDA/cace$ cace
Traceback (most recent call last):
  File "/home/cmaier/.local/bin/cace", line 5, in <module>
    from cace.cace_cli import cli
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/cace_cli.py", line 31, in <module>
    from .common.cace_makeplot import *
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/common/cace_makeplot.py", line 18, in <module>
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
  File "/home/cmaier/.local/lib/python3.8/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in <module>
    from . import _backend_tk
  File "/home/cmaier/.local/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 15, in <module>
    from PIL import Image, ImageTk
ImportError: cannot import name 'ImageTk' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
t
@Christoph Maier: Problem and solution are (I think) here: https://stackoverflow.com/questions/48317606/importerror-cannot-import-name-imagetk (
sudo apt install python3-pil.imagetk
). I was unaware of this as a requirement and can add it to the required package installs in my instructions. Like any piece of software that has a history of running only on one system, as soon as it is publicized and the user base expands, a slew of incompatibilities immediately crops up and has to be patched up. All part of the open source process.
l
This should not be necessary. CACE has pillow>=10.1.0 as a requirement, which contains ImageTk. @Christoph Maier Could you try to update CACE again? There have been some updates on the dependencies:
python3 -m pip install --upgrade cace
If that does not work, could you give us some information about your system and which Python version you are running? Thanks.
c
@Leo Moser, I need the necessary dependencies and updates in source code, not in a black box. Will try to build according to @Tim Edwards's instructions.
pip3 install -r requirements.txt 1>../installationlogs/cace_install_requirements.log 2>../installationlogs/cace_install_requirements.err
.log
Copy code
Defaulting to user installation because normal site-packages is not writeable
.err
Copy code
ERROR: Ignored the following versions that require a different python version: 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9; 3.8.3 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement matplotlib>=3.8.3 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4.0rc1, 3.4.0rc2, 3.4.0rc3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.0b1, 3.5.0rc1, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.6.0rc1, 3.6.0rc2, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.7.0rc1, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5)
ERROR: No matching distribution found for matplotlib>=3.8.3
Copy code
lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal
Copy code
python3 --version
Python 3.8.10
What is the core functionality of CACE that requires python ≄3.9? No, sloppiness of software suits is not a valid requirement.
l
@Christoph Maier Please update your version of CACE, as already said the dependencies were updated to work with Python 3.8.
c
Okay … but how do I get the source code?
l
The source code is here: https://github.com/efabless/cace The recommended installation method is via:
python3 -m pip install --upgrade cace
t
If you're interested in being able to run cace while messing around with the source code at the same time (this is something I've learned only in the last couple of days), you can do
git clone <https://github.com/efabless/cace>
to get the source code locally, then
cd cace
and do
make editable
(which runs
pip3 install -e .
). Then,
cace
runs code from the cloned directory, and changes you make there are reflected immediately in the operation of the tool. That sounds like what you're trying to achieve. That's how I run (as a developer) so that if something goes wrong I can dive in and fix it.
c
@Leo Moser, thanks,
python3 -m pip install --upgrade cace
#worksforme @Tim Edwards, once I get xschem, magic, ngspice, and netgen working, I'm going to focus on building (bottom-up, from layout) my assigned building block. Chokepoints, so far: 1. update of unvirtualized sky130 PDK 2. adapt the configuration files to my native installation Then, I'll probably just design, at least on schematic level, most if not all of the building blocks that interface to mine as "test structures", to avoid CACE-ish stuff for now. THEN, I want to use CACE, and for that, I want to be able to mess with the source. As I want to keep it out of any critical path of mine, the black box pip3 install version will do if needs be.
šŸ‘ 1
t
This should be sufficient to build the sky130 PDK from the cloned source (https://github.com/RTimothyEdwards/open_pdks) and install into
/usr/local/share/pdk
Copy code
./configure --enable-sky130-pdk
make
sudo make install
The build can take a while. You may want to disable most of the standard cell libraries, since you most likely won't be using them (maybe keep HD for 1.8V digital and HVL for 3.3V digital):
Copy code
./configure --enable-sky130-pdk --disable-sc-hs-sky130 --disable-sc-ms-sky130 --disable-sc-ls-sky130 --disable-sc-lp-sky130 --disable-sc-hdll-sky130
Finally, if you add the option
Copy code
--with-sky130-variants=A
it will only compile sky130A and not sky130B, which cuts the build time in half.
l
@Christoph Maier Note that you can build the package via
make build
and install it in editable mode via
make editable
. Any changes that you do in the src files are then directly applied without the need to reinstall the package. You may need to uninstall the currently installed package from PyPI then.
c
Having a problem running
~/EDA/efabless/chipalooza2024/sky130_od_ip__tempsensor/cace$ cace -keep -debug -summary sky130_od_ip__tempsensor.txt sky130_od_ip__tempsensor.out 1>~/EDA/installationlogs/sky130_od_ip__tempsensor.cace.log 2>~/EDA/installationlogs/sky130_od_ip__tempsensor.cace.err
sky130_od_ip__tempsensor.cace.err
Copy code
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (2.2.1) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "/home/cmaier/.local/bin/cace", line 8, in <module>
    sys.exit(cli())
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/cace_cli.py", line 691, in cli
    charresult = cace_run(dataset, paramname)
  File "/home/cmaier/.local/lib/python3.8/site-packages/cace/cace_cli.py", line 500, in cace_run
    idx1 = poolresult[1][0]
IndexError: list index out of range
Are later versions of
urllib3
and
chardet
mission critical for analog circuit characterization or can the dependencies be made more tolerant to older versions, or, much better yet, eliminated completely? (
cace-gui
works)
t
Don't look too far upward in a python error result. The "list index out of range" from cace_run line 500 is the actual error. And probably a real one. But why are you testing with another Chipalooza participant's work-in-progress? I cannot vouch for what state it's in.
FYI, it is an actual error; the multithreading code is expecting both "electrical-parameters" and "physical-parameters" sections to be in the characterization file, which might not be the case (and apparently isn't, in this example). For the moment, you can work around the issue by turning off multithreading in the Settings.
c
@Tim Edwards, I'm testing with another Chipalooza participant's work-in-progress, because 1. it #worksforme as-is 2. it's not a carefully chosen example by one of the developers who makes all sorts of implicit assumptions about the installed tools at his disposal, that —having a software engineer's mindset— he cherishes his ignorance of.
t
I think clicking on "Simulate" instead of "Simulate All" is also a workaround. I just wrote a patch for the error and am about to push it.
Yes, I cherish my implicit assumptions. : )
c
cace-gui
works just fine. The commandline version
cace
doesn't.
t
Okay, not enough testing of of the command line version. Got it.
c
Well, the amount of value you get for three dozen t-shirts and some four-figure $$$ (i.e., next to nothing) investment for testing and debugging your tool chain by a lot of junior designers, in exchange for "visibility", is downright spectacular.
t
If you know the scene from Mark Twain's Tom Sawyer in which Tom tricks his friends into doing the chore of painting a fence for him. . . The benefit I get out of this is not lost on me.
c
I don't know that scene, in particular since it's no longer tolerable to mention the Ni....! word in polite company —and consequently, Mark Twain's works are on the index of verboten books— just to treat others as such, irrespective of race, gender, or whatever. You started out with Gert and you've tried to get working analog IC design tools forever, i.e. decades before someone came up with a Business Plan for efabless, so it's not too much of a stretch that you're one of those folks who I am looking for with a lantern in broad daylight. (This example of esprit d'escalier is to honor the 3⁓th birthday of an apparently Honest Person, brought to you by the elements 6, 7, and 23.)