Renaming powdr-riscv-syscalls to powdr-syscalls. (#2583)

To reflect it is useful to other frontends, as well.
This commit is contained in:
Lucas Clemente Vella
2025-03-24 15:37:06 -03:00
committed by GitHub
parent 7679497165
commit ddc3510fff
19 changed files with 54 additions and 42 deletions

View File

@@ -27,7 +27,7 @@ members = [
"isa-utils",
"airgen",
"riscv-executor",
"riscv-syscalls",
"syscalls",
"schemas",
"backend-utils",
"executor-utils",
@@ -67,7 +67,7 @@ powdr-pipeline = { path = "./pipeline", version = "0.1.4" }
powdr-plonky3 = { path = "./plonky3", version = "0.1.4" }
powdr-riscv = { path = "./riscv", version = "0.1.4" }
powdr-riscv-executor = { path = "./riscv-executor", version = "0.1.4" }
powdr-riscv-syscalls = { path = "./riscv-syscalls", version = "0.1.4" }
powdr-syscalls = { path = "./syscalls", version = "0.1.4" }
powdr-schemas = { path = "./schemas", version = "0.1.4" }
[profile.pr-tests]

View File

@@ -8,9 +8,15 @@ homepage = "https://powdr.org"
repository = "https://github.com/powdr-labs/powdr"
[dependencies]
serde = { version = "1.0", default-features = false, features = ["alloc", "derive", "rc"] }
serde_cbor = { version = "0.11.2", default-features = false, features = ["alloc"] }
powdr-riscv-syscalls = { path = "../riscv-syscalls", version = "0.1.4" }
serde = { version = "1.0", default-features = false, features = [
"alloc",
"derive",
"rc",
] }
serde_cbor = { version = "0.11.2", default-features = false, features = [
"alloc",
] }
powdr-syscalls = { path = "../syscalls", version = "0.1.4" }
getrandom = { version = "0.2", features = ["custom"], optional = true }
spin = "0.9"

View File

@@ -1,6 +1,6 @@
use core::arch::asm;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use crate::ecall;

View File

@@ -1,7 +1,7 @@
use core::arch::asm;
use crate::arith::{bes_to_u32, u32x16_to_be};
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
/// Add two k256 ec points. Coordinates are big-endian u8 arrays.
pub fn add_u8_be(ax: [u8; 32], ay: [u8; 32], bx: [u8; 32], by: [u8; 32]) -> [u8; 64] {

View File

@@ -1,7 +1,7 @@
use core::arch::asm;
use core::fmt;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
#[macro_export]
macro_rules! print {

View File

@@ -1,5 +1,5 @@
use core::{arch::asm, mem::MaybeUninit};
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
pub const PRIME: u64 = 0xffffffff00000001;

View File

@@ -3,7 +3,7 @@ use core::convert::TryInto;
use core::mem::MaybeUninit;
use crate::goldilocks::{Goldilocks, OpaqueGoldilocks};
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
pub fn native_hash(data: &mut [u64; 12]) -> &[u64; 4] {
unsafe {

View File

@@ -4,7 +4,7 @@ use core::slice;
extern crate alloc;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use alloc::vec;
use alloc::vec::Vec;

View File

@@ -28,7 +28,7 @@ mod no_std_support;
mod std_support;
use core::arch::{asm, global_asm};
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
#[no_mangle]
pub fn halt() -> ! {

View File

@@ -9,7 +9,7 @@
use core::{alloc::Layout, arch::asm, slice};
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use crate::io::write_slice;

View File

@@ -26,7 +26,7 @@ powdr-parser.workspace = true
powdr-parser-util.workspace = true
powdr-pipeline.workspace = true
powdr-riscv-executor.workspace = true
powdr-riscv-syscalls.workspace = true
powdr-syscalls.workspace = true
gimli = "0.31"
goblin = "0.8"

View File

@@ -14,7 +14,7 @@ use goblin::elf::{
};
use itertools::{Either, Itertools};
use powdr_isa_utils::SingleDataValue;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use raki::{
decode::Decode,
instruction::{Extensions, Instruction as Ins, OpcodeKind as Op},

View File

@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use itertools::Itertools;

View File

@@ -1,7 +1,7 @@
use powdr_ast::parsed::asm::{FunctionStatement, MachineStatement, SymbolPath};
use powdr_parser::ParserContext;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
lazy_static::lazy_static! {
static ref INSTRUCTION_DECLARATION_PARSER: powdr_parser::powdr::InstructionDeclarationParser

View File

@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use powdr_riscv_syscalls::Syscall;
use powdr_syscalls::Syscall;
use itertools::Itertools;

View File

@@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2021"
[dependencies]
powdr-riscv-syscalls = { path = "../../../../riscv-syscalls" }
powdr-riscv-runtime = { path = "../../../../riscv-runtime", features = ["std"]}
powdr-plonky3 = { path = "../../../../plonky3", features = ["powdr-accel"]}
powdr-syscalls = { path = "../../../../syscalls" }
powdr-riscv-runtime = { path = "../../../../riscv-runtime", features = ["std"] }
powdr-plonky3 = { path = "../../../../plonky3", features = ["powdr-accel"] }
[workspace]

View File

@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
powdr-riscv-syscalls = { path = "../../../../riscv-syscalls" }
powdr-riscv-runtime = { path = "../../../../riscv-runtime", features = ["std"]}
powdr-syscalls = { path = "../../../../syscalls" }
powdr-riscv-runtime = { path = "../../../../riscv-runtime", features = ["std"] }
[workspace]

View File

@@ -1,6 +1,6 @@
[package]
name = "powdr-riscv-syscalls"
description = "powdr RISC-V syscalls"
name = "powdr-syscalls"
description = "powdr syscalls"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }

View File

@@ -1,7 +1,7 @@
#![no_std]
macro_rules! syscalls {
($(($num:expr, $identifier:ident, $name:expr)),* $(,)?) => {
($(($num:expr, $identifier:ident, $name:expr, $input_count:expr, $output_count:expr)),* $(,)?) => {
/// We use repr(u8) to make sure the enum discriminant will fit into the
/// 12 bits of the immediate field of the `addi` instruction,
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
@@ -11,11 +11,17 @@ macro_rules! syscalls {
}
impl Syscall {
pub fn name(&self) -> &'static str {
pub const fn name(&self) -> &'static str {
match self {
$(Syscall::$identifier => $name),*
}
}
pub const fn arity(&self) -> (u32, u32) {
match self {
$(Syscall::$identifier => ($input_count, $output_count)),*
}
}
}
impl core::fmt::Display for Syscall {
@@ -56,19 +62,19 @@ macro_rules! syscalls {
// Generate `Syscall` enum with supported syscalls and their numbers.
syscalls!(
(1, Input, "input"),
(2, Output, "output"),
(3, PoseidonGL, "poseidon_gl"),
(4, Affine256, "affine_256"),
(5, EcAdd, "ec_add"),
(6, EcDouble, "ec_double"),
(7, KeccakF, "keccakf"),
(8, Mod256, "mod_256"),
(9, Halt, "halt"),
(10, Poseidon2GL, "poseidon2_gl"),
(11, NativeHash, "native_hash"),
(12, CommitPublic, "commit_public"),
(13, InvertGL, "invert_gl"),
(14, SplitGLVec, "split_gl_vec"),
(15, MergeGL, "merge_gl"),
(1, Input, "input", 2, 1),
(2, Output, "output", 2, 0),
(3, PoseidonGL, "poseidon_gl", 1, 0),
(4, Affine256, "affine_256", 4, 0),
(5, EcAdd, "ec_add", 3, 0),
(6, EcDouble, "ec_double", 2, 0),
(7, KeccakF, "keccakf", 2, 0),
(8, Mod256, "mod_256", 3, 0),
(9, Halt, "halt", 0, 0),
(10, Poseidon2GL, "poseidon2_gl", 2, 0),
(11, NativeHash, "native_hash", 1, 0),
(12, CommitPublic, "commit_public", 2, 0),
(13, InvertGL, "invert_gl", 2, 2),
(14, SplitGLVec, "split_gl_vec", 2, 0),
(15, MergeGL, "merge_gl", 3, 0),
);