From 38a9e7bd8444bf8d79525f47641f99f9d995280e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 24 Apr 2024 16:09:46 +0200 Subject: [PATCH] DO NOT MERGE purge memory targets, now built into ORFS --- .github/scripts/build_local_target.sh | 2 +- README.md | 13 ---------- memory-bazel.mk | 7 ------ openroad.bzl | 35 +-------------------------- scripts/mem_dump.py | 35 --------------------------- scripts/mem_dump.tcl | 10 -------- 6 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 memory-bazel.mk delete mode 100644 scripts/mem_dump.py delete mode 100644 scripts/mem_dump.tcl diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index 9fd6f3ce..17836be6 100755 --- a/.github/scripts/build_local_target.sh +++ b/.github/scripts/build_local_target.sh @@ -7,7 +7,7 @@ if [[ -z "$STAGES" ]]; then if [[ "$target_name" == L1MetadataArray_* ]]; then STAGES=("synth_sdc" "synth" "floorplan" "place" "cts" "grt" "generate_abstract") else - STAGES=("synth_sdc" "synth" "memory" "floorplan" "generate_abstract") + STAGES=("synth_sdc" "synth" "floorplan" "generate_abstract") fi else eval "STAGES=($STAGES)" diff --git a/README.md b/README.md index 04c95964..5ba0c973 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,6 @@ Stage targets: //:L1MetadataArray_test_grt //:L1MetadataArray_test_generate_abstract -Memory targets: - //:L1MetadataArray_test_memory - Make targets: //:L1MetadataArray_test_clock_period_make //:L1MetadataArray_test_clock_period_make_script @@ -103,8 +100,6 @@ Make targets: //:L1MetadataArray_test_grt_make_script //:L1MetadataArray_test_generate_abstract_make //:L1MetadataArray_test_generate_abstract_make_script - //:L1MetadataArray_test_memory_make - //:L1MetadataArray_test_memory_make_script Config generation targets: @@ -129,8 +124,6 @@ Config generation targets: //:L1MetadataArray_test_grt_config.mk //:L1MetadataArray_test_generate_abstract_config //:L1MetadataArray_test_generate_abstract_config.mk - //:L1MetadataArray_test_memory_config - //:L1MetadataArray_test_memory_config.mk ``` The example comes from the `BUILD` file in this repository. @@ -149,7 +142,6 @@ These are the genrules spawend in this macro: * Common for the whole design (named: `target_name + “_config”`) * ORFS stage-specific config (named: `target_name + “_” + stage + “_config”`) * Stage targets (named: `target_name + “_” + stage`) - * Special stage: Memory targets (named: `target_name + “_memory”`) * Special mock flow: Mock Area targets (named: `target_name + “_” + stage + “_mock_area”`) * Make targets (named: `target_name + “_” + stage + “_make”`) @@ -165,7 +157,6 @@ Docker flow uses containerized environment with preinstalled ORFS to run the phy Example targets which run the docker flow include: * //:L1MetadataArray_test_floorplan -* //:L1MetadataArray_test_memory * //:tag_array_64x184_synth It implicitly depends on a docker image with installed ORFS environment being present in docker runtime of the machine running bazel targets. @@ -241,10 +232,6 @@ At the same time the mock has the same pinout as the original macro and similar Mocked abstracts are generated after the `floorplan` stage to be then used in builds of other parts of the design that use given macro. Used for estimating sizes of macros with long build times and checking if they will fit in upper-level modules without running time consuming place and route flow. -#### Memory Targets - -These targets print RAM summaries for a given module. - ### Constraints handling Constraint files are passed down to `build_openroad()` macro through attributes: diff --git a/memory-bazel.mk b/memory-bazel.mk deleted file mode 100644 index 80e162c2..00000000 --- a/memory-bazel.mk +++ /dev/null @@ -1,7 +0,0 @@ -.PHONY: memory -memory: $(RESULTS_DIR)/mem.json - python3 $(BUILD_DIR)/scripts/mem_dump.py $(RESULTS_DIR)/mem.json - -$(RESULTS_DIR)/mem.json: yosys-dependencies - mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) - $(TIME_CMD) $(YOSYS_CMD) $(YOSYS_FLAGS) -c $(BUILD_DIR)/scripts/mem_dump.tcl 2>&1 | tee $(LOG_DIR)/1_0_mem.log diff --git a/openroad.bzl b/openroad.bzl index 1cf65475..e39eda85 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -457,8 +457,7 @@ def init_output_dict(all_stages, platform, out_dir, variant, name): "results/%s/%s/%s/6_final.gds" % (platform, out_dir, variant), ], "grt": ["reports/%s/%s/%s/congestion.rpt" % (platform, out_dir, variant)], - "route": ["reports/%s/%s/%s/5_route_drc.rpt" % (platform, out_dir, variant)], - "memory": ["results/%s/%s/%s/mem.json" % (platform, out_dir, variant)], + "route": ["reports/%s/%s/%s/5_route_drc.rpt" % (platform, out_dir, variant)] } stage_num = dict(map(lambda s: (s[1], s[0]), all_stages)) @@ -666,38 +665,6 @@ def build_openroad( if mock_area != None: mock_area_stages(target_name, name, stage_sources, io_constraints, sdc_constraints, stage_args, outs, variant, mock_area, docker_image) - # *_memory targets - write_stage_config( - name = target_name + "_memory_config", - stage = "memory", - srcs = [], - stage_args = stage_args["synth"], - ) - make_pattern = Label("//:memory-bazel.mk") - stage_config = Label("@@//:" + target_name + "_memory_config.mk") - entrypoint_cmd = get_entrypoint_cmd(make_pattern, design_config, stage_config, False) - native.genrule( - name = target_name + "_memory_make_script", - tools = [Label("//:orfs")], - srcs = [make_script_template, design_config, stage_config, make_pattern], - cmd = "cat < $@ \n`cat $(location " + str(make_script_template) + ")`\n" + entrypoint_cmd + " \\$$@", - outs = ["logs/%s/%s/%s/make_script_memory.sh" % (platform, out_dir, variant)], - ) - native.sh_binary( - name = target_name + "_memory_make", - srcs = ["//:" + target_name + "_memory_make_script"], - data = [Label("//:orfs"), design_config, stage_config, make_pattern], - deps = ["@bazel_tools//tools/bash/runfiles"], - ) - native.genrule( - name = target_name + "_memory", - tools = [Label("//:docker_shell")], - srcs = [Label("//:scripts/mem_dump.py"), Label("//:scripts/mem_dump.tcl"), target_name + "_clock_period", design_config, stage_config, make_pattern], - cmd = get_entrypoint_cmd(make_pattern, design_config, stage_config, True, "memory", docker_image = docker_image), - outs = outs["memory"], - tags = ["supports-graceful-termination"], - ) - # Stage (Docker) targets for (previous, stage) in zip(["n/a"] + stages, stages): # Generate config for stage targets diff --git a/scripts/mem_dump.py b/scripts/mem_dump.py deleted file mode 100644 index d09423be..00000000 --- a/scripts/mem_dump.py +++ /dev/null @@ -1,35 +0,0 @@ -import json -import os -import sys - - -def format_ram_table_from_json(data): - formatting = "{:<50} | {:<15} | {:<15} | {:<15}\n" - table = formatting.format("Name", - "Rows", - "Width", - "Total bits") - table += "-"*len(table) + "\n" - for module_name, module_info in data["modules"].items(): - cells = module_info["cells"] - for memory in cells: - parameters = cells[memory]["parameters"] - size = int(parameters["SIZE"], 2) - width = int(parameters["WIDTH"], 2) - table += formatting.format(module_name + "." + memory, - size, - width, - size * width) - return table - - -if __name__ == "__main__": - if len(sys.argv) != 2: - print("Usage: python " + os.path.basename(sys.argv[0]) + - " file.json") - exit(1) - - with open(sys.argv[1], 'r') as file: - json_data = json.load(file) - formatted_table = format_ram_table_from_json(json_data) - print(formatted_table) diff --git a/scripts/mem_dump.tcl b/scripts/mem_dump.tcl deleted file mode 100644 index 341f1cb9..00000000 --- a/scripts/mem_dump.tcl +++ /dev/null @@ -1,10 +0,0 @@ -source $::env(SCRIPTS_DIR)/synth_preamble.tcl - -prep -top $::env(DESIGN_NAME) -memory_unpack - -memory -nomap - -select t:\$mem* - -json -o $::env(RESULTS_DIR)/mem.json