mor1kx: Enable rotate, sign extend under linux, new fpu extension

My thought is that if we are running linux the FPGA should be able to
handle these extra instruction's footprint.  Also, since we are running
on linux there may be any kind of software running on the CPU, so allow
handling these instructions.

FPU is added bia a new +fpu extension.

But really, I am running GLIBC tests and they run faster with this
enabled.
This commit is contained in:
Stafford Horne 2020-12-19 23:51:32 +09:00
parent d90d3e043b
commit 51327e00b5
1 changed files with 15 additions and 3 deletions

View File

@ -15,7 +15,7 @@ from litex import get_data_mod
from litex.soc.interconnect import wishbone from litex.soc.interconnect import wishbone
from litex.soc.cores.cpu import CPU from litex.soc.cores.cpu import CPU
CPU_VARIANTS = ["standard", "linux"] CPU_VARIANTS = ["standard", "standard+fpu", "linux", "linux+fpu"]
class MOR1KX(CPU): class MOR1KX(CPU):
@ -51,6 +51,11 @@ class MOR1KX(CPU):
flags = "-mhard-mul " flags = "-mhard-mul "
flags += "-mhard-div " flags += "-mhard-div "
flags += "-D__mor1kx__ " flags += "-D__mor1kx__ "
if "linux" in self.variant:
flags += "-mror "
flags += "-msext "
return flags return flags
@property @property
@ -77,7 +82,7 @@ class MOR1KX(CPU):
self.memory_buses = [] self.memory_buses = []
if variant == "linux": if "linux" in variant:
self.mem_map = self.mem_map_linux self.mem_map = self.mem_map_linux
# # # # # #
@ -107,7 +112,12 @@ class MOR1KX(CPU):
p_DBUS_WB_TYPE = "B3_REGISTERED_FEEDBACK", p_DBUS_WB_TYPE = "B3_REGISTERED_FEEDBACK",
) )
if variant == "linux": if "fpu" in variant:
cpu_args.update(
p_FEATURE_FPU = "ENABLED",
)
if "linux" in variant:
cpu_args.update( cpu_args.update(
# Linux needs the memory management units. # Linux needs the memory management units.
p_FEATURE_IMMU = "ENABLED", p_FEATURE_IMMU = "ENABLED",
@ -115,6 +125,8 @@ class MOR1KX(CPU):
# FIXME: Currently we need the or1k timer when we should be # FIXME: Currently we need the or1k timer when we should be
# using the litex timer. # using the litex timer.
p_FEATURE_TIMER = "ENABLED", p_FEATURE_TIMER = "ENABLED",
p_FEATURE_ROR = "ENABLED",
p_FEATURE_EXT = "ENABLED",
) )
# FIXME: Check if these are needed? # FIXME: Check if these are needed?
use_defaults = ( use_defaults = (