fpga: x400: zbx: Add support for XO3 CPLD variant.
The main changes included are: - Variant-dependent pin-out instantiation. - Update clocking scheme in top level file to include XO3 PLL - Add ability to shift outgoing data for the GPIO communication interface with the X410 FPGA. - Include project files required to build the XO3 variant of the ZBX CPLD. - Add build flow for Lattice Diamond designs. - Add ability to build XO3 variant of ZBX CPLD. Original-commit: 2c7813acb21383f302353a1b6cf57f0946fa0b6b
This commit is contained in:
committed by
Wade Fife
parent
27aae37722
commit
a6fc53b4e6
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright 2022 Ettus Research, a National Instruments Brand
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
#
|
||||
|
||||
include $(BASE_DIR)/../tools/make/diamond_preamble.mak
|
||||
SIMULATION = 0
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Usage: BUILD_DIAMOND_DESIGN
|
||||
# Args: $1 = PROJECT_NAME
|
||||
# $2 = PART_ID (LCMXO3LF-9400C, etc)
|
||||
# $3 = PROJECT_DIR (Absolute path to the top level project dir)
|
||||
# $4 = BUILD_DIR (Absolute path to the top level build dir)
|
||||
# $5 = IMPLEMENTATION_NAME (name of design implementation in project)
|
||||
# Prereqs:
|
||||
# - TOOLS_DIR must be defined globally
|
||||
# - DESIGN_SRCS must be defined and should contain all source files
|
||||
BUILD_DIAMOND_DESIGN = \
|
||||
@ \
|
||||
echo "========================================================"; \
|
||||
echo "BUILDER: Building $(1) for $(2)"; \
|
||||
echo "========================================================"; \
|
||||
echo "BUILDER: Staging Diamond sources in build directory..."; \
|
||||
cp -rf $(3)/lattice/* $(4)/;\
|
||||
cd $(4); \
|
||||
echo "BUILDER: Implementating design..."; \
|
||||
pnmainc build.tcl > $(1)_log.txt ; \
|
||||
echo "BUILDER: Generating bitfile..."; \
|
||||
ddtcmd -oft -svfsingle -if $(5)/$(1)_$(5).jed \
|
||||
-dev $(2) -op "FLASH Erase,Program,Verify" -revd \
|
||||
-of $(5)/$(1)_$(5).svf;
|
||||
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# Copyright 2022 Ettus Research, a National Instruments Brand
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
#
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Environment Setup
|
||||
# -------------------------------------------------------------------
|
||||
ifeq ($(VIV_PLATFORM),Cygwin)
|
||||
RESOLVE_PATH = $(if $(1),$(subst \,/,$(shell cygpath -aw $(1))))
|
||||
RESOLVE_PATHS = "$(if $(1),$(foreach path,$(1),$(subst \,/,$(shell cygpath -aw $(abspath $(path))))))"
|
||||
else
|
||||
RESOLVE_PATH = $(1)
|
||||
RESOLVE_PATHS = "$(1)"
|
||||
endif
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Project Setup
|
||||
# -------------------------------------------------------------------
|
||||
# Requirement: BASE_DIR must be defined
|
||||
|
||||
TOOLS_DIR = $(BASE_DIR)/../tools
|
||||
LIB_DIR = $(BASE_DIR)/../lib
|
||||
|
||||
O ?= .
|
||||
|
||||
ifdef NAME
|
||||
BUILD_DIR = $(abspath $(O)/build-$(NAME))
|
||||
else
|
||||
BUILD_DIR = $(abspath $(O)/build)
|
||||
endif
|
||||
|
||||
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Git Hash Retrieval
|
||||
# -------------------------------------------------------------------
|
||||
GIT_HASH = $(shell $(TOOLS_DIR)/scripts/git-hash.sh)
|
||||
GIT_HASH_VERILOG_DEF = "GIT_HASH=32'h$(GIT_HASH)"
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Toolchain dependency target
|
||||
# -------------------------------------------------------------------
|
||||
.check_lscc_tool:
|
||||
@echo "BUILDER: Checking tools..."
|
||||
@echo -n "* "; bash --version | grep bash || (echo "ERROR: Bash not found in environment. Please install it"; exit 1;)
|
||||
@echo -n "* "; python3 --version || (echo "ERROR: Python not found in environment. Please install it"; exit 1;)
|
||||
@echo -n "* "; which pnmainc 2>&1 | grep diamond|| (echo "ERROR: Diamond TCL Console not found in environment."; exit 1;)
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Intermediate build dirs
|
||||
# -------------------------------------------------------------------
|
||||
.build_dirs:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
@mkdir -p $(IP_BUILD_DIR)
|
||||
|
||||
.diamond_prereqs: .check_lscc_tool .build_dirs
|
||||
|
||||
.PHONY: .check_lscc_tool .build_dirs .diamond_prereqs
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Validate prerequisites
|
||||
# -------------------------------------------------------------------
|
||||
ifndef PART_ID
|
||||
$(error PART_ID was empty or not set)
|
||||
endif
|
||||
Reference in New Issue
Block a user