From 2d6563a3cf430a68ff266f0a046d9f1a905764d9 Mon Sep 17 00:00:00 2001 From: Luka Jankovic Date: Wed, 12 Nov 2025 21:23:24 +0100 Subject: [PATCH] move all project variables to env, update readme --- .env | 15 +++++++++++++++ Makefile | 17 +---------------- README.md | 19 ++++++++++++++++++- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.env b/.env index bf525bc..bcf1080 100644 --- a/.env +++ b/.env @@ -1 +1,16 @@ VIVADO_SETTINGS=/opt/Xilinx/2025.1/Vivado/settings64.sh + +PROJ_NAME=example +SIM_TOP=example_tb +TOP=and_gate + +SRC_DIR=src +SIM_DIR=sim +BUILD_DIR=.build + +WAVEFORM_CFG=$(SIM_DIR)/$(SIM_TOP).sim.wcfg + +WAVEFORM_VCD=simulation_${PROJ_NAME}.wdb + +PART=xc7z020clg400-1 +CONSTRAINTS=Zybo-Z7.xdc diff --git a/Makefile b/Makefile index 6ef03d4..9018234 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,7 @@ include .env export $(shell sed 's/=.*//' .env) -PROJ_NAME := example -SIM_TOP := example_tb -TOP := and_gate - -SRC_DIR := src -SIM_DIR := sim -BUILD_DIR := .build - -WAVEFORM_CFG := $(SIM_DIR)/$(SIM_TOP).sim.wcfg - -WAVEFORM_VCD := simulation_${PROJ_NAME}.wdb - -PART := xc7z020clg400-1 -CONSTRAINTS := Zybo-Z7.xdc - -THREADS := 16 +THREADS := $(shell nproc) all: sim diff --git a/README.md b/README.md index 8cc9667..4305e3a 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,21 @@ Simple make system for simulating, synthesizing and routing VHDL projects as well as programming boards. Requires Vivado and doesn't rely on any other tools (apart from `make`, install with `scoop` on Windows) -Supports VHDL and the example is build for the Zybo-Z7 board. \ No newline at end of file +Supports VHDL and the example is built for the Zybo-Z7 board. + +## Usage + +Only the `.env` file should need to be edited. + +``` +# Simulate +make sim + +# Synth, opt, route design +make build + +# Program target +make prog +``` + +Programming might require additional dependencies, such as Digilent Adept.