From 9dd06cd92a4557eef0f68be9eee2062f394dc251 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Sun, 31 Jul 2022 13:55:02 +0200 Subject: [PATCH 01/20] ci: test F4PGA eos-s3 flow Signed-off-by: Unai Martinez-Corral --- .github/workflows/Pipeline.yml | 33 +++++++++++---------------------- .github/xc7_test.json | 2 +- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 9e7cd64..97fd63c 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -115,26 +115,15 @@ jobs: if: matrix.flow == 'F4PGA' run: | . ./.github/scripts/activate.sh - cd f4pga-examples + f4pga build --flow ../.github/${{ matrix.fam }}_test.json - # FIXME - # Temporarily allow QL example to fail, until https://github.com/chipsalliance/f4pga/pull/577 is merged. - case '${{ matrix.fam }}' in - eos-s3) - f4pga build --flow ../.github/${{ matrix.fam }}_test.json | echo 'See #577' - ;; - *) - f4pga build --flow ../.github/${{ matrix.fam }}_test.json - ;; - esac - - - name: '📤 Upload artifact: Arty 35 bitstream' - if: matrix.flow == 'F4PGA' && matrix.fam == 'xc7' + - name: '📤 Upload artifact: ${{ matrix.fam }} bitstream' + if: matrix.flow == 'F4PGA' uses: actions/upload-artifact@v3 with: - name: ${{ matrix.flow }}-arty_35-Bitstream-pyF4PGA - path: f4pga-examples/build/arty_35/top.bit + name: ${{ matrix.flow }}-${{ matrix.fam }}-Bitstream + path: f4pga-examples/build/${{ matrix.fam }}/top.bit if-no-files-found: error # SymbiFlow @@ -163,19 +152,19 @@ jobs: esac - name: '📤 Upload artifact: Arty 35 bitstream' - if: matrix.flow == 'SymbiFLow' && matrix.fam == 'xc7' + if: matrix.flow == 'SymbiFlow' && matrix.fam == 'xc7' uses: actions/upload-artifact@v3 with: - name: ${{ matrix.flow }}-arty_35-Bitstream - path: f4pga-examples/xc7/counter_test/build/arty_35/top.bit + name: ${{ matrix.flow }}-${{ matrix.fam }}-Bitstream + path: f4pga-examples/${{ matrix.fam }}/counter_test/build/arty_35/top.bit if-no-files-found: error - name: '📤 Upload artifact: QuickLogic bitstream' - if: matrix.flow == 'SymbiFLow' && matrix.fam == 'eos-s3' + if: matrix.flow == 'SymbiFlow' && matrix.fam == 'eos-s3' uses: actions/upload-artifact@v3 with: - name: ${{ matrix.flow }}-eos-s3-Bitstream - path: f4pga-examples/eos-s3/btn_counter/build/top.bit + name: ${{ matrix.flow }}-${{ matrix.fam }}-Bitstream + path: f4pga-examples/${{ matrix.fam }}/btn_counter/build/top.bit if-no-files-found: error diff --git a/.github/xc7_test.json b/.github/xc7_test.json index e1bf212..5d0fa4b 100644 --- a/.github/xc7_test.json +++ b/.github/xc7_test.json @@ -13,7 +13,7 @@ "XC7A35TCSG324-1": { "default_target": "bitstream", "dependencies": { - "build_dir": "build/arty_35", + "build_dir": "build/xc7", "xdc": [ "xc7/counter_test/arty.xdc" ] From c6dce07e5b0c0bf856ee1753853eb2c4682226d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Wed, 15 Jun 2022 16:08:57 +0200 Subject: [PATCH 02/20] CI: eos-s3: introduce F4PGA test flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- .github/eos-s3_test.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/eos-s3_test.json b/.github/eos-s3_test.json index 0967ef4..9960475 100644 --- a/.github/eos-s3_test.json +++ b/.github/eos-s3_test.json @@ -1 +1,25 @@ -{} +{ + "default_part": "EOS3FF512-PDN64", + "values": { + "top": "top" + }, + "dependencies": { + "sources": [ + "eos-s3/btn_counter/btn_counter.v" + ], + "synth_log": "synth.log", + "pack_log": "pack.log" + }, + "EOS3FF512-PDN64": { + "default_target": "bitstream", + "dependencies": { + "build_dir": "build/eos-s3", + "pcf": "eos-s3/btn_counter/chandalar.pcf", + "sdc-in": "eos-s3/btn_counter/dummy.sdc" + }, + "values": { + "part": "ql-eos-s3", + "package": "PD64" + } + } +} From 2bb2ae2037b36fad54fd7fa194e27122afcceddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 14 Jun 2022 17:00:26 +0200 Subject: [PATCH 03/20] init: set share_dir_path according to FPGA_FAM env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/f4pga/__init__.py b/f4pga/__init__.py index 49eb36c..4bfeca3 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -74,14 +74,13 @@ install_dir = environ.get("F4PGA_INSTALL_DIR", "/usr/local") mypath = str(Path(__file__).resolve().parent) +FPGA_FAM = environ.get('FPGA_FAM', 'xc7') bin_dir_path = \ environ.get('F4PGA_BIN_DIR', str(Path(sys_argv[0]).resolve().parent.parent)) share_dir_path = \ environ.get('F4PGA_SHARE_DIR', - str(Path(f'{install_dir}/xc7/install/share/f4pga').resolve())) -if share_dir_path is None: - share_dir_path = str(Path(f'{install_dir}/xc7/install/share/f4pga').resolve()) + str(Path(f'{install_dir}/{FPGA_FAM}/install/share/f4pga').resolve())) class DependencyNotProducedException(F4PGAException): dep_name: str From 7b7fa8ae3c8f79dd834ba22d955bc5591a88936d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 14 Jun 2022 17:01:44 +0200 Subject: [PATCH 04/20] init: disable prjxray requirement in common code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/f4pga/__init__.py b/f4pga/__init__.py index 4bfeca3..ee26f47 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -531,11 +531,14 @@ def setup_resolution_env(): """ Generate initial values, available in configs. """ - return { - 'prjxray_db': common_sub('prjxray-config').decode().replace('\n', ''), + conf = { 'python3': common_sub('which', 'python3').decode().replace('\n', ''), 'noisyWarnings': _noisy_warnings() } + if (FPGA_FAM == 'xc7'): + conf['prjxray_db'] = common_sub('prjxray-config').decode().replace('\n', '') + + return conf r_env.add_values(_generate_values()) return r_env From e4f0639f8d2e68ee11f948ececdbd85f7d0071d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 14 Jun 2022 16:55:39 +0200 Subject: [PATCH 05/20] modules: synth: use UTILS_PATH env var for split_inouts.py path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/common_modules/synth.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/f4pga/common_modules/synth.py b/f4pga/common_modules/synth.py index b3d1943..9069fcf 100755 --- a/f4pga/common_modules/synth.py +++ b/f4pga/common_modules/synth.py @@ -97,12 +97,11 @@ class SynthModule(Module): return mapping def execute(self, ctx: ModuleContext): - split_inouts = os.path.join(ctx.share, 'scripts/split_inouts.py') - synth_tcl = os.path.join(ctx.values.tcl_scripts, 'synth.tcl') - conv_tcl = os.path.join(ctx.values.tcl_scripts, 'conv.tcl') - tcl_env = yosys_setup_tcl_env(ctx.values.yosys_tcl_env) \ if ctx.values.yosys_tcl_env else {} + split_inouts = os.path.join(tcl_env["UTILS_PATH"], 'split_inouts.py') + synth_tcl = os.path.join(ctx.values.tcl_scripts, 'synth.tcl') + conv_tcl = os.path.join(ctx.values.tcl_scripts, 'conv.tcl') if get_verbosity_level() >= 2: yield f'Synthesizing sources: {ctx.takes.sources}...' From ab4b7a6c61a91841bc9b6ab623c898ac816b39d4 Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Mon, 11 Jul 2022 09:27:27 +0200 Subject: [PATCH 06/20] modules: synth: use pathlib Signed-off-by: Pawel Czarnecki --- f4pga/common_modules/synth.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/f4pga/common_modules/synth.py b/f4pga/common_modules/synth.py index 9069fcf..0c44995 100755 --- a/f4pga/common_modules/synth.py +++ b/f4pga/common_modules/synth.py @@ -18,6 +18,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +from pathlib import Path from f4pga.common import * from f4pga.module import Module, ModuleContext @@ -99,20 +100,20 @@ class SynthModule(Module): def execute(self, ctx: ModuleContext): tcl_env = yosys_setup_tcl_env(ctx.values.yosys_tcl_env) \ if ctx.values.yosys_tcl_env else {} - split_inouts = os.path.join(tcl_env["UTILS_PATH"], 'split_inouts.py') - synth_tcl = os.path.join(ctx.values.tcl_scripts, 'synth.tcl') - conv_tcl = os.path.join(ctx.values.tcl_scripts, 'conv.tcl') + split_inouts = Path(tcl_env["UTILS_PATH"]) / 'split_inouts.py' + synth_tcl = Path(ctx.values.tcl_scripts) / 'synth.tcl' + conv_tcl = Path(ctx.values.tcl_scripts) / 'conv.tcl' if get_verbosity_level() >= 2: yield f'Synthesizing sources: {ctx.takes.sources}...' else: yield f'Synthesizing sources...' - yosys_synth(synth_tcl, tcl_env, ctx.takes.sources, + yosys_synth(str(synth_tcl), tcl_env, ctx.takes.sources, ctx.values.read_verilog_args, ctx.outputs.synth_log) yield f'Splitting in/outs...' - sub('python3', split_inouts, '-i', ctx.outputs.json, '-o', + sub('python3', str(split_inouts), '-i', ctx.outputs.json, '-o', ctx.outputs.synth_json) if not os.path.isfile(ctx.produces.fasm_extra): @@ -120,7 +121,7 @@ class SynthModule(Module): f.write('') yield f'Converting...' - yosys_conv(conv_tcl, tcl_env, ctx.outputs.synth_json) + yosys_conv(str(conv_tcl), tcl_env, ctx.outputs.synth_json) def __init__(self, params): self.name = 'synthesize' From 393de412082b5ec4b654a0ede7bfec5edc9f6fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 14 Jun 2022 16:56:52 +0200 Subject: [PATCH 07/20] platforms: eos-s3: add missing env variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index 598003a..8c37d1c 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -66,7 +66,9 @@ "DEVICE_CELLS_SIM": "${shareDir}/arch/ql-eos-s3_wlcsp/cells/ram_sim.v", "DEVICE_CELLS_MAP": "${shareDir}/arch/ql-eos-s3_wlcsp/cells/ram_map.v", "PINMAP_FILE": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", - "PCF_FILE": "${:pcf}" + "PCF_FILE": "${:pcf}", + "PYTHON3": "${python3}", + "UTILS_PATH": "${binDir}/python" } } }, @@ -117,4 +119,4 @@ } } } -} \ No newline at end of file +} From a6c2584250994e60d879dc1ef3a4e81298775af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 14 Jun 2022 17:16:07 +0200 Subject: [PATCH 08/20] platforms: eos-s3: add preapre_sdc target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index 8c37d1c..fcd8d09 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -2,6 +2,7 @@ "stages": { "mk_build_dir": "common:mkdirs", "synth": "common:synth", + "prepare_sdc": "common:generic_script_wrapper", "pack": "common:pack", "ioplace": "common:generic_script_wrapper", "place": "common:place", @@ -52,7 +53,9 @@ "synth": { "params": { "takes": [ "pcf?" ], - "produces": [ "synth_v" ] + "produces": [ + "synth_v" + ] }, "values": { "tcl_scripts": "${shareDir}/scripts/pp3", @@ -72,6 +75,28 @@ } } }, + "prepare_sdc": { + "params": { + "stage_name": "prepare_sdc", + "interpreter": "${python3}", + "script": "${binDir}/python/process_sdc_constraints.py", + "outputs": { + "sdc": { + "mode": "file", + "file": "${:eblif[noext]}.sdc", + "target": "${:eblif[noext]}.sdc" + } + }, + "inputs": { + "eblif": "${:eblif}", + "sdc-in": "${:sdc-in}", + "sdc-out": "${:eblif[noext]}.sdc", + "pcf": "${:pcf}", + "pin-map": "", + "$PYTHONPATH": "${binDir}/python/" + } + } + }, "ioplace": { "params": { "stage_name": "ioplace", From 422f54f6d99f1831b6fe8fe49018941f30852b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Wed, 15 Jun 2022 16:07:02 +0200 Subject: [PATCH 09/20] platforms: eos-s3: add place constraints generation target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index fcd8d09..7f9899a 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -5,6 +5,7 @@ "prepare_sdc": "common:generic_script_wrapper", "pack": "common:pack", "ioplace": "common:generic_script_wrapper", + "place_constraints": "common:generic_script_wrapper", "place": "common:place", "route": "common:route", "fasm": "common:fasm", @@ -101,7 +102,7 @@ "params": { "stage_name": "ioplace", "interpreter": "${python3}", - "script": "${binDir}/python/ql_pp3_create_ioplace.py", + "script": "${binDir}/python/pp3_create_ioplace.py", "outputs": { "io_place": { "mode": "stdout", @@ -117,6 +118,25 @@ } } }, + "place_constraints": { + "params": { + "stage_name": "place_constraints", + "interpreter": "${python3}", + "script": "${binDir}/python/pp3_create_place_constraints.py", + "outputs": { + "place_constraints": { + "mode": "stdout", + "target": "${:eblif[noext]}_constraints.place" + } + }, + "inputs": { + "blif": "${:eblif}", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/clkmap_PD64.csv", + "i": "${:io_place}", + "$PYTHONPATH": "${binDir}/python/" + } + } + }, "bitstream": { "params": { "stage_name": "bitstream", From c7c5beec8b9630b0bd4ac2be72853af8609a63eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Fri, 17 Jun 2022 10:36:31 +0200 Subject: [PATCH 10/20] platforms: eos-s3: add iomux config generation targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index 7f9899a..dfd81c9 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -6,6 +6,9 @@ "pack": "common:pack", "ioplace": "common:generic_script_wrapper", "place_constraints": "common:generic_script_wrapper", + "iomux_jlink": "common:generic_script_wrapper", + "iomux_openocd": "common:generic_script_wrapper", + "iomux_binary": "common:generic_script_wrapper", "place": "common:place", "route": "common:route", "fasm": "common:fasm", @@ -137,6 +140,66 @@ } } }, + "iomux_jlink": { + "params": { + "stage_name": "iomux_jlink", + "interpreter": "${python3}", + "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "outputs": { + "iomux_jlink": { + "mode": "stdout", + "target": "${:eblif[noext]}_iomux.jlink" + } + }, + "inputs": { + "eblif": "${:eblif}", + "pcf": "${:pcf}", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "output-format": "jlink", + "$PYTHONPATH": "${binDir}/python/" + } + } + }, + "iomux_openocd": { + "params": { + "stage_name": "iomux_openocd", + "interpreter": "${python3}", + "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "outputs": { + "iomux_openocd": { + "mode": "stdout", + "target": "${:eblif[noext]}_iomux.openocd" + } + }, + "inputs": { + "eblif": "${:eblif}", + "pcf": "${:pcf}", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "output-format": "openocd", + "$PYTHONPATH": "${binDir}/python/" + } + } + }, + "iomux_binary": { + "params": { + "stage_name": "iomux_binary", + "interpreter": "${python3}", + "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "outputs": { + "iomux_binary": { + "mode": "stdout", + "target": "${:eblif[noext]}_iomux.bin" + } + }, + "inputs": { + "eblif": "${:eblif}", + "pcf": "${:pcf}", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "output-format": "binary", + "$PYTHONPATH": "${binDir}/python/" + } + } + }, "bitstream": { "params": { "stage_name": "bitstream", From 6dafe0b6d1df1be0a4fc8e8de0d2151bd90ec5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Wed, 15 Jun 2022 15:39:25 +0200 Subject: [PATCH 11/20] platforms: eos-s3: keep separate options for vpr steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 70 ++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index dfd81c9..c1d130d 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -101,6 +101,41 @@ } } }, + "pack": { + "values": { + "device": "ql-eos-s3", + "device_alt": "ql-eos-s3_wlcsp", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", + "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", + "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", + "vpr_place_delay": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.place_delay.bin", + "vpr_grid_layout_name": "ql-eos-s3", + "vpr_options": { + "write_block_usage": "block_usage.json", + "max_router_iterations": 500, + "routing_failure_predictor": "off", + "router_high_fanout_threshold": -1, + "constant_net_method": "route", + "route_chan_width": 100, + "clock_modeling": "route", + "place_delay_model": "delta_override", + "router_lookahead": "extended_map", + "check_route": "quick", + "strict_checks": "off", + "allow_dangling_combinational_nodes": "on", + "disable_errors": "check_unbuffered_edges:check_route", + "congested_routing_iteration_threshold": "0.8", + "incremental_reroute_delay_ripup": "off", + "base_cost_type": "delay_normalized_length_bounded", + "bb_factor": "10", + "initial_pres_fac": "4.0", + "check_rr_graph": "off", + "pack_high_fanout_threshold": "PB-lOGIC:18", + "suppress_warnings": "${noisyWarnings},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route:set_rr_graph_tool_comment " + } + } + }, "ioplace": { "params": { "stage_name": "ioplace", @@ -200,6 +235,41 @@ } } }, + "route": { + "values": { + "device": "ql-eos-s3", + "device_alt": "ql-eos-s3_wlcsp", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", + "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", + "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", + "vpr_place_delay": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.place_delay.bin", + "vpr_grid_layout_name": "ql-eos-s3", + "vpr_options": { + "write_timing_summary": "timing_summary.json", + "max_router_iterations": 500, + "routing_failure_predictor": "off", + "router_high_fanout_threshold": -1, + "constant_net_method": "route", + "route_chan_width": 100, + "clock_modeling": "route", + "place_delay_model": "delta_override", + "router_lookahead": "extended_map", + "check_route": "quick", + "strict_checks": "off", + "allow_dangling_combinational_nodes": "on", + "disable_errors": "check_unbuffered_edges:check_route", + "congested_routing_iteration_threshold": "0.8", + "incremental_reroute_delay_ripup": "off", + "base_cost_type": "delay_normalized_length_bounded", + "bb_factor": "10", + "initial_pres_fac": "4.0", + "check_rr_graph": "off", + "pack_high_fanout_threshold": "PB-lOGIC:18", + "suppress_warnings": "${noisyWarnings},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route:set_rr_graph_tool_comment " + } + } + }, "bitstream": { "params": { "stage_name": "bitstream", From e88f7148770a32cb0dce3591d91623f607334d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Fri, 17 Jun 2022 12:03:35 +0200 Subject: [PATCH 12/20] common modules: eos-s3: add analysis stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- .github/eos-s3_test.json | 6 +-- f4pga/common.py | 2 + f4pga/common_modules/analysis.py | 88 ++++++++++++++++++++++++++++++++ f4pga/platforms/ql-eos-s3.json | 40 +++++++++++++++ 4 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 f4pga/common_modules/analysis.py diff --git a/.github/eos-s3_test.json b/.github/eos-s3_test.json index 9960475..aa858c7 100644 --- a/.github/eos-s3_test.json +++ b/.github/eos-s3_test.json @@ -8,7 +8,8 @@ "eos-s3/btn_counter/btn_counter.v" ], "synth_log": "synth.log", - "pack_log": "pack.log" + "pack_log": "pack.log", + "analysis_log": "analysis.log" }, "EOS3FF512-PDN64": { "default_target": "bitstream", @@ -18,8 +19,7 @@ "sdc-in": "eos-s3/btn_counter/dummy.sdc" }, "values": { - "part": "ql-eos-s3", - "package": "PD64" + "part": "ql-eos-s3" } } } diff --git a/f4pga/common.py b/f4pga/common.py index 8da06cf..4225a96 100644 --- a/f4pga/common.py +++ b/f4pga/common.py @@ -174,6 +174,8 @@ def vpr(mode: str, vprargs: VprArgs, cwd=None): modeargs = ['--place'] elif mode == 'route': modeargs = ['--route'] + elif mode == 'analysis': + modeargs = ['--analysis'] return sub(*([ 'vpr', diff --git a/f4pga/common_modules/analysis.py b/f4pga/common_modules/analysis.py new file mode 100644 index 0000000..1a324a7 --- /dev/null +++ b/f4pga/common_modules/analysis.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (C) 2022 F4PGA Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +from pathlib import Path +from shutil import move as sh_mv + +from f4pga.common import * +from f4pga.module import Module, ModuleContext + + +def analysis_merged_post_implementation_file(ctx: ModuleContext): + return str(Path(ctx.takes.eblif).with_suffix('')) + '_merged_post_implementation.v' + + +def analysis_post_implementation_file(ctx: ModuleContext): + return str(Path(ctx.takes.eblif).with_suffix('')) + '_post_synthesis.v' + + +class analysisModule(Module): + def map_io(self, ctx: ModuleContext): + return { + 'merged_post_implementation_v': analysis_merged_post_implementation_file(ctx), + 'post_implementation_v': analysis_post_implementation_file(ctx) + } + + def execute(self, ctx: ModuleContext): + build_dir = str(Path(ctx.takes.eblif).parent) + + vpr_options = [] + if ctx.values.vpr_options: + vpr_options = options_dict_to_list(ctx.values.vpr_options) + + yield 'Analysis with VPR...' + vpr( + 'analysis', + VprArgs( + ctx.share, + ctx.takes.eblif, + ctx.values, + sdc_file=ctx.takes.sdc + ), + cwd=build_dir + ) + + if ctx.is_output_explicit('merged_post_implementation_v'): + sh_mv(analysis_merged_post_implementation_file(ctx), ctx.outputs.merged_post_implementation_v) + + if ctx.is_output_explicit('post_implementation_v'): + sh_mv(analysis_post_implementation_file(ctx), ctx.outputs.post_implementation_v) + + yield 'Saving log...' + save_vpr_log('analysis.log', build_dir=build_dir) + + def __init__(self, _): + self.name = 'analysis' + self.no_of_phases = 2 + self.takes = [ + 'eblif', + 'route', + 'sdc?' + ] + self.produces = [ + 'merged_post_implementation_v', + 'post_implementation_v', + 'analysis_log' + ] + self.values = [ + 'device', + 'vpr_options?' + ] + vpr_specific_values() + +ModuleClass = analysisModule diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index c1d130d..e63c276 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -11,6 +11,7 @@ "iomux_binary": "common:generic_script_wrapper", "place": "common:place", "route": "common:route", + "analysis": "common:analysis", "fasm": "common:fasm", "bitstream": "common:generic_script_wrapper" }, @@ -270,6 +271,45 @@ } } }, + "analysis": { + "values": { + "device": "ql-eos-s3", + "device_alt": "ql-eos-s3_wlcsp", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", + "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", + "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", + "vpr_place_delay": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.place_delay.bin", + "vpr_grid_layout_name": "ql-eos-s3", + "vpr_options": { + "gen_post_synthesis_netlist": "on", + "gen_post_implementation_merged_netlist": "on", + "post_synth_netlist_unconn_inputs": "nets", + "post_synth_netlist_unconn_outputs": "nets", + "verify_file_digests": "off", + "max_router_iterations": 500, + "routing_failure_predictor": "off", + "router_high_fanout_threshold": -1, + "constant_net_method": "route", + "route_chan_width": 100, + "clock_modeling": "route", + "place_delay_model": "delta_override", + "router_lookahead": "extended_map", + "check_route": "quick", + "strict_checks": "off", + "allow_dangling_combinational_nodes": "on", + "disable_errors": "check_unbuffered_edges:check_route", + "congested_routing_iteration_threshold": "0.8", + "incremental_reroute_delay_ripup": "off", + "base_cost_type": "delay_normalized_length_bounded", + "bb_factor": "10", + "initial_pres_fac": "4.0", + "check_rr_graph": "off", + "pack_high_fanout_threshold": "PB-lOGIC:18", + "suppress_warnings": "${noisyWarnings},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route:set_rr_graph_tool_comment " + } + } + }, "bitstream": { "params": { "stage_name": "bitstream", From 6f89eafe6e179614a5cde0399270932b82339a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Fri, 17 Jun 2022 14:39:36 +0200 Subject: [PATCH 13/20] platforms: eos-s3: remove db-root arg from write_bitstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index e63c276..d976570 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -328,8 +328,7 @@ "inputs": { "#1": "${:fasm}", "#2": "bitstream-${device}.bit", - "dev-type": "ql-eos-s3", - "db-root": "${shareDir}/fasm_database/pp3" + "dev-type": "ql-eos-s3" } }, "values": { From 25094b2706cc94b52245d52519673c24c6f0c02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Mon, 20 Jun 2022 10:39:10 +0200 Subject: [PATCH 14/20] platforms: eos-s3: make build_dir a required value in write_bistream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index d976570..e2b2e68 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -332,7 +332,7 @@ } }, "values": { - "build_dir?": "." + "build_dir": "." } } } From 4a6cb2031228a8a8ca262f78f35b2110704e0b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Mon, 1 Aug 2022 12:25:18 +0200 Subject: [PATCH 15/20] platforms: eos-s3: fix bitstream paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index e2b2e68..ccb7a12 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -317,17 +317,17 @@ "outputs": { "bitstream": { "mode": "file", - "file": "bitstream-${device}.bit", - "target": "${build_dir?}/bitstream-${device}.bit" + "file": "${:eblif[noext]}.bit", + "target": "${:eblif[noext]}.bit" }, "bitstream_log": { "mode": "stdout", - "target": "${build_dir?}/bitstream-${device}.log" + "target": "${:eblif[noext]}.bit.log" } }, "inputs": { "#1": "${:fasm}", - "#2": "bitstream-${device}.bit", + "#2": "${:eblif[noext]}.bit", "dev-type": "ql-eos-s3" } }, From 29b6757fd77c6d3cd57ca710d543e6a25c789c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 21 Jun 2022 08:59:16 +0200 Subject: [PATCH 16/20] platforms: eos-s3: introduce additional bitstream+iomux_config targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- f4pga/platforms/ql-eos-s3.json | 94 ++++++++++++++++++- f4pga/setup.py | 4 + f4pga/wrappers/sh/__init__.py | 16 ++++ .../sh/quicklogic/write_binary.f4pga.sh | 2 - .../sh/quicklogic/write_bitheader.f4pga.sh | 2 - .../sh/quicklogic/write_jlink.f4pga.sh | 2 - .../sh/quicklogic/write_openocd.f4pga.sh | 2 - 7 files changed, 113 insertions(+), 9 deletions(-) mode change 100644 => 100755 f4pga/wrappers/sh/quicklogic/write_binary.f4pga.sh mode change 100644 => 100755 f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh mode change 100644 => 100755 f4pga/wrappers/sh/quicklogic/write_jlink.f4pga.sh mode change 100644 => 100755 f4pga/wrappers/sh/quicklogic/write_openocd.f4pga.sh diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index ccb7a12..dcacf07 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -13,7 +13,11 @@ "route": "common:route", "analysis": "common:analysis", "fasm": "common:fasm", - "bitstream": "common:generic_script_wrapper" + "bitstream": "common:generic_script_wrapper", + "bitstream_bitheader": "common:generic_script_wrapper", + "bitstream_binary": "common:generic_script_wrapper", + "bitstream_jlink": "common:generic_script_wrapper", + "bitstream_openocd": "common:generic_script_wrapper" }, "values": { @@ -334,6 +338,94 @@ "values": { "build_dir": "." } + }, + "bitstream_bitheader": { + "params": { + "stage_name": "bitstream_bitheader", + "script": "symbiflow_write_bitheader", + "outputs": { + "bitstream_bitheader": { + "mode": "file", + "file": "${:bitstream}.h", + "target": "${:bitstream}.h" + }, + "bitstream_bitheader_log": { + "mode": "stdout", + "target": "${:bitstream}.h.log" + } + }, + "inputs": { + "#1": "${:bitstream}", + "#2": "${:bitstream}.h", + "#3": "${:iomux_binary}" + } + } + }, + "bitstream_jlink": { + "params": { + "stage_name": "bitstream_jlink", + "script": "symbiflow_write_jlink", + "outputs": { + "bitstream_jlink": { + "mode": "file", + "file": "${:bitstream}.jlink", + "target": "${:bitstream}.jlink" + }, + "bitstream_jlink_log": { + "mode": "stdout", + "target": "${:bitstream}.jlink.log" + } + }, + "inputs": { + "#1": "${:bitstream}", + "#2": "${:bitstream}.jlink", + "#3": "${:iomux_jlink}" + } + } + }, + "bitstream_openocd": { + "params": { + "stage_name": "bitstream_openocd", + "script": "symbiflow_write_openocd", + "outputs": { + "bitstream_openocd": { + "mode": "file", + "file": "${:bitstream}.openocd", + "target": "${:bitstream}.openocd" + }, + "bitstream_openocd_log": { + "mode": "stdout", + "target": "${:bitstream}.openocd.log" + } + }, + "inputs": { + "#1": "${:bitstream}", + "#2": "${:bitstream}.openocd", + "#3": "${:iomux_openocd}" + } + } + }, + "bitstream_binary": { + "params": { + "stage_name": "bitstream_binary", + "script": "symbiflow_write_binary", + "outputs": { + "bitstream_binary": { + "mode": "file", + "file": "${:bitstream}.bin", + "target": "${:bitstream}.bin" + }, + "bitstream_binary_log": { + "mode": "stdout", + "target": "${:bitstream}.bin.log" + } + }, + "inputs": { + "#1": "${:bitstream}", + "#2": "${:bitstream}.bin", + "#3": "${:iomux_binary}" + } + } } } } diff --git a/f4pga/setup.py b/f4pga/setup.py index 21d20d8..450eb2c 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -72,6 +72,10 @@ wrapper_entrypoints = [ f"{sf}_generate_constraints = {shwrappers}:generate_constraints", f"{sf}_analysis = {shwrappers}:analysis", f"{sf}_fasm2bels = {shwrappers}:fasm2bels", + f"{sf}_write_binary = {shwrappers}:write_binary", + f"{sf}_write_bitheader = {shwrappers}:write_bitheader", + f"{sf}_write_jlink = {shwrappers}:write_jlink", + f"{sf}_write_openocd = {shwrappers}:write_openocd", f"ql_{sf} = {shwrappers}:ql", f"vpr_common = {shwrappers}:vpr_common", ] diff --git a/f4pga/wrappers/sh/__init__.py b/f4pga/wrappers/sh/__init__.py index 016c7b3..e6d6e35 100644 --- a/f4pga/wrappers/sh/__init__.py +++ b/f4pga/wrappers/sh/__init__.py @@ -120,3 +120,19 @@ def ql(): def fasm2bels(): print("[F4PGA] Running (deprecated) fasm2bels") run_sh(ROOT / "quicklogic/fasm2bels.f4pga.sh") + +def write_bitheader(): + print("[F4PGA] Running (deprecated) write bitheader") + run_sh(ROOT / "quicklogic/write_bitheader.f4pga.sh") + +def write_binary(): + print("[F4PGA] Running (deprecated) write binary") + run_sh(ROOT / "quicklogic/write_binary.f4pga.sh") + +def write_jlink(): + print("[F4PGA] Running (deprecated) write jlink") + run_sh(ROOT / "quicklogic/write_jlink.f4pga.sh") + +def write_openocd(): + print("[F4PGA] Running (deprecated) write openocd") + run_sh(ROOT / "quicklogic/write_openocd.f4pga.sh") diff --git a/f4pga/wrappers/sh/quicklogic/write_binary.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_binary.f4pga.sh old mode 100644 new mode 100755 index 28bdfcf..d5ebeb3 --- a/f4pga/wrappers/sh/quicklogic/write_binary.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_binary.f4pga.sh @@ -18,7 +18,5 @@ set -e -source $(dirname "$(readlink -f "$BASH_SOURCE")")/env - echo "Converting bitstream to flashable binary format" `which python3` -m quicklogic_fasm.bitstream_to_binary $@ diff --git a/f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh old mode 100644 new mode 100755 index 2fa8a01..f0d6eef --- a/f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh @@ -18,7 +18,5 @@ set -e -source $(dirname "$(readlink -f "$BASH_SOURCE")")/env - echo "Converting bitstream to C Header" `which python3` -m quicklogic_fasm.bitstream_to_header $@ diff --git a/f4pga/wrappers/sh/quicklogic/write_jlink.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_jlink.f4pga.sh old mode 100644 new mode 100755 index 2e0c425..6c85fb5 --- a/f4pga/wrappers/sh/quicklogic/write_jlink.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_jlink.f4pga.sh @@ -18,7 +18,5 @@ set -e -source $(dirname "$(readlink -f "$BASH_SOURCE")")/env - echo "Converting bitstream to JLink script" `which python3` -m quicklogic_fasm.bitstream_to_jlink $@ diff --git a/f4pga/wrappers/sh/quicklogic/write_openocd.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_openocd.f4pga.sh old mode 100644 new mode 100755 index 52bec54..345fb6b --- a/f4pga/wrappers/sh/quicklogic/write_openocd.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_openocd.f4pga.sh @@ -18,7 +18,5 @@ set -e -source $(dirname "$(readlink -f "$BASH_SOURCE")")/env - echo "Converting bitstream to OpenOCD script" `which python3` -m quicklogic_fasm.bitstream_to_openocd $@ From 93392fa9cb1ddf3ec1b07d351c71539becbef42c Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Fri, 8 Jul 2022 10:44:50 +0200 Subject: [PATCH 17/20] platforms: eos-s3: add fasm2bels stage Signed-off-by: Pawel Czarnecki --- .github/eos-s3_test.json | 3 +- f4pga/platforms/ql-eos-s3.json | 44 +++++++++++++- .../wrappers/sh/quicklogic/fasm2bels.f4pga.sh | 60 ++++++++++++------- 3 files changed, 82 insertions(+), 25 deletions(-) diff --git a/.github/eos-s3_test.json b/.github/eos-s3_test.json index aa858c7..6e4c63d 100644 --- a/.github/eos-s3_test.json +++ b/.github/eos-s3_test.json @@ -19,7 +19,8 @@ "sdc-in": "eos-s3/btn_counter/dummy.sdc" }, "values": { - "part": "ql-eos-s3" + "part": "ql-eos-s3", + "part_name": "PD64" } } } diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index dcacf07..314b929 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -17,7 +17,8 @@ "bitstream_bitheader": "common:generic_script_wrapper", "bitstream_binary": "common:generic_script_wrapper", "bitstream_jlink": "common:generic_script_wrapper", - "bitstream_openocd": "common:generic_script_wrapper" + "bitstream_openocd": "common:generic_script_wrapper", + "fasm2bels": "common:generic_script_wrapper" }, "values": { @@ -426,6 +427,47 @@ "#3": "${:iomux_binary}" } } + }, + "fasm2bels": { + "params": { + "stage_name": "fasm2bels", + "script": "symbiflow_fasm2bels", + "outputs": { + "fasm2bels_verilog": { + "mode": "file", + "file": "${:bitstream}.v", + "target": "${:bitstream}.v" + }, + "fasm2bels_pcf": { + "mode": "file", + "file": "${:bitstream}.pcf", + "target": "${:bitstream}.pcf" + }, + "fasm2bels_qcf": { + "mode": "file", + "file": "${:bitstream}.qcf", + "target": "${:bitstream}.qcf" + }, + "fasm2bels_log": { + "mode": "stdout", + "target": "${:bitstream}.log" + } + }, + "inputs": { + "device": "${device}", + "part": "${part_name}", + "pcf": "${:pcf}", + "bit": "${:bitstream}", + "out-verilog": "${:bitstream}.v", + "out-pcf": "${:bitstream}.pcf", + "out-qcf": "${:bitstream}.qcf", + "$F4PGA_INSTALL_DIR": "${shareDir}/../../../../", + "$FPGA_FAM": "eos-s3", + "$PATH": "${shareDir}/../../../conda/envs/eos-s3/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "$SHARE_DIR_PATH": "${shareDir}", + "$BIN_DIR_PATH": "${binDir}" + } + } } } } diff --git a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh index 60767e4..c48707c 100755 --- a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh @@ -21,8 +21,8 @@ set -e SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_BIN_DIR"} -OPTS=d:P:p:b: -LONGOPTS=device:,part:,pcf:,bit:, +OPTS=d:P:p:b:v:o:q +LONGOPTS=device:,part:,pcf:,bit:,out-verilog:,out-pcf:,out-qcf:, PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- "$@"` eval set -- "${PARSED_OPTS}" @@ -31,6 +31,9 @@ DEVICE="" PART="" PCF="" BIT="" +OUT_VERILOG="" +OUT_PCF="" +OUT_QCF="" while true; do case "$1" in @@ -50,6 +53,18 @@ while true; do BIT=$2 shift 2 ;; + -v|--out-verilog) + OUT_VERILOG=$2 + shift 2 + ;; + -o|--out-pcf) + OUT_PCF=$2 + shift 2 + ;; + -q|--out-qcf) + OUT_QCF=$2 + shift 2 + ;; --) break ;; @@ -67,27 +82,26 @@ if [ -z $BIT ]; then fi -# Run fasm2bels -if [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then - - VPR_DB=`readlink -f ${SHARE_DIR_PATH}/arch/${DEVICE}_wlcsp/db_phy.pickle` - FASM2BELS=`readlink -f ${SHARE_DIR_PATH}/scripts/fasm2bels.py` - FASM2BELS_DEVICE=${DEVICE/ql-/} - VERILOG_FILE="${BIT}.v" - PCF_FILE="${BIT}.v.pcf" - QCF_FILE="${BIT}.v.qcf" - - if [ ! -z "{PCF}" ]; then - PCF_ARGS="--input-pcf ${PCF}" - else - PCF_ARGS="" - fi - - echo "Running fasm2bels" - `which python3` ${FASM2BELS} ${BIT} --phy-db ${VPR_DB} --device-name ${FASM2BELS_DEVICE} --package-name ${PART} --input-type bitstream --output-verilog ${VERILOG_FILE} ${PCF_ARGS} --output-pcf ${PCF_FILE} --output-qcf ${QCF_FILE} - -else - +# $DEVICE is not ql-eos-s3 or ql-pp3e +if ! [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then echo "ERROR: Unsupported device '${DEVICE}' for fasm2bels" exit -1 fi + +# Run fasm2bels +VPR_DB=`readlink -f ${SHARE_DIR_PATH}/arch/${DEVICE}_wlcsp/db_phy.pickle` +FASM2BELS=`readlink -f ${SHARE_DIR_PATH}/scripts/fasm2bels.py` +FASM2BELS_DEVICE=${DEVICE/ql-/} + +VERILOG_FILE="${OUT_VERILOG:-$BIT.v}" +PCF_FILE="${OUT_PCF:-$BIT.v.pcf}" +QCF_FILE="${OUT_QCF:-$BIT.v.qcf}" + +if [ ! -z "{PCF}" ]; then + PCF_ARGS="--input-pcf ${PCF}" +else + PCF_ARGS="" +fi + +echo "Running fasm2bels" +`which python3` ${FASM2BELS} ${BIT} --phy-db ${VPR_DB} --device-name ${FASM2BELS_DEVICE} --package-name ${PART} --input-type bitstream --output-verilog ${VERILOG_FILE} ${PCF_ARGS} --output-pcf ${PCF_FILE} --output-qcf ${QCF_FILE} From 2f0da9b16950dad201a7f8427551c84584befc8c Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Mon, 11 Jul 2022 08:36:01 +0200 Subject: [PATCH 18/20] platforms: eos-s3: parametrize package name Signed-off-by: Pawel Czarnecki --- .github/eos-s3_test.json | 2 +- f4pga/platforms/ql-eos-s3.json | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/eos-s3_test.json b/.github/eos-s3_test.json index 6e4c63d..8838c7d 100644 --- a/.github/eos-s3_test.json +++ b/.github/eos-s3_test.json @@ -20,7 +20,7 @@ }, "values": { "part": "ql-eos-s3", - "part_name": "PD64" + "package": "PD64" } } } diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index 314b929..104dddf 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -24,7 +24,7 @@ "values": { "device": "ql-eos-s3", "device_alt": "ql-eos-s3_wlcsp", - "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", @@ -78,7 +78,7 @@ "TECHMAP_PATH": "${shareDir}/techmaps/pp3", "DEVICE_CELLS_SIM": "${shareDir}/arch/ql-eos-s3_wlcsp/cells/ram_sim.v", "DEVICE_CELLS_MAP": "${shareDir}/arch/ql-eos-s3_wlcsp/cells/ram_map.v", - "PINMAP_FILE": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "PINMAP_FILE": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "PCF_FILE": "${:pcf}", "PYTHON3": "${python3}", "UTILS_PATH": "${binDir}/python" @@ -111,7 +111,7 @@ "values": { "device": "ql-eos-s3", "device_alt": "ql-eos-s3_wlcsp", - "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", @@ -157,7 +157,7 @@ "blif": "${:eblif}", "net": "${:net}", "pcf": "${:pcf}", - "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "$PYTHONPATH": "${binDir}/python/" } } @@ -175,7 +175,7 @@ }, "inputs": { "blif": "${:eblif}", - "map": "${shareDir}/arch/ql-eos-s3_wlcsp/clkmap_PD64.csv", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/clkmap_${package}.csv", "i": "${:io_place}", "$PYTHONPATH": "${binDir}/python/" } @@ -195,7 +195,7 @@ "inputs": { "eblif": "${:eblif}", "pcf": "${:pcf}", - "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "jlink", "$PYTHONPATH": "${binDir}/python/" } @@ -215,7 +215,7 @@ "inputs": { "eblif": "${:eblif}", "pcf": "${:pcf}", - "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "openocd", "$PYTHONPATH": "${binDir}/python/" } @@ -235,7 +235,7 @@ "inputs": { "eblif": "${:eblif}", "pcf": "${:pcf}", - "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "binary", "$PYTHONPATH": "${binDir}/python/" } @@ -245,7 +245,7 @@ "values": { "device": "ql-eos-s3", "device_alt": "ql-eos-s3_wlcsp", - "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", @@ -280,7 +280,7 @@ "values": { "device": "ql-eos-s3", "device_alt": "ql-eos-s3_wlcsp", - "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_PD64.csv", + "pinmap": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "arch_def": "${shareDir}/arch/ql-eos-s3_wlcsp/arch.timing.xml", "rr_graph_lookahead_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.lookahead.bin", "rr_graph_real_bin": "${shareDir}/arch/ql-eos-s3_wlcsp/rr_graph_ql-eos-s3_wlcsp.rr_graph.real.bin", @@ -455,7 +455,7 @@ }, "inputs": { "device": "${device}", - "part": "${part_name}", + "part": "${package}", "pcf": "${:pcf}", "bit": "${:bitstream}", "out-verilog": "${:bitstream}.v", From 9659ff1be62b541c82e33bb0707dfc9071482ad3 Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Thu, 28 Jul 2022 16:15:08 +0200 Subject: [PATCH 19/20] platforms: eos-s3: update paths to python scripts Signed-off-by: Pawel Czarnecki --- f4pga/platforms/ql-eos-s3.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/f4pga/platforms/ql-eos-s3.json b/f4pga/platforms/ql-eos-s3.json index 104dddf..78deaf1 100644 --- a/f4pga/platforms/ql-eos-s3.json +++ b/f4pga/platforms/ql-eos-s3.json @@ -81,7 +81,7 @@ "PINMAP_FILE": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "PCF_FILE": "${:pcf}", "PYTHON3": "${python3}", - "UTILS_PATH": "${binDir}/python" + "UTILS_PATH": "${shareDir}/scripts" } } }, @@ -89,7 +89,7 @@ "params": { "stage_name": "prepare_sdc", "interpreter": "${python3}", - "script": "${binDir}/python/process_sdc_constraints.py", + "script": "${shareDir}/scripts/process_sdc_constraints.py", "outputs": { "sdc": { "mode": "file", @@ -103,7 +103,7 @@ "sdc-out": "${:eblif[noext]}.sdc", "pcf": "${:pcf}", "pin-map": "", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, @@ -146,7 +146,7 @@ "params": { "stage_name": "ioplace", "interpreter": "${python3}", - "script": "${binDir}/python/pp3_create_ioplace.py", + "script": "${shareDir}/scripts/pp3_create_ioplace.py", "outputs": { "io_place": { "mode": "stdout", @@ -158,7 +158,7 @@ "net": "${:net}", "pcf": "${:pcf}", "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, @@ -166,7 +166,7 @@ "params": { "stage_name": "place_constraints", "interpreter": "${python3}", - "script": "${binDir}/python/pp3_create_place_constraints.py", + "script": "${shareDir}/scripts/pp3_create_place_constraints.py", "outputs": { "place_constraints": { "mode": "stdout", @@ -177,7 +177,7 @@ "blif": "${:eblif}", "map": "${shareDir}/arch/ql-eos-s3_wlcsp/clkmap_${package}.csv", "i": "${:io_place}", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, @@ -185,7 +185,7 @@ "params": { "stage_name": "iomux_jlink", "interpreter": "${python3}", - "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "script": "${shareDir}/scripts/pp3_eos_s3_iomux_config.py", "outputs": { "iomux_jlink": { "mode": "stdout", @@ -197,7 +197,7 @@ "pcf": "${:pcf}", "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "jlink", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, @@ -205,7 +205,7 @@ "params": { "stage_name": "iomux_openocd", "interpreter": "${python3}", - "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "script": "${shareDir}/scripts/pp3_eos_s3_iomux_config.py", "outputs": { "iomux_openocd": { "mode": "stdout", @@ -217,7 +217,7 @@ "pcf": "${:pcf}", "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "openocd", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, @@ -225,7 +225,7 @@ "params": { "stage_name": "iomux_binary", "interpreter": "${python3}", - "script": "${binDir}/python/pp3_eos_s3_iomux_config.py", + "script": "${shareDir}/scripts/pp3_eos_s3_iomux_config.py", "outputs": { "iomux_binary": { "mode": "stdout", @@ -237,7 +237,7 @@ "pcf": "${:pcf}", "map": "${shareDir}/arch/ql-eos-s3_wlcsp/pinmap_${package}.csv", "output-format": "binary", - "$PYTHONPATH": "${binDir}/python/" + "$PYTHONPATH": "${shareDir}/scripts/" } } }, From ab727871eda9be038718e207f1dffb914f7c4cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Mon, 1 Aug 2022 09:01:04 +0200 Subject: [PATCH 20/20] CI: missing newline at the end of file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- .github/workflows/Pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 97fd63c..a2c3401 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -214,4 +214,4 @@ jobs: - name: 🚧 Test pyF4PGA (PYTHONPATH) run: | PYTHONPATH=$(pwd) python3 f4pga/__init__.py - PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h \ No newline at end of file + PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h