cpu/picolibc: Add family property to CPUs and directly use it for picolibc.

This commit is contained in:
Florent Kermarrec 2021-09-28 14:17:57 +02:00
parent b451f102c6
commit 061b89beff
16 changed files with 16 additions and 15 deletions

View File

@ -55,6 +55,7 @@ GCC_FLAGS = {
# BlackParrotRV64 ----------------------------------------------------------------------------------
class BlackParrotRV64(CPU):
family = "riscv"
name = "blackparrot"
human_name = "BlackParrotRV64[imafd]"
variants = CPU_VARIANTS

View File

@ -355,6 +355,7 @@ class DebugModule(Module):
# CV32E40P -----------------------------------------------------------------------------------------
class CV32E40P(CPU):
family = "riscv"
name = "cv32e40p"
human_name = "CV32E40P"
variants = CPU_VARIANTS

View File

@ -18,6 +18,7 @@ CPU_VARIANTS = ["standard"]
# FemtoRV ------------------------------------------------------------------------------------------
class FemtoRV(CPU):
family = "riscv"
name = "femtorv"
human_name = "FemtoRV"
variants = CPU_VARIANTS

View File

@ -98,6 +98,7 @@ class OBI2Wishbone(Module):
# Ibex ---------------------------------------------------------------------------------------------
class Ibex(CPU):
family = "riscv"
name = "ibex"
human_name = "Ibex"
variants = CPU_VARIANTS

View File

@ -23,6 +23,7 @@ CPU_VARIANTS = ["minimal", "lite", "standard"]
# LM32 ---------------------------------------------------------------------------------------------
class LM32(CPU):
family = "lm32"
name = "lm32"
human_name = "LM32"
variants = CPU_VARIANTS

View File

@ -25,6 +25,7 @@ CPU_VARIANTS = ["standard", "standard+ghdl", "standard+irq", "standard+ghdl+irq"
# Microwatt ----------------------------------------------------------------------------------------
class Microwatt(CPU):
family = "powerpc"
name = "microwatt"
human_name = "Microwatt"
variants = CPU_VARIANTS

View File

@ -21,6 +21,7 @@ CPU_VARIANTS = ["standard"]
# Minerva ------------------------------------------------------------------------------------------
class Minerva(CPU):
family = "riscv"
name = "minerva"
human_name = "Minerva"
variants = CPU_VARIANTS

View File

@ -22,6 +22,7 @@ CPU_VARIANTS = ["standard", "standard+fpu", "linux", "linux+fpu", "linux+smp", "
# Mor1kx -------------------------------------------------------------------------------------------
class MOR1KX(CPU):
family = "or1k"
name = "mor1kx"
human_name = "MOR1KX"
variants = CPU_VARIANTS

View File

@ -37,6 +37,7 @@ GCC_FLAGS = {
# PicoRV32 -----------------------------------------------------------------------------------------
class PicoRV32(CPU):
family = "riscv"
name = "picorv32"
human_name = "PicoRV32"
variants = CPU_VARIANTS

View File

@ -83,6 +83,7 @@ CPU_SIZE_PARAMS = {
# Rocket RV64 --------------------------------------------------------------------------------------
class RocketRV64(CPU):
family = "riscv"
name = "rocket"
human_name = "RocketRV64[imac]"
variants = CPU_VARIANTS

View File

@ -20,6 +20,7 @@ CPU_VARIANTS = ["standard"]
# SERV ---------------------------------------------------------------------------------------------
class SERV(CPU):
family = "riscv"
name = "serv"
human_name = "SERV"
variants = CPU_VARIANTS

View File

@ -93,6 +93,7 @@ class VexRiscvTimer(Module, AutoCSR):
# VexRiscv -----------------------------------------------------------------------------------------
class VexRiscv(CPU, AutoCSR):
family = "riscv"
name = "vexriscv"
human_name = "VexRiscv"
variants = CPU_VARIANTS

View File

@ -30,6 +30,7 @@ CPU_VARIANTS = {
# VexRiscv SMP -------------------------------------------------------------------------------------
class VexRiscvSMP(CPU):
family = "riscv"
name = "vexriscv"
human_name = "VexRiscv SMP"
variants = CPU_VARIANTS

View File

@ -19,6 +19,7 @@ from litex.soc.cores.cpu import CPU
class Zynq7000(CPU):
variants = ["standard"]
family = "arm"
name = "zynq7000"
human_name = "Zynq7000"
data_width = 32

View File

@ -92,6 +92,7 @@ def get_cpu_mak(cpu, compile_software):
return [
("TRIPLE", select_triple(triple)),
("CPU", cpu.name),
("CPUFAMILY", cpu.family),
("CPUFLAGS", flags),
("CPUENDIANNESS", cpu.endianness),
("CLANG", str(int(clang))),

View File

@ -3,24 +3,10 @@ include $(SOC_DIRECTORY)/software/common.mak
all: libc.a stdio.c.o missing.c.o
CPUFAMILY=
CFLAGS = $(COMMONFLAGS) -fexceptions -Wpragmas
# FIXME: Generate from Python.
ifneq ($(findstring $(CPU), serv femtorv picorv32 minerva vexriscv vexriscv_smp ibex cv32e40p rocket blackparrot),)
CPUFAMILY = riscv
else ifeq ($(CPU), lm32)
CPUFAMILY = lm32
else ifeq ($(CPU), mor1kx)
CPUFAMILY = or1k
else ifeq ($(CPU), microwatt)
CPUFAMILY = powerpc
ifeq ($(CPU), microwatt)
CFLAGS += -DLONG_LONG_MIN=LLONG_MIN -DLONG_LONG_MAX=LLONG_MAX -DLONG_LONG_MIN=LLONG_MIN -DULONG_LONG_MAX=ULLONG_MAX
else ifeq ($(CPU), zynq7000)
CPUFAMILY = arm
else
$(error Unsupported CPU)
endif
define CROSSFILE