mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-11-18 08:54:44 +00:00
commit
757e05922d
35 changed files with 298 additions and 49 deletions
|
|
@ -1,6 +1,14 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
|
DIR="$(readlink -f -- "${(%):-%x}")"
|
||||||
|
DIRNAME="$(dirname $DIR)"
|
||||||
|
scriptDir="$(dirname $DIRNAME)"
|
||||||
|
else
|
||||||
|
|
||||||
scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
|
scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
export PULPRT_HOME=$scriptDir
|
export PULPRT_HOME=$scriptDir
|
||||||
export PULP_SDK_HOME=$PULPRT_HOME
|
export PULP_SDK_HOME=$PULPRT_HOME
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
export PULPRT_TARGET=marsellus
|
export PULPRT_TARGET=marsellus
|
||||||
|
|
@ -17,7 +16,8 @@ source $scriptDir/../../common.sh
|
||||||
|
|
||||||
export PULPRUN_PLATFORM=fpga
|
export PULPRUN_PLATFORM=fpga
|
||||||
|
|
||||||
#Virtex7 uses 50MHz SoC Frequency
|
#Virtex7 uses 10MHz SoC Frequency
|
||||||
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=50000000'
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
|
export io=uart
|
||||||
|
|
||||||
export io=uart
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
export PULPRT_TARGET=pulp
|
export PULPRT_TARGET=pulp
|
||||||
|
|
@ -17,7 +16,7 @@ source $scriptDir/../../common.sh
|
||||||
|
|
||||||
export PULPRUN_PLATFORM=fpga
|
export PULPRUN_PLATFORM=fpga
|
||||||
|
|
||||||
#Virtex7 uses 50MHz SoC Frequency
|
#Virtex7 uses 10MHz SoC Frequency
|
||||||
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=50000000'
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
export io=uart
|
export io=uart
|
||||||
|
|
@ -3,10 +3,20 @@
|
||||||
export PULPRT_TARGET=pulpissimo
|
export PULPRT_TARGET=pulpissimo
|
||||||
export PULPRUN_TARGET=pulpissimo
|
export PULPRUN_TARGET=pulpissimo
|
||||||
|
|
||||||
scriptDir="$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")"
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
|
DIR="$(readlink -f -- "${(%):-%x}")"
|
||||||
|
scriptDir="$(dirname $DIR)"
|
||||||
|
else
|
||||||
|
|
||||||
source $scriptDir/common.sh
|
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
source $scriptDir/../../common.sh
|
||||||
|
|
||||||
export PULPRUN_PLATFORM=fpga
|
export PULPRUN_PLATFORM=fpga
|
||||||
|
|
||||||
|
#Genesys2 uses 10MHz SoC Frequency
|
||||||
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
export io=uart
|
export io=uart
|
||||||
|
|
|
||||||
22
configs/fpgas/pulpissimo/nexys_video.sh
Normal file
22
configs/fpgas/pulpissimo/nexys_video.sh
Normal file
|
|
@ -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_FREQUENCY=5000000'
|
||||||
|
|
||||||
|
export io=uart
|
||||||
22
configs/fpgas/pulpissimo/zcu102.sh
Normal file
22
configs/fpgas/pulpissimo/zcu102.sh
Normal file
|
|
@ -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
|
||||||
|
|
||||||
|
#ZCU102 uses 10MHz SoC Frequency
|
||||||
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
|
export io=uart
|
||||||
22
configs/fpgas/pulpissimo/zcu104.sh
Normal file
22
configs/fpgas/pulpissimo/zcu104.sh
Normal file
|
|
@ -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
|
||||||
|
|
||||||
|
#ZCU104 uses 10MHz SoC Frequency
|
||||||
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
|
export io=uart
|
||||||
22
configs/fpgas/pulpissimo/zedboard.sh
Normal file
22
configs/fpgas/pulpissimo/zedboard.sh
Normal file
|
|
@ -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
|
||||||
|
|
||||||
|
#Zedboard uses 10MHz SoC Frequency
|
||||||
|
export PULPRT_CONFIG_CFLAGS='-DARCHI_FPGA_FREQUENCY=10000000'
|
||||||
|
|
||||||
|
export io=uart
|
||||||
|
|
@ -3,6 +3,13 @@
|
||||||
export PULPRT_TARGET=marsellus
|
export PULPRT_TARGET=marsellus
|
||||||
export PULPRUN_TARGET=marsellus
|
export PULPRUN_TARGET=marsellus
|
||||||
|
|
||||||
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
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
|
source $scriptDir/common.sh
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,13 @@
|
||||||
export PULPRT_TARGET=pulp
|
export PULPRT_TARGET=pulp
|
||||||
export PULPRUN_TARGET=pulp
|
export PULPRUN_TARGET=pulp
|
||||||
|
|
||||||
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
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
|
source $scriptDir/common.sh
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,13 @@
|
||||||
export PULPRT_TARGET=pulpissimo
|
export PULPRT_TARGET=pulpissimo
|
||||||
export PULPRUN_TARGET=pulpissimo
|
export PULPRUN_TARGET=pulpissimo
|
||||||
|
|
||||||
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
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
|
source $scriptDir/common.sh
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ static void uart_wait_rx_done(int periph)
|
||||||
|
|
||||||
static void uart_setup(int channel, int baudrate)
|
static void uart_setup(int channel, int baudrate)
|
||||||
{
|
{
|
||||||
int div = (PERIPH_FREQUENCY + baudrate/2) / baudrate;
|
int div = (pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] + baudrate/2) / baudrate;
|
||||||
|
|
||||||
plp_uart_setup(channel - ARCHI_UDMA_UART_ID(0), 0, div-1);
|
plp_uart_setup(channel - ARCHI_UDMA_UART_ID(0), 0, div-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,17 @@
|
||||||
* FPGA
|
* FPGA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ARCHI_FPGA_FREQUENCY 5000000
|
#ifndef ARCHI_FPGA_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_FREQUENCY 1000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_FC_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_FC_FREQUENCY 2000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_CL_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_CL_FREQUENCY 20000000
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* MEMORIES
|
* MEMORIES
|
||||||
*/
|
*/
|
||||||
|
|
@ -98,6 +107,7 @@
|
||||||
#define ARCHI_FC_CID 31
|
#define ARCHI_FC_CID 31
|
||||||
#define ARCHI_HAS_FC_ITC 1
|
#define ARCHI_HAS_FC_ITC 1
|
||||||
#define ARCHI_HAS_FC 1
|
#define ARCHI_HAS_FC 1
|
||||||
|
#define ARCHI_CORE_HAS_1_10 1
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,17 @@
|
||||||
* FPGA
|
* FPGA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_FREQUENCY
|
||||||
#define ARCHI_FPGA_FREQUENCY 5000000
|
#define ARCHI_FPGA_FREQUENCY 5000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_FC_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_FC_FREQUENCY 5000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_CL_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_CL_FREQUENCY 5000000
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MEMORIES
|
* MEMORIES
|
||||||
|
|
@ -99,6 +109,7 @@
|
||||||
#define ARCHI_FC_CID 31
|
#define ARCHI_FC_CID 31
|
||||||
#define ARCHI_HAS_FC_ITC 1
|
#define ARCHI_HAS_FC_ITC 1
|
||||||
#define ARCHI_HAS_FC 1
|
#define ARCHI_HAS_FC 1
|
||||||
|
#define ARCHI_CORE_HAS_1_10 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@
|
||||||
#define ARCHI_FPGA_FREQUENCY 5000000
|
#define ARCHI_FPGA_FREQUENCY 5000000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARCHI_FPGA_FC_FREQUENCY
|
||||||
|
#define ARCHI_FPGA_FC_FREQUENCY 5000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MEMORIES
|
* MEMORIES
|
||||||
|
|
@ -78,6 +82,7 @@
|
||||||
#define ARCHI_FC_CID 31
|
#define ARCHI_FC_CID 31
|
||||||
#define ARCHI_HAS_FC_ITC 1
|
#define ARCHI_HAS_FC_ITC 1
|
||||||
#define ARCHI_HAS_FC 1
|
#define ARCHI_HAS_FC 1
|
||||||
|
#define ARCHI_CORE_HAS_1_10 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,4 @@
|
||||||
#define PULP_CHIP_STR marsellus
|
#define PULP_CHIP_STR marsellus
|
||||||
#define PULP_CHIP_FAMILY_STR marsellus
|
#define PULP_CHIP_FAMILY_STR marsellus
|
||||||
|
|
||||||
#define PERIPH_FREQUENCY 50000000
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#define POS_FLL_PERIPH 1
|
#define POS_FLL_PERIPH 1
|
||||||
#define POS_FLL_FC 0
|
#define POS_FLL_FC 0
|
||||||
|
|
||||||
extern int pos_freq_domains[ARCHI_NB_FLL];
|
extern int pos_freq_domains[PI_FREQ_NB_DOMAINS];
|
||||||
|
|
||||||
|
|
||||||
void pos_soc_init();
|
void pos_soc_init();
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,4 @@
|
||||||
#define PULP_CHIP_STR pulp
|
#define PULP_CHIP_STR pulp
|
||||||
#define PULP_CHIP_FAMILY_STR pulp
|
#define PULP_CHIP_FAMILY_STR pulp
|
||||||
|
|
||||||
#define PERIPH_FREQUENCY 50000000
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#define POS_FLL_PERIPH 1
|
#define POS_FLL_PERIPH 1
|
||||||
#define POS_FLL_FC 0
|
#define POS_FLL_FC 0
|
||||||
|
|
||||||
extern int pos_freq_domains[ARCHI_NB_FLL];
|
extern int pos_freq_domains[PI_FREQ_NB_DOMAINS];
|
||||||
|
|
||||||
|
|
||||||
void pos_soc_init();
|
void pos_soc_init();
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,4 @@
|
||||||
#define PULP_CHIP_STR pulpissimo
|
#define PULP_CHIP_STR pulpissimo
|
||||||
#define PULP_CHIP_FAMILY_STR pulpissimo
|
#define PULP_CHIP_FAMILY_STR pulpissimo
|
||||||
|
|
||||||
#if __PLATFORM__ == ARCHI_PLATFORM_FPGA
|
|
||||||
#define PERIPH_FREQUENCY 5000000
|
|
||||||
#else
|
|
||||||
#define PERIPH_FREQUENCY 50000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#define POS_FLL_PERIPH 1
|
#define POS_FLL_PERIPH 1
|
||||||
#define POS_FLL_FC 0
|
#define POS_FLL_FC 0
|
||||||
|
|
||||||
extern int pos_freq_domains[ARCHI_NB_FLL];
|
extern int pos_freq_domains[PI_FREQ_NB_DOMAINS];
|
||||||
|
|
||||||
|
|
||||||
void pos_soc_init();
|
void pos_soc_init();
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,14 @@ static inline unsigned int timer_base_cl(int cid, int id, int sub_id)
|
||||||
return ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(0) + ARCHI_TIMER_OFFSET + id * ARCHI_TIMER_SIZE + sub_id * 4;
|
return ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(0) + ARCHI_TIMER_OFFSET + id * ARCHI_TIMER_SIZE + sub_id * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline unsigned int timer_base_cl(int cid, int id, int sub_id)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
void pos_irq_init();
|
void pos_irq_init();
|
||||||
|
|
||||||
void pos_irq_set_handler(int irq, void (*handler)());
|
void rt_irq_set_handler(int irq, void (*handler)());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline void pos_irq_mask_set(unsigned int mask)
|
static inline void rt_irq_mask_set(unsigned int mask)
|
||||||
{
|
{
|
||||||
#if defined(__RISCV_GENERIC__)
|
#if defined(__RISCV_GENERIC__)
|
||||||
// Generic riscv case, e.g. Ibex
|
// Generic riscv case, e.g. Ibex
|
||||||
|
|
@ -58,7 +58,7 @@ static inline void pos_irq_mask_set(unsigned int mask)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline void pos_irq_mask_clr(unsigned int mask)
|
static inline void rt_irq_mask_clr(unsigned int mask)
|
||||||
{
|
{
|
||||||
#if defined(__RISCV_GENERIC__)
|
#if defined(__RISCV_GENERIC__)
|
||||||
hal_spr_read_then_clr_from_reg(0x304, mask);
|
hal_spr_read_then_clr_from_reg(0x304, mask);
|
||||||
|
|
@ -82,7 +82,7 @@ static inline void pos_irq_mask_clr(unsigned int mask)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline void pos_irq_clr(unsigned int mask)
|
static inline void rt_irq_clr(unsigned int mask)
|
||||||
{
|
{
|
||||||
#if defined(__RISCV_GENERIC__)
|
#if defined(__RISCV_GENERIC__)
|
||||||
// TODO
|
// TODO
|
||||||
|
|
@ -101,7 +101,7 @@ static inline void pos_irq_clr(unsigned int mask)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int pos_irq_get_fc_vector_base()
|
static inline unsigned int rt_irq_get_fc_vector_base()
|
||||||
{
|
{
|
||||||
if (hal_is_fc())
|
if (hal_is_fc())
|
||||||
{
|
{
|
||||||
|
|
@ -118,7 +118,9 @@ static inline unsigned int pos_irq_get_fc_vector_base()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(ARCHI_HAS_CLUSTER)
|
#if defined(ARCHI_HAS_CLUSTER)
|
||||||
#if defined(ARCHI_CLUSTER_CTRL_ADDR)
|
#if defined(ARCHI_CORE_HAS_1_10)
|
||||||
|
return __builtin_pulp_spr_read(SR_MTVEC) & ~1;
|
||||||
|
#elif defined(ARCHI_CLUSTER_CTRL_ADDR)
|
||||||
return plp_ctrl_bootaddr_get();
|
return plp_ctrl_bootaddr_get();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -129,7 +131,7 @@ static inline unsigned int pos_irq_get_fc_vector_base()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline void pos_irq_set_fc_vector_base(unsigned int base)
|
static inline void rt_irq_set_fc_vector_base(unsigned int base)
|
||||||
{
|
{
|
||||||
if (hal_is_fc())
|
if (hal_is_fc())
|
||||||
{
|
{
|
||||||
|
|
@ -146,7 +148,9 @@ static inline void pos_irq_set_fc_vector_base(unsigned int base)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(ARCHI_HAS_CLUSTER)
|
#if defined(ARCHI_HAS_CLUSTER)
|
||||||
#if defined(ARCHI_CLUSTER_CTRL_ADDR)
|
#if defined(ARCHI_CORE_HAS_1_10)
|
||||||
|
__builtin_pulp_spr_write(SR_MTVEC, base | 1);
|
||||||
|
#elif defined(ARCHI_CLUSTER_CTRL_ADDR)
|
||||||
plp_ctrl_bootaddr_set(base);
|
plp_ctrl_bootaddr_set(base);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -154,7 +158,7 @@ static inline void pos_irq_set_fc_vector_base(unsigned int base)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void pos_irq_wait_for_interrupt()
|
static inline void rt_irq_wait_for_interrupt()
|
||||||
{
|
{
|
||||||
#if !defined(ARCHI_HAS_FC) || defined(ARCHI_HAS_FC_EU)
|
#if !defined(ARCHI_HAS_FC) || defined(ARCHI_HAS_FC_EU)
|
||||||
eu_evt_wait();
|
eu_evt_wait();
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,31 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PI_FREQ_DOMAIN_FC = 0,
|
PI_FREQ_DOMAIN_FC = 0,
|
||||||
PI_FREQ_DOMAIN_CL = 1,
|
PI_FREQ_DOMAIN_CL = 1,
|
||||||
PI_FREQ_DOMAIN_PERIPH = 2
|
PI_FREQ_DOMAIN_PERIPH = 2,
|
||||||
|
PI_FREQ_NB_DOMAINS = 3
|
||||||
} pi_freq_domain_e;
|
} pi_freq_domain_e;
|
||||||
|
|
||||||
|
#ifdef ARCHI_HAS_CLUSTER
|
||||||
|
|
||||||
void cluster_start(int cid, int (*entry)());
|
void cluster_start(int cid, int (*entry)());
|
||||||
|
|
||||||
void cluster_entry_stub();
|
void cluster_entry_stub();
|
||||||
|
|
||||||
int cluster_wait(int cid);
|
int cluster_wait(int cid);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline void cluster_start(int cid, int (*entry)())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int cluster_wait(int cid)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void _start();
|
void _start();
|
||||||
|
|
||||||
#include <implem/implem.h>
|
#include <implem/implem.h>
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,25 @@
|
||||||
|
|
||||||
void pos_soc_init()
|
void pos_soc_init()
|
||||||
{
|
{
|
||||||
|
#if __PLATFORM__ != ARCHI_PLATFORM_FPGA
|
||||||
|
|
||||||
pos_fll_constructor();
|
pos_fll_constructor();
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = pos_fll_init(POS_FLL_PERIPH);
|
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = pos_fll_init(POS_FLL_PERIPH);
|
||||||
|
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_CL] = pos_fll_init(POS_FLL_CL);
|
pos_freq_domains[PI_FREQ_DOMAIN_CL] = pos_fll_init(POS_FLL_CL);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY;
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY;
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_CL_FREQUENCY;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
void pos_soc_init()
|
void pos_soc_init()
|
||||||
{
|
{
|
||||||
|
#if __PLATFORM__ != ARCHI_PLATFORM_FPGA
|
||||||
|
|
||||||
pos_fll_constructor();
|
pos_fll_constructor();
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
||||||
|
|
@ -26,5 +28,15 @@ void pos_soc_init()
|
||||||
|
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_CL] = pos_fll_init(POS_FLL_CL);
|
pos_freq_domains[PI_FREQ_DOMAIN_CL] = pos_fll_init(POS_FLL_CL);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY;
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY;
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_CL] = ARCHI_FPGA_CL_FREQUENCY;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,20 @@
|
||||||
|
|
||||||
void pos_soc_init()
|
void pos_soc_init()
|
||||||
{
|
{
|
||||||
|
#if __PLATFORM__ != ARCHI_PLATFORM_FPGA
|
||||||
|
|
||||||
pos_fll_constructor();
|
pos_fll_constructor();
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = pos_fll_init(POS_FLL_FC);
|
||||||
|
|
||||||
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = pos_fll_init(POS_FLL_PERIPH);
|
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = pos_fll_init(POS_FLL_PERIPH);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_FC] = ARCHI_FPGA_FC_FREQUENCY;
|
||||||
|
|
||||||
|
pos_freq_domains[PI_FREQ_DOMAIN_PERIPH] = ARCHI_FPGA_FREQUENCY;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,14 @@ pos_init_entry:
|
||||||
csrr a0, 0xF14
|
csrr a0, 0xF14
|
||||||
andi a1, a0, 0x1f
|
andi a1, a0, 0x1f
|
||||||
srli a0, a0, 5
|
srli a0, a0, 5
|
||||||
|
#ifdef ARCHI_CL_BOOT
|
||||||
|
|
||||||
|
li a2, ARCHI_FC_CID
|
||||||
|
beq a0, a2, do_cl_boot
|
||||||
|
bnez a1, pe_start
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#ifdef ARCHI_FC_CID
|
#ifdef ARCHI_FC_CID
|
||||||
li a2, ARCHI_FC_CID
|
li a2, ARCHI_FC_CID
|
||||||
bne a0, a2, pe_start
|
bne a0, a2, pe_start
|
||||||
|
|
@ -41,6 +49,8 @@ pos_init_entry:
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Clear the bss segment
|
# Clear the bss segment
|
||||||
|
|
@ -89,7 +99,7 @@ pos_init_entry:
|
||||||
|
|
||||||
|
|
||||||
#ifdef ARCHI_CORE_HAS_1_10
|
#ifdef ARCHI_CORE_HAS_1_10
|
||||||
j pos_illegal_instr
|
j __rt_handle_illegal_instr
|
||||||
#else
|
#else
|
||||||
j pos_no_irq_handler
|
j pos_no_irq_handler
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -134,7 +144,7 @@ _start:
|
||||||
|
|
||||||
|
|
||||||
pos_illegal_instr:
|
pos_illegal_instr:
|
||||||
j pos_irq_illegal_instr
|
j __rt_handle_illegal_instr
|
||||||
|
|
||||||
pos_no_irq_handler:
|
pos_no_irq_handler:
|
||||||
mret
|
mret
|
||||||
|
|
@ -155,4 +165,17 @@ pe_start:
|
||||||
mul x1, x3, a1
|
mul x1, x3, a1
|
||||||
add x2, x2, x1
|
add x2, x2, x1
|
||||||
j cluster_entry_stub
|
j cluster_entry_stub
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
do_cl_boot:
|
||||||
|
li x2, 0x10200000
|
||||||
|
li x3, 0x1
|
||||||
|
la x4, _start
|
||||||
|
sw x4, 0x40(x2)
|
||||||
|
sw x3, 8(x2)
|
||||||
|
|
||||||
|
loop:
|
||||||
|
li x2, 0x1a109800
|
||||||
|
sw x0, 0(x2)
|
||||||
|
wfi
|
||||||
|
j loop
|
||||||
|
|
@ -98,9 +98,9 @@ void pos_freq_wait_convergence(int fll)
|
||||||
if ( mult_factor_diff <= tolerance)
|
if ( mult_factor_diff <= tolerance)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pos_irq_mask_set(1<<ARCHI_FC_EVT_CLK_REF);
|
rt_irq_mask_set(1<<ARCHI_FC_EVT_CLK_REF);
|
||||||
pos_irq_wait_for_interrupt();
|
rt_irq_wait_for_interrupt();
|
||||||
pos_irq_mask_clr(1<<ARCHI_FC_EVT_CLK_REF);
|
rt_irq_mask_clr(1<<ARCHI_FC_EVT_CLK_REF);
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
hal_irq_restore(irq);
|
hal_irq_restore(irq);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#include <pulp.h>
|
#include <pulp.h>
|
||||||
|
|
||||||
|
|
||||||
int pos_freq_domains[ARCHI_NB_FLL];
|
int pos_freq_domains[PI_FREQ_NB_DOMAINS];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
11
kernel/irq.c
11
kernel/irq.c
|
|
@ -43,7 +43,7 @@ static unsigned int pos_irq_get_itvec(unsigned int ItBaseAddr, unsigned int ItIn
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void pos_irq_set_handler(int irq, void (*handler)())
|
void rt_irq_set_handler(int irq, void (*handler)())
|
||||||
{
|
{
|
||||||
#if defined(__RISCV_GENERIC__)
|
#if defined(__RISCV_GENERIC__)
|
||||||
if (irq < 16)
|
if (irq < 16)
|
||||||
|
|
@ -52,7 +52,7 @@ void pos_irq_set_handler(int irq, void (*handler)())
|
||||||
irq -= 16;
|
irq -= 16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int base = pos_irq_get_fc_vector_base();
|
unsigned int base = rt_irq_get_fc_vector_base();
|
||||||
|
|
||||||
unsigned int jmpAddr = base + 0x4 * irq;
|
unsigned int jmpAddr = base + 0x4 * irq;
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ void pos_irq_set_handler(int irq, void (*handler)())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void pos_irq_illegal_instr()
|
void __rt_handle_illegal_instr()
|
||||||
{
|
{
|
||||||
//unsigned int mepc = hal_mepc_read();
|
//unsigned int mepc = hal_mepc_read();
|
||||||
//rt_warning("Reached illegal instruction (PC: 0x%x, opcode: 0x%x\n", mepc, *(int *)mepc);
|
//rt_warning("Reached illegal instruction (PC: 0x%x, opcode: 0x%x\n", mepc, *(int *)mepc);
|
||||||
|
|
@ -83,9 +83,10 @@ void pos_irq_init()
|
||||||
{
|
{
|
||||||
// We may enter the runtime with some interrupts active for example
|
// We may enter the runtime with some interrupts active for example
|
||||||
// if we force the boot to jump to the runtime through jtag.
|
// if we force the boot to jump to the runtime through jtag.
|
||||||
pos_irq_mask_clr(-1);
|
rt_irq_mask_clr(-1);
|
||||||
|
|
||||||
// As the FC code may not be at the beginning of the L2, set the
|
// As the FC code may not be at the beginning of the L2, set the
|
||||||
// vector base to get proper interrupt handlers
|
// vector base to get proper interrupt handlers
|
||||||
pos_irq_set_fc_vector_base(pos_irq_vector_base());
|
|
||||||
|
rt_irq_set_fc_vector_base(pos_irq_vector_base());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ VPATH = $(PULPRT_HOME)
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/src.mk
|
include $(PULPRT_HOME)/rules/pulpos/src.mk
|
||||||
|
|
||||||
|
PULP_CFLAGS += $(PULPRT_CONFIG_CFLAGS)
|
||||||
PULP_CFLAGS += -fno-jump-tables -fno-tree-loop-distribute-patterns
|
PULP_CFLAGS += -fno-jump-tables -fno-tree-loop-distribute-patterns
|
||||||
|
|
||||||
ifeq '$(CONFIG_LIBC_MINIMAL)' '1'
|
ifeq '$(CONFIG_LIBC_MINIMAL)' '1'
|
||||||
|
|
@ -75,6 +76,10 @@ ifdef CONFIG_NO_FC
|
||||||
PULP_CFLAGS += -DARCHI_NO_FC=1
|
PULP_CFLAGS += -DARCHI_NO_FC=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_CL_BOOT
|
||||||
|
PULP_CFLAGS += -DARCHI_CL_BOOT=1
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_IO_UART
|
ifdef CONFIG_IO_UART
|
||||||
PULP_CFLAGS += -DCONFIG_IO_UART=$(CONFIG_IO_UART)
|
PULP_CFLAGS += -DCONFIG_IO_UART=$(CONFIG_IO_UART)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,9 @@ PULP_SRCS += kernel/chips/marsellus/soc.c
|
||||||
|
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
||||||
|
|
||||||
|
ifeq '$(platform)' 'fpga'
|
||||||
|
CONFIG_IO_UART=1
|
||||||
|
endif
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
||||||
|
|
@ -41,4 +41,9 @@ PULP_SRCS += kernel/chips/pulp/soc.c
|
||||||
|
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
||||||
|
|
||||||
|
ifeq '$(platform)' 'fpga'
|
||||||
|
CONFIG_IO_UART=1
|
||||||
|
endif
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
||||||
|
|
@ -40,4 +40,9 @@ PULP_SRCS += kernel/chips/pulpissimo/soc.c
|
||||||
|
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
||||||
|
|
||||||
|
ifeq '$(platform)' 'fpga'
|
||||||
|
CONFIG_IO_UART=1
|
||||||
|
endif
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
include $(PULPRT_HOME)/rules/pulpos/default_rules.mk
|
||||||
Loading…
Reference in a new issue