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

Save different instances of subcircuits separately #74

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented Feb 6, 2022

while keeping the format backward compatible.

Although different instances of subcircuits starts identical,
they corresponds to distinct runtime object and their internal
may deviate from each other due to edits done on each subcircuits.

The current format discard all the changes except for the first subcircuit
and apply the edit on the first subcircuit to all instances during loading.

This change modifies the saving format while keeping the file backward compatible
so that the new file can still be opened by old code, with only minor display differences.
This is done by automatically generate new celltype for each instances of the subcircuit
on saving and saving the old value that is only useful for display in a separate attribute
disp_celltype. This automatic name generation is also only done when there are
multiple instances of the same cell type so that we can keep generating names shorter
and the file as closed to the old format as possible.

Make this a draft currently since there are a few things that can are up to debate.

  1. If backward compatibility should be maintained. Personally I think it should be as much as possible. If backward compatibility is not to be maintained, this info can simply be saved into the devices and/or a diff version could be computed to save space, though I really don't think that's really necessary....

  2. If I should try harder to not clone the subcircuits.

    This can be done either by saving a flag marking whether anything has changed since the loading, or to simply detect if the resulting object matches (or both). The marker could potentially be separate for layout vs not, and it'll almost certainly have false positives due to no-op/reverted changes. It's much more difficult to track changes accurately and it doesn't save any saving time to detect the differences after serialization so I'm not doing either right now....

…format backward compatible

Although different instances of subcircuits starts identical,
they corresponds to distinct runtime object and their internal
may deviate from each other due to edits done on each subcircuits.

The current format disgard all the changes except for the first subcircuit
and apply the edit on the first subcircuit to all instances during loading.

This change modifies the saving format while keeping the file backward compatible
so that the new file can still be openned by old code, with only minor display differences.
This is done by automatically generate new celltype for each instances of the subcircuit
on saving and saving the old value that is only useful for display in a separate attribute
`disp_celltype`. This automatic name generation is also only done when there are
multiple instances of the same cell type so that we can keep generating names shorter
and the file as closed to the old format as possible.
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

Successfully merging this pull request may close these issues.

None yet

1 participant