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

Initial for layout gui #40

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

zbigos
Copy link
Contributor

@zbigos zbigos commented Mar 25, 2022

This is an initial PR adding GUI for manually laying out cells.

It is currently a work in progress, and this PR is meant for communication and documentation.

requirements: opencv

usage: run with ./multi_tool.py --openram --layout-tool --layout-tool-downscale=4

  • --layout-tool instructs to run the tool
  • --layout-tool-downscale=x will downsample the image (configuration->user_area_[width/height]/x)

Currently this tool does nothing, besides letting user play around with it. Configuration is still lacking, as I am not sure how detailed it should be.

collision_map[ent_name] = True
collision_map[o_name] = True

for ent_name, data in class_ref.layout_info.items():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to use an enum for cell states (good/violating/bad) but I decided to go with assigning the color and checking against it. Macros wouldn't really add much value here (imo) and wouldn't really shrink the code.

layout_state seems to be unused, I decided to axe it's user for now. tldr on it, is that it contains the worst offender of the entire design.

# meaning that this behaves _exactly_ like a method of LayoutTool with two exceptions:
# - you cannot call layout_tool_instance.callback()
# - instead of self. you need to use class_ref.
def callback(class_ref, event,x,y,flags,param):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer to collect.py:238


self.pointerbound = None

# values for the color scheme, these should probably be in config?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much configuration we want here. right now I've stolen the discord theme, but It might make sense to keep it in config file for accessibility sake

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not important for me


logging.info(f"parsed {p.instance_name}, size is {caravel_data}")
instance_name = p.instance_name.replace("wrapped_", "")
self.layout_info[instance_name] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could make sense to have a class for layout instance?

@@ -166,6 +166,7 @@ def __init__(self, args, repo, commit, pos, system_config):
self.lef_filename = os.path.join(self.config['final']['directory'], self.config['final']['lef_filename'])
self.title = self.config['project']['title']
self.instance_name = self.module_name
self.interfaces = []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this obviously isn't right, but I have no clue where openram signals are defined

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in projects.yaml - in the openram_support section

@zbigos zbigos marked this pull request as ready for review March 25, 2022 15:32

self.layout_info = {}
for p in collection.projects + collection.shared_projects:
size = p.get_gds_size()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to cache this

Copy link
Owner

@mattvenn mattvenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the coloured lines drawn between macros?

@@ -166,6 +166,7 @@ def __init__(self, args, repo, commit, pos, system_config):
self.lef_filename = os.path.join(self.config['final']['directory'], self.config['final']['lef_filename'])
self.title = self.config['project']['title']
self.instance_name = self.module_name
self.interfaces = []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in projects.yaml - in the openram_support section


self.pointerbound = None

# values for the color scheme, these should probably be in config?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not important for me

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.

2 participants