forked from M-Labs/artiq-zynq
Compare commits
5 Commits
master
...
refactor_n
Author | SHA1 | Date |
---|---|---|
abdul124 | 131fb6b57a | |
abdul124 | 186a112a84 | |
abdul124 | e55d9a752d | |
abdul124 | 4cd4eddfc4 | |
abdul124 | e85357f9e8 |
21
flake.lock
21
flake.lock
|
@ -11,11 +11,11 @@
|
||||||
"src-pythonparser": "src-pythonparser"
|
"src-pythonparser": "src-pythonparser"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724210813,
|
"lastModified": 1722417433,
|
||||||
"narHash": "sha256-OqQdE2lC0jKNS2fFq0Fda1nBpyT8ijmSXqdkO8xeOJ8=",
|
"narHash": "sha256-QEbcVdL1sUQEbMCvCUvPM8DKqwOth3gJpdiLTf4hPN8=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "61e96b37f9c4345e2d7bf71d47ba0b5e947de83e",
|
"rev": "0623480c82c28d57e14dc4f363374758a52284d3",
|
||||||
"revCount": 8985,
|
"revCount": 8952,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/m-labs/artiq.git"
|
"url": "https://github.com/m-labs/artiq.git"
|
||||||
},
|
},
|
||||||
|
@ -102,11 +102,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723362943,
|
"lastModified": 1721924956,
|
||||||
"narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=",
|
"narHash": "sha256-Sb1jlyRO+N8jBXEX9Pg9Z1Qb8Bw9QyOgLDNMEpmjZ2M=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a58bc8ad779655e790115244571758e8de055e3d",
|
"rev": "5ad6a14c6bf098e98800b091668718c336effc95",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -131,16 +131,15 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719454714,
|
"lastModified": 1722046723,
|
||||||
"narHash": "sha256-MojqG0lyUINkEk0b3kM2drsU5vyaF8DFZe/FAlZVOGs=",
|
"narHash": "sha256-G7/gHz8ORRvHd1/RIURrdcswKRPe9K0FsIYR4v5jSWo=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "d1c527659cf076ecc4b96a91c702d080b213801e",
|
"rev": "56baac5e6b2743d4730e664ea64f6d8a2aad0fbb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"ref": "snapshot/2024-08-01",
|
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ manifests: $(manifests)
|
||||||
../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(manifests) $(shell find . -type f -not -name Cargo.toml -print)
|
../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(manifests) $(shell find . -type f -not -name Cargo.toml -print)
|
||||||
cd runtime && \
|
cd runtime && \
|
||||||
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
|
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
|
||||||
cargo xbuild --release \
|
cargo xbuild --release --locked \
|
||||||
--target-dir ../../build/firmware \
|
--target-dir ../../build/firmware \
|
||||||
--no-default-features --features=target_$(TARGET)
|
--no-default-features --features=target_$(TARGET)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ manifests: $(manifests)
|
||||||
../build/firmware/armv7-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(manifests) $(shell find . -type f -not -name Cargo.toml -print)
|
../build/firmware/armv7-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(manifests) $(shell find . -type f -not -name Cargo.toml -print)
|
||||||
cd satman && \
|
cd satman && \
|
||||||
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
|
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
|
||||||
cargo xbuild --release \
|
cargo xbuild --release --locked \
|
||||||
--target-dir ../../build/firmware \
|
--target-dir ../../build/firmware \
|
||||||
--no-default-features --features=target_$(TARGET)
|
--no-default-features --features=target_$(TARGET)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
use core::mem;
|
use core::mem;
|
||||||
|
|
||||||
use core_io::Error as ReadError;
|
use core_io::Error as ReadError;
|
||||||
use cslice::{AsCSlice, CSlice};
|
use cslice::CSlice;
|
||||||
use dwarf::eh::{self, EHAction, EHContext};
|
use dwarf::eh::{self, EHAction, EHContext};
|
||||||
use io::{Cursor, ProtoRead};
|
use io::{Cursor, ProtoRead};
|
||||||
use libc::{c_int, c_void, uintptr_t};
|
use libc::{c_int, c_void, uintptr_t};
|
||||||
|
@ -222,6 +222,8 @@ pub unsafe fn artiq_personality(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe extern "C" fn raise(exception: *const Exception) -> ! {
|
pub unsafe extern "C" fn raise(exception: *const Exception) -> ! {
|
||||||
|
use cslice::AsCSlice;
|
||||||
|
|
||||||
let count = EXCEPTION_BUFFER.exception_count;
|
let count = EXCEPTION_BUFFER.exception_count;
|
||||||
let stack = &mut EXCEPTION_BUFFER.exception_stack;
|
let stack = &mut EXCEPTION_BUFFER.exception_stack;
|
||||||
let diff = exception as isize - EXCEPTION_BUFFER.exceptions.as_ptr() as isize;
|
let diff = exception as isize - EXCEPTION_BUFFER.exceptions.as_ptr() as isize;
|
||||||
|
@ -475,30 +477,20 @@ extern "C" fn stop_fn(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must be kept in sync with preallocate_runtime_exception_names() in `artiq.compiler.embedding`
|
// Must be kept in sync with preallocate_runtime_exception_names() in artiq/language/embedding_map.py
|
||||||
static EXCEPTION_ID_LOOKUP: [(&str, u32); 22] = [
|
static EXCEPTION_ID_LOOKUP: [(&str, u32); 12] = [
|
||||||
("RTIOUnderflow", 0),
|
("RuntimeError", 0),
|
||||||
("RTIOOverflow", 1),
|
("RTIOUnderflow", 1),
|
||||||
("RTIODestinationUnreachable", 2),
|
("RTIOOverflow", 2),
|
||||||
("DMAError", 3),
|
("RTIODestinationUnreachable", 3),
|
||||||
("I2CError", 4),
|
("DMAError", 4),
|
||||||
("CacheError", 5),
|
("I2CError", 5),
|
||||||
("SPIError", 6),
|
("CacheError", 6),
|
||||||
("SubkernelError", 7),
|
("SPIError", 7),
|
||||||
("AssertionError", 8),
|
("ZeroDivisionError", 8),
|
||||||
("AttributeError", 9),
|
("IndexError", 9),
|
||||||
("IndexError", 10),
|
("UnwrapNoneError", 10),
|
||||||
("IOError", 11),
|
("SubkernelError", 11),
|
||||||
("KeyError", 12),
|
|
||||||
("NotImplementedError", 13),
|
|
||||||
("OverflowError", 14),
|
|
||||||
("RuntimeError", 15),
|
|
||||||
("TimeoutError", 16),
|
|
||||||
("TypeError", 17),
|
|
||||||
("ValueError", 18),
|
|
||||||
("ZeroDivisionError", 19),
|
|
||||||
("LinAlgError", 20),
|
|
||||||
("UnwrapNoneError", 21),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
pub fn get_exception_id(name: &str) -> u32 {
|
pub fn get_exception_id(name: &str) -> u32 {
|
||||||
|
@ -533,29 +525,3 @@ macro_rules! artiq_raise {
|
||||||
}};
|
}};
|
||||||
($name:expr, $message:expr) => {{ artiq_raise!($name, $message, 0, 0, 0) }};
|
($name:expr, $message:expr) => {{ artiq_raise!($name, $message, 0, 0, 0) }};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Takes as input exception id from host
|
|
||||||
/// Generates a new exception with:
|
|
||||||
/// * `id` set to `exn_id`
|
|
||||||
/// * `message` set to corresponding exception name from `EXCEPTION_ID_LOOKUP`
|
|
||||||
///
|
|
||||||
/// The message is matched on host to ensure correct exception is being referred
|
|
||||||
/// This test checks the synchronization of exception ids for runtime errors
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn test_exception_id_sync(exn_id: u32) {
|
|
||||||
let message = EXCEPTION_ID_LOOKUP
|
|
||||||
.iter()
|
|
||||||
.find_map(|&(name, id)| if id == exn_id { Some(name) } else { None })
|
|
||||||
.unwrap_or("unallocated internal exception id");
|
|
||||||
|
|
||||||
let exn = Exception {
|
|
||||||
id: exn_id,
|
|
||||||
file: file!().as_c_slice(),
|
|
||||||
line: 0,
|
|
||||||
column: 0,
|
|
||||||
function: "test_exception_id_sync".as_c_slice(),
|
|
||||||
message: message.as_c_slice(),
|
|
||||||
param: [0, 0, 0],
|
|
||||||
};
|
|
||||||
unsafe { raise(&exn) };
|
|
||||||
}
|
|
||||||
|
|
|
@ -332,13 +332,6 @@ pub fn resolve(required: &[u8]) -> Option<u32> {
|
||||||
api!(sp_linalg_schur = linalg::sp_linalg_schur),
|
api!(sp_linalg_schur = linalg::sp_linalg_schur),
|
||||||
api!(sp_linalg_hessenberg = linalg::sp_linalg_hessenberg),
|
api!(sp_linalg_hessenberg = linalg::sp_linalg_hessenberg),
|
||||||
|
|
||||||
/*
|
|
||||||
* syscall for unit tests
|
|
||||||
* Used in `artiq.tests.coredevice.test_exceptions.ExceptionTest.test_raise_exceptions_kernel`
|
|
||||||
* This syscall checks that the exception IDs used in the Python `EmbeddingMap` (in `artiq.language.embedding`)
|
|
||||||
* match the `EXCEPTION_ID_LOOKUP` defined in the firmware (`libksupport::src::eh_artiq`)
|
|
||||||
*/
|
|
||||||
api!(test_exception_id_sync = eh_artiq::test_exception_id_sync)
|
|
||||||
];
|
];
|
||||||
api.iter()
|
api.iter()
|
||||||
.find(|&&(exported, _)| exported.as_bytes() == required)
|
.find(|&&(exported, _)| exported.as_bytes() == required)
|
||||||
|
|
Loading…
Reference in New Issue