cpu/picolibc: Add family property to CPUs and directly use it for picolibc.
This commit is contained in:
parent
b451f102c6
commit
061b89beff
|
@ -55,6 +55,7 @@ GCC_FLAGS = {
|
||||||
# BlackParrotRV64 ----------------------------------------------------------------------------------
|
# BlackParrotRV64 ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BlackParrotRV64(CPU):
|
class BlackParrotRV64(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "blackparrot"
|
name = "blackparrot"
|
||||||
human_name = "BlackParrotRV64[imafd]"
|
human_name = "BlackParrotRV64[imafd]"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -355,6 +355,7 @@ class DebugModule(Module):
|
||||||
# CV32E40P -----------------------------------------------------------------------------------------
|
# CV32E40P -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class CV32E40P(CPU):
|
class CV32E40P(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "cv32e40p"
|
name = "cv32e40p"
|
||||||
human_name = "CV32E40P"
|
human_name = "CV32E40P"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -18,6 +18,7 @@ CPU_VARIANTS = ["standard"]
|
||||||
# FemtoRV ------------------------------------------------------------------------------------------
|
# FemtoRV ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class FemtoRV(CPU):
|
class FemtoRV(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "femtorv"
|
name = "femtorv"
|
||||||
human_name = "FemtoRV"
|
human_name = "FemtoRV"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -98,6 +98,7 @@ class OBI2Wishbone(Module):
|
||||||
# Ibex ---------------------------------------------------------------------------------------------
|
# Ibex ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class Ibex(CPU):
|
class Ibex(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "ibex"
|
name = "ibex"
|
||||||
human_name = "Ibex"
|
human_name = "Ibex"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -23,6 +23,7 @@ CPU_VARIANTS = ["minimal", "lite", "standard"]
|
||||||
# LM32 ---------------------------------------------------------------------------------------------
|
# LM32 ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class LM32(CPU):
|
class LM32(CPU):
|
||||||
|
family = "lm32"
|
||||||
name = "lm32"
|
name = "lm32"
|
||||||
human_name = "LM32"
|
human_name = "LM32"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -25,6 +25,7 @@ CPU_VARIANTS = ["standard", "standard+ghdl", "standard+irq", "standard+ghdl+irq"
|
||||||
# Microwatt ----------------------------------------------------------------------------------------
|
# Microwatt ----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class Microwatt(CPU):
|
class Microwatt(CPU):
|
||||||
|
family = "powerpc"
|
||||||
name = "microwatt"
|
name = "microwatt"
|
||||||
human_name = "Microwatt"
|
human_name = "Microwatt"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -21,6 +21,7 @@ CPU_VARIANTS = ["standard"]
|
||||||
# Minerva ------------------------------------------------------------------------------------------
|
# Minerva ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class Minerva(CPU):
|
class Minerva(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "minerva"
|
name = "minerva"
|
||||||
human_name = "Minerva"
|
human_name = "Minerva"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -22,6 +22,7 @@ CPU_VARIANTS = ["standard", "standard+fpu", "linux", "linux+fpu", "linux+smp", "
|
||||||
# Mor1kx -------------------------------------------------------------------------------------------
|
# Mor1kx -------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class MOR1KX(CPU):
|
class MOR1KX(CPU):
|
||||||
|
family = "or1k"
|
||||||
name = "mor1kx"
|
name = "mor1kx"
|
||||||
human_name = "MOR1KX"
|
human_name = "MOR1KX"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -37,6 +37,7 @@ GCC_FLAGS = {
|
||||||
# PicoRV32 -----------------------------------------------------------------------------------------
|
# PicoRV32 -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class PicoRV32(CPU):
|
class PicoRV32(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "picorv32"
|
name = "picorv32"
|
||||||
human_name = "PicoRV32"
|
human_name = "PicoRV32"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -83,6 +83,7 @@ CPU_SIZE_PARAMS = {
|
||||||
# Rocket RV64 --------------------------------------------------------------------------------------
|
# Rocket RV64 --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class RocketRV64(CPU):
|
class RocketRV64(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "rocket"
|
name = "rocket"
|
||||||
human_name = "RocketRV64[imac]"
|
human_name = "RocketRV64[imac]"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -20,6 +20,7 @@ CPU_VARIANTS = ["standard"]
|
||||||
# SERV ---------------------------------------------------------------------------------------------
|
# SERV ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class SERV(CPU):
|
class SERV(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "serv"
|
name = "serv"
|
||||||
human_name = "SERV"
|
human_name = "SERV"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -93,6 +93,7 @@ class VexRiscvTimer(Module, AutoCSR):
|
||||||
# VexRiscv -----------------------------------------------------------------------------------------
|
# VexRiscv -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class VexRiscv(CPU, AutoCSR):
|
class VexRiscv(CPU, AutoCSR):
|
||||||
|
family = "riscv"
|
||||||
name = "vexriscv"
|
name = "vexriscv"
|
||||||
human_name = "VexRiscv"
|
human_name = "VexRiscv"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -30,6 +30,7 @@ CPU_VARIANTS = {
|
||||||
# VexRiscv SMP -------------------------------------------------------------------------------------
|
# VexRiscv SMP -------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class VexRiscvSMP(CPU):
|
class VexRiscvSMP(CPU):
|
||||||
|
family = "riscv"
|
||||||
name = "vexriscv"
|
name = "vexriscv"
|
||||||
human_name = "VexRiscv SMP"
|
human_name = "VexRiscv SMP"
|
||||||
variants = CPU_VARIANTS
|
variants = CPU_VARIANTS
|
||||||
|
|
|
@ -19,6 +19,7 @@ from litex.soc.cores.cpu import CPU
|
||||||
|
|
||||||
class Zynq7000(CPU):
|
class Zynq7000(CPU):
|
||||||
variants = ["standard"]
|
variants = ["standard"]
|
||||||
|
family = "arm"
|
||||||
name = "zynq7000"
|
name = "zynq7000"
|
||||||
human_name = "Zynq7000"
|
human_name = "Zynq7000"
|
||||||
data_width = 32
|
data_width = 32
|
||||||
|
|
|
@ -92,6 +92,7 @@ def get_cpu_mak(cpu, compile_software):
|
||||||
return [
|
return [
|
||||||
("TRIPLE", select_triple(triple)),
|
("TRIPLE", select_triple(triple)),
|
||||||
("CPU", cpu.name),
|
("CPU", cpu.name),
|
||||||
|
("CPUFAMILY", cpu.family),
|
||||||
("CPUFLAGS", flags),
|
("CPUFLAGS", flags),
|
||||||
("CPUENDIANNESS", cpu.endianness),
|
("CPUENDIANNESS", cpu.endianness),
|
||||||
("CLANG", str(int(clang))),
|
("CLANG", str(int(clang))),
|
||||||
|
|
|
@ -3,24 +3,10 @@ include $(SOC_DIRECTORY)/software/common.mak
|
||||||
|
|
||||||
all: libc.a stdio.c.o missing.c.o
|
all: libc.a stdio.c.o missing.c.o
|
||||||
|
|
||||||
CPUFAMILY=
|
|
||||||
|
|
||||||
CFLAGS = $(COMMONFLAGS) -fexceptions -Wpragmas
|
CFLAGS = $(COMMONFLAGS) -fexceptions -Wpragmas
|
||||||
|
|
||||||
# FIXME: Generate from Python.
|
ifeq ($(CPU), microwatt)
|
||||||
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
|
|
||||||
CFLAGS += -DLONG_LONG_MIN=LLONG_MIN -DLONG_LONG_MAX=LLONG_MAX -DLONG_LONG_MIN=LLONG_MIN -DULONG_LONG_MAX=ULLONG_MAX
|
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
|
endif
|
||||||
|
|
||||||
define CROSSFILE
|
define CROSSFILE
|
||||||
|
|
Loading…
Reference in New Issue