From 9513397e17c5bf1983c37e322ede44ca06248299 Mon Sep 17 00:00:00 2001 From: Javier Valenzuela Date: Wed, 3 Aug 2022 13:38:44 -0500 Subject: [PATCH] fpga: tools: Lattice build flow clean-up Original-commit: fd2dd921a2af4bff1a26c43385b3942bc143f934 --- tools/make/diamond_design_builder.mak | 5 ++++ tools/scripts/dmd_design_build.tcl | 30 +++++++++++++++++++++ top/x400/dboards/zbx/cpld/lattice/build.tcl | 22 --------------- 3 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 tools/scripts/dmd_design_build.tcl delete mode 100644 top/x400/dboards/zbx/cpld/lattice/build.tcl diff --git a/tools/make/diamond_design_builder.mak b/tools/make/diamond_design_builder.mak index ad80a5b..3edff30 100644 --- a/tools/make/diamond_design_builder.mak +++ b/tools/make/diamond_design_builder.mak @@ -24,6 +24,11 @@ BUILD_DIAMOND_DESIGN = \ echo "========================================================"; \ echo "BUILDER: Staging Diamond sources in build directory..."; \ cp -rf $(3)/lattice/* $(4)/;\ + echo "BUILDER: Updating environment..."; \ + export DMD_GIT_HASH=$(GIT_HASH_VERILOG_DEF); \ + export DMD_PROJECT_FILE="$(1).ldf"; \ + export DMD_IMPL=$(5); \ + cp $(TOOLS_DIR)/scripts/dmd_design_build.tcl $(4)/build.tcl; \ cd $(4); \ echo "BUILDER: Implementating design..."; \ pnmainc build.tcl > $(1)_log.txt ; \ diff --git a/tools/scripts/dmd_design_build.tcl b/tools/scripts/dmd_design_build.tcl new file mode 100644 index 0000000..747047e --- /dev/null +++ b/tools/scripts/dmd_design_build.tcl @@ -0,0 +1,30 @@ +# +# Copyright 2022 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# This is a template that will be copied to a project's +# build directory. +# This file contains the sequence of steps required to +# build and generate outputs for Lattice programmables. +# It works in conjuction with Lattice TCL Console (pnmainc). +# This file has the pre-requisite of setting the following +# environment variables: +# - DMD_PROJECT_FILE : Lattice project file name +# - DMD_IMPL : Implementation to use in said project +# - DMD_GIT_HASH : Hash to be consumed in this build +# +# Usage: +# pnmainc.exe build.tcl > + +prj_project open $::env(DMD_PROJECT_FILE) +prj_impl option -append "VERILOG_DIRECTIVES" $::env(DMD_GIT_HASH) +prj_run Synthesis -impl $::env(DMD_IMPL) +prj_run Translate -impl $::env(DMD_IMPL) +prj_run Map -impl $::env(DMD_IMPL) +prj_run PAR -impl $::env(DMD_IMPL) +prj_run PAR -impl $::env(DMD_IMPL) -task PARTrace +prj_run Export -impl $::env(DMD_IMPL) -task Bitgen +prj_run Export -impl $::env(DMD_IMPL) -task Jedecgen +prj_run Export -impl $::env(DMD_IMPL) -task Jedec4Xo3l +prj_project close diff --git a/top/x400/dboards/zbx/cpld/lattice/build.tcl b/top/x400/dboards/zbx/cpld/lattice/build.tcl deleted file mode 100644 index b4b4d25..0000000 --- a/top/x400/dboards/zbx/cpld/lattice/build.tcl +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2022 Ettus Research, a National Instruments Brand -# -# SPDX-License-Identifier: LGPL-3.0-or-later -# -# -# This file contains the sequence of steps required to -# build and generate outputs for the ZBX CPLD, XO3 variant. -# It is intended to be use as a parameter for -# pnmainc (Diamond TCL console). -# pnmainc.exe build.tcl > - -prj_project open "zbx_top_cpld.ldf" -prj_run Synthesis -impl impl1 -prj_run Translate -impl impl1 -prj_run Map -impl impl1 -prj_run PAR -impl impl1 -prj_run PAR -impl impl1 -task PARTrace -prj_run Export -impl impl1 -task Bitgen -prj_run Export -impl impl1 -task Jedecgen -prj_run Export -impl impl1 -task Jedec4Xo3l -prj_project close