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

vcs sim flow doesn't include -e configs in dict #587

Open
growly opened this issue Jul 19, 2020 · 1 comment
Open

vcs sim flow doesn't include -e configs in dict #587

growly opened this issue Jul 19, 2020 · 1 comment
Labels
bug low priority Easy workaround exists, regular QoL issue usability

Comments

@growly
Copy link
Contributor

growly commented Jul 19, 2020

In a clean environment, if I try to run simulation with this make command:

$(HAMMER_EXEC) sim -e $(ENV_YML) $(foreach x,$(INPUT_CONFS) , -p $(x)) -p sim_config.yml -p $(src_dir)/rtl_sim_config.lut.yml --obj_dir $(OBJ_DIR)

VCS runs (!), and then the flow quits with this trace:

  File "./inst-vlsi.py", line 46, in <module>
    InstDriver().main()
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer-vlsi/hammer_vlsi/cli_driver.py", line 1264, in main
    sys.exit(self.run_main_parsed(vars(parser.parse_args(args))))
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer-vlsi/hammer_vlsi/cli_driver.py", line 1171, in run_main_parsed
    output_config = action_func(driver, errors.append)  # type: Optional[dict]
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer-vlsi/hammer_vlsi/cli_driver.py", line 528, in action
    self.get_full_config(driver, output))
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer-vlsi/hammer_vlsi/cli_driver.py", line 339, in get_full_config
    output_full = deepdict(driver.project_config)
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer-vlsi/hammer_vlsi/driver.py", line 125, in project_config
    return hammer_config.combine_configs(self.project_configs)
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 933, in combine_configs
    final_dict = reduce(combine_meta, settings_ordered, expanded_config)  # type: dict
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 930, in combine_meta
    meta_setting + "_meta": lazy_metas[meta_setting + "_meta"]
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 648, in update_and_expand_meta
    MetaDirectiveParams(meta_path=meta_dict.get(_CONFIG_PATH_KEY, "unspecified")))
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 244, in subst_action
    config_dict[key] = perform_subst(value)
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 241, in perform_subst
    newval = subst_str(value, lambda key: config_dict[key])
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 224, in subst_str
    return re.sub(__VARIABLE_EXPANSION_REGEX, lambda x: replacement_func(x.group(1)), input_str)
  File "/usr/lib64/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 224, in <lambda>
    return re.sub(__VARIABLE_EXPANSION_REGEX, lambda x: replacement_func(x.group(1)), input_str)
  File "/tools/projects/aryap/hammer-test/hammer/src/hammer_config/config_src.py", line 241, in <lambda>
    newval = subst_str(value, lambda key: config_dict[key])
KeyError: 'synopsys.vcs_home'

I printed the entire config_dict at the source of the error and the key is indeed missing, but it is defined in the $(ENV_YML) file and that must work since VCS itself runs first.

Changing the inclusion of $(ENV_YML) from with the -e switch to the -p switch makes the problem go away.

It seems that for this code path, the two config dicts are not merged, but they should be?

@colinschmidt colinschmidt added bug low priority Easy workaround exists, regular QoL issue usability labels Oct 6, 2020
@colinschmidt
Copy link
Contributor

Maybe this has to do with the fact that VCS is invoked twice (once to generate the executable and once to run it).
This sounds like a real bug that will need to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug low priority Easy workaround exists, regular QoL issue usability
Projects
None yet
Development

No branches or pull requests

2 participants