Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Improve Consistent/Deterministic refdeses #4

Open
amstan opened this issue Apr 13, 2019 · 3 comments
Open

Improve Consistent/Deterministic refdeses #4

amstan opened this issue Apr 13, 2019 · 3 comments
Labels
feature request New feature, request or enhancement help wanted Extra attention is needed

Comments

@amstan
Copy link
Contributor

amstan commented Apr 13, 2019

I don't really want people to have to worry about refdeses inside the code. Part initializations should not be littered with refdes="Uwhatever".

Right now Context.autoname, beyond numbering parts automatically, also remembers what things were named (via the .refdes_mapping files). But it's hard to track parts via just the code, since there's nothing anchoring part instances across different runs to the place where they're defined.

Some traditional EDAs solve this problem by having an UUID for each part (which stays for the life of it, inside the source file), then layout tools don't even care if the refdeses change, as long as the UUID didn't. We don't have that luxury, unless we want things like R("100k", uuid="d4c1d842-705b-456d-9ee1-585463c11db2") everywhere.

The current implementation of Context.autoname uses the nearby lines contents around every part initialization to track a part. The problem with this is that a simple change to something maybe unrelated, or a simple change to the value of a part, causes the part's refdes to "pop" and get forgotten.

We need to track a few more things beyond just lines of code.

"Design doc"
https://github.com/google/pcbdl/wiki/Consistent-refdeses

@amstan amstan added feature request New feature, request or enhancement help wanted Extra attention is needed labels Apr 13, 2019
@amstan amstan added the jim Stuff that we need working for Jim label Mar 25, 2020
@amstan
Copy link
Contributor Author

amstan commented Mar 25, 2020

The current implementation is still pretty unusable.
The extensive changes to the source code in c718fbc and issue #19 both show big weaknesses.

@amstan
Copy link
Contributor Author

amstan commented Apr 12, 2020

amstan added a commit that referenced this issue Apr 12, 2020
BUG=Issue #4, Issue #19
TEST=git checkout c718fbc~1 examples/servo_micro.py
Refdeses should stay the same
amstan added a commit that referenced this issue Apr 12, 2020
BUG=Issue #4, Issue #19
TEST=git checkout c718fbc~1 examples/servo_micro.py
Refdeses should stay the same
amstan added a commit that referenced this issue Apr 12, 2020
Replaced the old name_part_with_mapping code with a fancier implementation.

Now it saves more info about each part in the .refdes_mapping file, each column is called an anchor. Now we also
keep track of net names, variable names, values, etc. We're resilient to changes in a variety of anchors now.

Fixed Issue #19, the naming loop had to be done in 2 passes.

BUG=Issue #4
TEST=git checkout c718fbc~1 examples/servo_micro.py
Refdeses should stay the same
TEST=Move stuff around in servo_micro.py, change things/connections.
Refdeses should stay the same
@amstan
Copy link
Contributor Author

amstan commented Apr 12, 2020

So this got a lot better. There's still room for:

  • Locally sensitive hashing for the code and nets
  • Weisfeiler-Lehman Machine

@amstan amstan removed the jim Stuff that we need working for Jim label Apr 12, 2020
@amstan amstan changed the title Consistent/Deterministic refdeses Improve Consistent/Deterministic refdeses Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature, request or enhancement help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant