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

Support relative directory meta application inside hierarchical constraints #626

Merged
merged 2 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/hammer-vlsi/hammer_vlsi/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,24 @@ def get_toplevel(d: List[Dict[str, Any]]) -> Optional[Dict[str, Any]]:

hier_placement_constraints = {key: list(map(partial(PlacementConstraint.from_masters_and_dict, masters), lst))
for key, lst in combined_raw_placement_dict.items()}
# Iterate over project configs to find which ones contain hierarchical constraints
# For each file that does append its path to the special key in the extracted
# hierarchical constraints section.
hier_constraint_source = "" # type: str
for project_conf in self.project_configs:
if "vlsi.inputs.hierarchical.constraints" in project_conf:
hier_constraint_source = project_conf[hammer_config._CONFIG_PATH_KEY]
pc = project_conf["vlsi.inputs.hierarchical.constraints"] # type: List[Dict]
# Add CONFIG_PATH_KEY to actual project configs for each project config's hierarchical constraint
# keys then update project configs at the end
for md in pc:
md # one entry dict with a list
for m in md.keys():
if hammer_config._CONFIG_PATH_KEY in md[m][-1]:
pass
else:
md[m].append({hammer_config._CONFIG_PATH_KEY: hier_constraint_source})
self.update_project_configs(self.project_configs)
list_of_hier_constraints = self.database.get_setting(
"vlsi.inputs.hierarchical.constraints") # type: List[Dict]
hier_constraints = reduce(add_dicts, list_of_hier_constraints, {})
Expand Down
1 change: 1 addition & 0 deletions src/hammer_config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# https://stackoverflow.com/questions/34461987/python3-importerror-no-module-named-xxxx
from .config_src import *
from .config_src import _CONFIG_PATH_KEY
from .yaml2json import load_yaml