From 6ba514ee963ff7fa6c839aeb3089319d239ba590 Mon Sep 17 00:00:00 2001 From: developandplay <34752929+developandplay@users.noreply.github.com> Date: Tue, 27 Jul 2021 00:42:14 +0200 Subject: [PATCH 1/2] Separate BlackParrot code from adapter code --- litex/soc/cores/cpu/blackparrot/core.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/litex/soc/cores/cpu/blackparrot/core.py b/litex/soc/cores/cpu/blackparrot/core.py index 930fab8f2..ae89ee59a 100644 --- a/litex/soc/cores/cpu/blackparrot/core.py +++ b/litex/soc/cores/cpu/blackparrot/core.py @@ -114,21 +114,23 @@ class BlackParrotRV64(CPU): # Copy config loader to /tmp vdir = get_data_mod("cpu", "blackparrot").data_location + blackparrot = os.path.join(vdir, "black-parrot") bp_litex = os.path.join(vdir, "bp_litex") copyfile(os.path.join(bp_litex, "cce_ucode.mem"), "/tmp/cce_ucode.mem") # Set environmental variables - os.environ["BP"] = vdir + os.environ["BP"] = blackparrot os.environ["BP_LITEX_DIR"] = bp_litex - os.environ["BP_COMMON_DIR"] = os.path.join(vdir, "bp_common") - os.environ["BP_FE_DIR"] = os.path.join(vdir, "bp_fe") - os.environ["BP_BE_DIR"] = os.path.join(vdir, "bp_be") - os.environ["BP_ME_DIR"] = os.path.join(vdir, "bp_me") - os.environ["BP_TOP_DIR"] = os.path.join(vdir, "bp_top") - external = os.path.join(vdir, "external") + os.environ["BP_COMMON_DIR"] = os.path.join(blackparrot, "bp_common") + os.environ["BP_FE_DIR"] = os.path.join(blackparrot, "bp_fe") + os.environ["BP_BE_DIR"] = os.path.join(blackparrot, "bp_be") + os.environ["BP_ME_DIR"] = os.path.join(blackparrot, "bp_me") + os.environ["BP_TOP_DIR"] = os.path.join(blackparrot, "bp_top") + external = os.path.join(blackparrot, "external") os.environ["BP_EXTERNAL_DIR"] = external os.environ["BASEJUMP_STL_DIR"] = os.path.join(external, "basejump_stl") + os.environ["HARDFLOAT_DIR"] = os.path.join(external, "HardFloat") os.environ["LITEX_FPGA_DIR"] = os.path.join(bp_litex, "fpga") os.environ["LITEX_SIMU_DIR"] = os.path.join(bp_litex, "simulation") From c36e2ae4e81d75713c0b7bb3b6fb2fb3ee223818 Mon Sep 17 00:00:00 2001 From: developandplay <34752929+developandplay@users.noreply.github.com> Date: Tue, 27 Jul 2021 00:44:15 +0200 Subject: [PATCH 2/2] Add imafd support --- litex/soc/cores/cpu/blackparrot/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litex/soc/cores/cpu/blackparrot/core.py b/litex/soc/cores/cpu/blackparrot/core.py index ae89ee59a..b73cffbb9 100644 --- a/litex/soc/cores/cpu/blackparrot/core.py +++ b/litex/soc/cores/cpu/blackparrot/core.py @@ -48,15 +48,15 @@ CPU_VARIANTS = ["standard", "sim"] # GCC Flags ---------------------------------------------------------------------------------------- GCC_FLAGS = { - "standard": "-march=rv64ima -mabi=lp64 ", - "sim": "-march=rv64ima -mabi=lp64 ", + "standard": "-march=rv64imafd -mabi=lp64d ", + "sim": "-march=rv64imafd -mabi=lp64d ", } # BlackParrotRV64 ---------------------------------------------------------------------------------- class BlackParrotRV64(CPU): name = "blackparrot" - human_name = "BlackParrotRV64[ima]" + human_name = "BlackParrotRV64[imafd]" variants = CPU_VARIANTS data_width = 64 endianness = "little"