From 763fa6f72b34b8aa52cbc5430779dd9cddb173b0 Mon Sep 17 00:00:00 2001 From: Manuel Eggimann Date: Thu, 24 Jun 2021 22:01:49 +0200 Subject: [PATCH 1/2] Add SOC_FREQUENCY to fpga specific runtime configuration --- configs/fpgas/pulpissimo/genesys2.sh | 2 +- configs/fpgas/pulpissimo/nexys_video.sh | 2 +- configs/fpgas/pulpissimo/zcu102.sh | 2 +- configs/fpgas/pulpissimo/zcu104.sh | 2 +- configs/fpgas/pulpissimo/zedboard.sh | 2 +- include/archi/chips/marsellus/properties.h | 2 +- include/archi/chips/pulp/properties.h | 8 ++++---- include/archi/chips/pulpissimo/properties.h | 8 ++++---- kernel/chips/pulp/soc.c | 4 ++-- kernel/chips/pulpissimo/soc.c | 4 ++-- kernel/init.c | 2 +- rules/pulpos/default_rules.mk | 9 +++++++++ 12 files changed, 28 insertions(+), 19 deletions(-) diff --git a/configs/fpgas/pulpissimo/genesys2.sh b/configs/fpgas/pulpissimo/genesys2.sh index 6e87066..b3538bc 100644 --- a/configs/fpgas/pulpissimo/genesys2.sh +++ b/configs/fpgas/pulpissimo/genesys2.sh @@ -17,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #Genesys2 uses 10MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=10000000 -DARCHI_FPGA_SOC_FREQUENCY=20000000' export io=uart diff --git a/configs/fpgas/pulpissimo/nexys_video.sh b/configs/fpgas/pulpissimo/nexys_video.sh index 47b473a..48b312d 100644 --- a/configs/fpgas/pulpissimo/nexys_video.sh +++ b/configs/fpgas/pulpissimo/nexys_video.sh @@ -17,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #Nexys Video uses 5MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=5000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=5000000 -DARCHI_FPGA_SOC_FREQUENCY=10000000' export io=uart diff --git a/configs/fpgas/pulpissimo/zcu102.sh b/configs/fpgas/pulpissimo/zcu102.sh index 4eb9f63..b7d2f59 100644 --- a/configs/fpgas/pulpissimo/zcu102.sh +++ b/configs/fpgas/pulpissimo/zcu102.sh @@ -17,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #ZCU102 uses 10MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=10000000 -DARCHI_FPGA_SOC_FREQUENCY=20000000' export io=uart diff --git a/configs/fpgas/pulpissimo/zcu104.sh b/configs/fpgas/pulpissimo/zcu104.sh index 68d5ac7..21eb989 100644 --- a/configs/fpgas/pulpissimo/zcu104.sh +++ b/configs/fpgas/pulpissimo/zcu104.sh @@ -17,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #ZCU104 uses 10MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=10000000 -DARCHI_FPGA_SOC_FREQUENCY=20000000' export io=uart diff --git a/configs/fpgas/pulpissimo/zedboard.sh b/configs/fpgas/pulpissimo/zedboard.sh index 297ff38..c7090ff 100644 --- a/configs/fpgas/pulpissimo/zedboard.sh +++ b/configs/fpgas/pulpissimo/zedboard.sh @@ -17,6 +17,6 @@ source $scriptDir/../../common.sh export PULPRUN_PLATFORM=fpga #Zedboard uses 10MHz SoC Frequency -export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000' +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=10000000 -DARCHI_FPGA_SOC_FREQUENCY=20000000' export io=uart diff --git a/include/archi/chips/marsellus/properties.h b/include/archi/chips/marsellus/properties.h index 248321d..318b6ae 100644 --- a/include/archi/chips/marsellus/properties.h +++ b/include/archi/chips/marsellus/properties.h @@ -22,7 +22,7 @@ * FPGA */ -#define ARCHI_FPGA_FREQUENCY 5000000 +#define ARCHI_FPGA_PER_FREQUENCY 5000000 /* * MEMORIES diff --git a/include/archi/chips/pulp/properties.h b/include/archi/chips/pulp/properties.h index 6e4c292..eeb896f 100644 --- a/include/archi/chips/pulp/properties.h +++ b/include/archi/chips/pulp/properties.h @@ -22,12 +22,12 @@ * FPGA */ -#ifndef ARCHI_FPGA_FREQUENCY -#define ARCHI_FPGA_FREQUENCY 5000000 +#ifndef ARCHI_FPGA_PER_FREQUENCY +#define ARCHI_FPGA_PER_FREQUENCY 5000000 #endif -#ifndef ARCHI_FPGA_FC_FREQUENCY -#define ARCHI_FPGA_FC_FREQUENCY 5000000 +#ifndef ARCHI_FPGA_SOC_FREQUENCY +#define ARCHI_FPGA_SOC_FREQUENCY 5000000 #endif #ifndef ARCHI_FPGA_CL_FREQUENCY diff --git a/include/archi/chips/pulpissimo/properties.h b/include/archi/chips/pulpissimo/properties.h index 32465c0..dcb9f47 100644 --- a/include/archi/chips/pulpissimo/properties.h +++ b/include/archi/chips/pulpissimo/properties.h @@ -22,12 +22,12 @@ * FPGA */ -#ifndef ARCHI_FPGA_FREQUENCY -#define ARCHI_FPGA_FREQUENCY 5000000 +#ifndef ARCHI_FPGA_PER_FREQUENCY +#define ARCHI_FPGA_PER_FREQUENCY 5000000 #endif -#ifndef ARCHI_FPGA_FC_FREQUENCY -#define ARCHI_FPGA_FC_FREQUENCY 5000000 +#ifndef ARCHI_FPGA_SOC_FREQUENCY +#define ARCHI_FPGA_SOC_FREQUENCY 5000000 #endif diff --git a/kernel/chips/pulp/soc.c b/kernel/chips/pulp/soc.c index 8626f91..25af3b9 100644 --- a/kernel/chips/pulp/soc.c +++ b/kernel/chips/pulp/soc.c @@ -31,9 +31,9 @@ void pos_soc_init() #else - pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY; + pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_SOC_FREQUENCY; - pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY; + pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_PER_FREQUENCY; pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_CL_FREQUENCY; diff --git a/kernel/chips/pulpissimo/soc.c b/kernel/chips/pulpissimo/soc.c index 1f239ac..921640e 100644 --- a/kernel/chips/pulpissimo/soc.c +++ b/kernel/chips/pulpissimo/soc.c @@ -28,9 +28,9 @@ void pos_soc_init() #else - pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY; + pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_SOC_FREQUENCY; - pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY; + pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_PER_FREQUENCY; #endif } diff --git a/kernel/init.c b/kernel/init.c index 8dc22e0..8a7d254 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -94,4 +94,4 @@ void pos_init_stop() /* Call global and static destructors */ pos_init_do_dtors(); -} \ No newline at end of file +} diff --git a/rules/pulpos/default_rules.mk b/rules/pulpos/default_rules.mk index 3c7ec8a..4bdc2df 100644 --- a/rules/pulpos/default_rules.mk +++ b/rules/pulpos/default_rules.mk @@ -137,6 +137,15 @@ ifdef RUNNER_CONFIG override runner_args += --config-user=$(RUNNER_CONFIG) endif +ifeq '$(load_mode)' 'fast_debug' +LOAD_MODE := FAST_DEBUG_PRELOAD +else ifeq '$(load_mode)' 'standalone' +LOAD_MODE := STANDALONE +else ifeq '$(load_mode)' 'jtag' +LOAD_MODE := JTAG +else +LOAD_MODE := JTAG +endif # # VSIM Flags From dc012f0c54a03fce1c0a31dc7551c667266865cc Mon Sep 17 00:00:00 2001 From: Manuel Eggimann Date: Thu, 24 Jun 2021 22:02:19 +0200 Subject: [PATCH 2/2] Add config for nexys FPGA board --- configs/fpgas/pulpissimo/nexys.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 configs/fpgas/pulpissimo/nexys.sh diff --git a/configs/fpgas/pulpissimo/nexys.sh b/configs/fpgas/pulpissimo/nexys.sh new file mode 100644 index 0000000..48b312d --- /dev/null +++ b/configs/fpgas/pulpissimo/nexys.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +export PULPRT_TARGET=pulpissimo +export PULPRUN_TARGET=pulpissimo + +if [ -n "${ZSH_VERSION:-}" ]; then + DIR="$(readlink -f -- "${(%):-%x}")" + scriptDir="$(dirname $DIR)" +else + + scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + +fi + +source $scriptDir/../../common.sh + +export PULPRUN_PLATFORM=fpga + +#Nexys Video uses 5MHz SoC Frequency +export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_PER_FREQUENCY=5000000 -DARCHI_FPGA_SOC_FREQUENCY=10000000' + +export io=uart