From 0898e101e25f451a1dff8a714c2b7df37a8ae30c Mon Sep 17 00:00:00 2001 From: occheung Date: Mon, 8 Nov 2021 12:51:50 +0800 Subject: [PATCH] board_misoc: reuse riscv dir for comm & kernel --- artiq/firmware/libboard_misoc/build.rs | 9 +++------ artiq/firmware/libboard_misoc/lib.rs | 2 +- .../libboard_misoc/{riscv32ima => riscv32}/boot.rs | 0 .../libboard_misoc/{riscv32ima => riscv32}/cache.rs | 0 .../libboard_misoc/{riscv32ima => riscv32}/mod.rs | 0 .../libboard_misoc/{riscv32ima => riscv32}/pmp.rs | 0 .../libboard_misoc/{riscv32ima => riscv32}/vectors.S | 0 7 files changed, 4 insertions(+), 7 deletions(-) rename artiq/firmware/libboard_misoc/{riscv32ima => riscv32}/boot.rs (100%) rename artiq/firmware/libboard_misoc/{riscv32ima => riscv32}/cache.rs (100%) rename artiq/firmware/libboard_misoc/{riscv32ima => riscv32}/mod.rs (100%) rename artiq/firmware/libboard_misoc/{riscv32ima => riscv32}/pmp.rs (100%) rename artiq/firmware/libboard_misoc/{riscv32ima => riscv32}/vectors.S (100%) diff --git a/artiq/firmware/libboard_misoc/build.rs b/artiq/firmware/libboard_misoc/build.rs index 8160db88a..11d5aac2f 100644 --- a/artiq/firmware/libboard_misoc/build.rs +++ b/artiq/firmware/libboard_misoc/build.rs @@ -1,19 +1,16 @@ extern crate build_misoc; extern crate cc; -use std::env; use std::path::Path; fn main() { build_misoc::cfg(); - let triple = env::var("TARGET").unwrap(); - let arch = triple.split("-").next().unwrap(); - let vectors_path = Path::new(arch).join("vectors.S"); + let vectors_path = "riscv32/vectors.S"; - println!("cargo:rerun-if-changed={}", vectors_path.to_str().unwrap()); + println!("cargo:rerun-if-changed={}", vectors_path); cc::Build::new() .flag("--target=riscv32-unknown-elf") - .file(vectors_path) + .file(Path::new(vectors_path)) .compile("vectors"); } diff --git a/artiq/firmware/libboard_misoc/lib.rs b/artiq/firmware/libboard_misoc/lib.rs index 729f4d63b..3189ccfcd 100644 --- a/artiq/firmware/libboard_misoc/lib.rs +++ b/artiq/firmware/libboard_misoc/lib.rs @@ -8,7 +8,7 @@ extern crate log; extern crate smoltcp; #[cfg(target_arch = "riscv32")] -#[path = "riscv32ima/mod.rs"] +#[path = "riscv32/mod.rs"] mod arch; #[cfg(target_arch = "riscv32")] diff --git a/artiq/firmware/libboard_misoc/riscv32ima/boot.rs b/artiq/firmware/libboard_misoc/riscv32/boot.rs similarity index 100% rename from artiq/firmware/libboard_misoc/riscv32ima/boot.rs rename to artiq/firmware/libboard_misoc/riscv32/boot.rs diff --git a/artiq/firmware/libboard_misoc/riscv32ima/cache.rs b/artiq/firmware/libboard_misoc/riscv32/cache.rs similarity index 100% rename from artiq/firmware/libboard_misoc/riscv32ima/cache.rs rename to artiq/firmware/libboard_misoc/riscv32/cache.rs diff --git a/artiq/firmware/libboard_misoc/riscv32ima/mod.rs b/artiq/firmware/libboard_misoc/riscv32/mod.rs similarity index 100% rename from artiq/firmware/libboard_misoc/riscv32ima/mod.rs rename to artiq/firmware/libboard_misoc/riscv32/mod.rs diff --git a/artiq/firmware/libboard_misoc/riscv32ima/pmp.rs b/artiq/firmware/libboard_misoc/riscv32/pmp.rs similarity index 100% rename from artiq/firmware/libboard_misoc/riscv32ima/pmp.rs rename to artiq/firmware/libboard_misoc/riscv32/pmp.rs diff --git a/artiq/firmware/libboard_misoc/riscv32ima/vectors.S b/artiq/firmware/libboard_misoc/riscv32/vectors.S similarity index 100% rename from artiq/firmware/libboard_misoc/riscv32ima/vectors.S rename to artiq/firmware/libboard_misoc/riscv32/vectors.S