From 613b2cc84c06f193c3e7d02b8157d1cde5b7653d Mon Sep 17 00:00:00 2001 From: alexcere <48130030+alexcere@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:05:06 +0200 Subject: [PATCH] Assign stacks in build spec --- src/liveness/layout_generation.py | 5 +---- src/parser/cfg_block.py | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/liveness/layout_generation.py b/src/liveness/layout_generation.py index 9bf379d0..e82ea658 100644 --- a/src/liveness/layout_generation.py +++ b/src/liveness/layout_generation.py @@ -307,12 +307,9 @@ def _construct_code_from_block(self, block: CFGBlock, input_stacks: Dict[str, Li output_stacks[block_id] = output_stack # We build the corresponding specification - block_json, out_idx, new_tag_idx = block.build_spec(self._tags_dict, self._tags_idx) + block_json, out_idx, new_tag_idx = block.build_spec(self._tags_dict, self._tags_idx, input_stack, output_stack) self._tags_idx = new_tag_idx - block_json["src_ws"] = input_stack - block_json["tgt_ws"] = output_stack - return block_json def _construct_code_from_block_list(self): diff --git a/src/parser/cfg_block.py b/src/parser/cfg_block.py index b4c2fd06..ade83fad 100644 --- a/src/parser/cfg_block.py +++ b/src/parser/cfg_block.py @@ -509,13 +509,16 @@ def _include_jump_tag(self, block_spec: Dict, out_idx: int, block_tags_dict: Dic # return specifications, block_tag_idx - def build_spec(self, block_tags_dict: Dict, block_tag_idx: int) -> Dict[str, Any]: + def build_spec(self, block_tags_dict: Dict, block_tag_idx: int, initial_stack: List[str], + final_stack: List[str]) -> Tuple[Dict[str, Any], int, int]: map_instructions = {} out_idx = 0 spec, out_idx, map_positions = self._build_spec_for_sequence(self._instructions, map_instructions, out_idx) + spec["src_ws"] = initial_stack + spec["tgt_ws"] = final_stack sto_deps, mem_deps = self._process_dependences(self._instructions, map_positions) spec["storage_dependences"] = sto_deps