From 10a1a86ba0954f0dbeb5cf241f8945c7dffd0f24 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Tue, 23 Jun 2020 17:05:23 +1000 Subject: [PATCH] Add FPGA_TARGET=ECP5-EVN make option for synthesis build This allows these targets FPGA_TARGET=ORANGE-CRAB make microwatt.bit FPGA_TARGET=ECP5-EVN make microwatt.bit Default is ORANGE-CRAB as before ECP5-EVN is tested on real hardware. The console only works at 38400 so needs this in console.c and a recompile of hello_world to work: -#define UART_FREQ 115200 +#define UART_FREQ 38400 With this 'FPGA_TARGET=ECP5-EVN make prog' works on the ECP5 dev board. Signed-off-by: Michael Neuling --- Makefile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 20baa24..50e4439 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,10 @@ RAM_INIT_FILE=hello_world/hello_world.hex #MEMORY_SIZE=393216 #RAM_INIT_FILE=micropython/firmware.hex +FPGA_TARGET ?= ORANGE-CRAB + # OrangeCrab with ECP85 +ifeq ($(FPGA_TARGET), ORANGE-CRAB) RESET_LOW=true CLK_INPUT=50000000 CLK_FREQUENCY=50000000 @@ -152,16 +155,19 @@ PACKAGE=CSFBGA285 NEXTPNR_FLAGS=--um5g-85k --freq 50 OPENOCD_JTAG_CONFIG=openocd/olimex-arm-usb-tiny-h.cfg OPENOCD_DEVICE_CONFIG=openocd/LFE5UM5G-85F.cfg +endif # ECP5-EVN -#RESET_LOW=true -#CLK_INPUT=12000000 -#CLK_FREQUENCY=12000000 -#LPF=constraints/ecp5-evn.lpf -#PACKAGE=CABGA381 -#NEXTPNR_FLAGS=--um5g-85k --freq 12 -#OPENOCD_JTAG_CONFIG=openocd/ecp5-evn.cfg -#OPENOCD_DEVICE_CONFIG=openocd/LFE5UM5G-85F.cfg +ifeq ($(FPGA_TARGET), ECP5-EVN) +RESET_LOW=true +CLK_INPUT=12000000 +CLK_FREQUENCY=12000000 +LPF=constraints/ecp5-evn.lpf +PACKAGE=CABGA381 +NEXTPNR_FLAGS=--um5g-85k --freq 12 +OPENOCD_JTAG_CONFIG=openocd/ecp5-evn.cfg +OPENOCD_DEVICE_CONFIG=openocd/LFE5UM5G-85F.cfg +endif GHDL_IMAGE_GENERICS=-gMEMORY_SIZE=$(MEMORY_SIZE) -gRAM_INIT_FILE=$(RAM_INIT_FILE) \ -gRESET_LOW=$(RESET_LOW) -gCLK_INPUT=$(CLK_INPUT) -gCLK_FREQUENCY=$(CLK_FREQUENCY) -- 2.30.2