diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d1eb50..2b7859e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: - name: Dry-run cargo test (Loom) run: cargo test --no-run --lib --all-features env: - RUSTFLAGS: --cfg asynchronix_loom + RUSTFLAGS: --cfg nexosim_loom miri: name: Miri diff --git a/.github/workflows/loom.yml b/.github/workflows/loom.yml index 1187097..4596724 100644 --- a/.github/workflows/loom.yml +++ b/.github/workflows/loom.yml @@ -4,33 +4,33 @@ on: workflow_dispatch: pull_request: paths: - - 'asynchronix/src/channel.rs' - - 'asynchronix/src/channel/**' - - 'asynchronix/src/executor/task.rs' - - 'asynchronix/src/executor/task/**' - - 'asynchronix/src/loom_exports.rs' - - 'asynchronix/src/ports/output/broadcaster.rs' - - 'asynchronix/src/ports/output/broadcaster/**' - - 'asynchronix/src/ports/source/broadcaster.rs' - - 'asynchronix/src/ports/source/broadcaster/**' - - 'asynchronix/src/util/cached_rw_lock.rs' - - 'asynchronix/src/util/slot.rs' - - 'asynchronix/src/util/sync_cell.rs' + - 'nexosim/src/channel.rs' + - 'nexosim/src/channel/**' + - 'nexosim/src/executor/task.rs' + - 'nexosim/src/executor/task/**' + - 'nexosim/src/loom_exports.rs' + - 'nexosim/src/ports/output/broadcaster.rs' + - 'nexosim/src/ports/output/broadcaster/**' + - 'nexosim/src/ports/source/broadcaster.rs' + - 'nexosim/src/ports/source/broadcaster/**' + - 'nexosim/src/util/cached_rw_lock.rs' + - 'nexosim/src/util/slot.rs' + - 'nexosim/src/util/sync_cell.rs' push: branches: [ main ] paths: - - 'asynchronix/src/channel.rs' - - 'asynchronix/src/channel/**' - - 'asynchronix/src/executor/task.rs' - - 'asynchronix/src/executor/task/**' - - 'asynchronix/src/loom_exports.rs' - - 'asynchronix/src/ports/output/broadcaster.rs' - - 'asynchronix/src/ports/output/broadcaster/**' - - 'asynchronix/src/ports/source/broadcaster.rs' - - 'asynchronix/src/ports/source/broadcaster/**' - - 'asynchronix/src/util/cached_rw_lock.rs' - - 'asynchronix/src/util/slot.rs' - - 'asynchronix/src/util/sync_cell.rs' + - 'nexosim/src/channel.rs' + - 'nexosim/src/channel/**' + - 'nexosim/src/executor/task.rs' + - 'nexosim/src/executor/task/**' + - 'nexosim/src/loom_exports.rs' + - 'nexosim/src/ports/output/broadcaster.rs' + - 'nexosim/src/ports/output/broadcaster/**' + - 'nexosim/src/ports/source/broadcaster.rs' + - 'nexosim/src/ports/source/broadcaster/**' + - 'nexosim/src/util/cached_rw_lock.rs' + - 'nexosim/src/util/slot.rs' + - 'nexosim/src/util/sync_cell.rs' jobs: loom: @@ -46,4 +46,4 @@ jobs: - name: Run cargo test (Loom) run: cargo test --lib --release env: - RUSTFLAGS: --cfg asynchronix_loom + RUSTFLAGS: --cfg nexosim_loom diff --git a/Cargo.toml b/Cargo.toml index 6894a12..ba381c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["asynchronix", "asynchronix-util"] +members = ["nexosim", "nexosim-util"] resolver = "2" diff --git a/LICENSE-MIT b/LICENSE-MIT index da42d8d..f460005 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Asynchronics sp. z o.o. and Asynchronix Contributors +Copyright (c) 2024 Asynchronics sp. z o.o. and NeXosim Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c80d351..9e89e1c 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ -# Asynchronix +# NeXosim -Asynchronix is a developer-friendly, highly optimized discrete-event simulation -framework written in Rust. It is meant to scale from small, simple simulations -to very large simulation benches with complex time-driven state machines. +NeXosim (né Asynchronix) is a developer-friendly, highly optimized +discrete-event simulation framework written in Rust. It is meant to scale from +small, simple simulations to very large simulation benches with complex +time-driven state machines. -[![Cargo](https://img.shields.io/crates/v/asynchronix.svg)](https://crates.io/crates/asynchronix) -[![Documentation](https://docs.rs/asynchronix/badge.svg)](https://docs.rs/asynchronix) -[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](https://github.com/asynchronics/asynchronix#license) +[![Cargo](https://img.shields.io/crates/v/nexosim.svg)](https://crates.io/crates/nexosim) +[![Documentation](https://docs.rs/nexosim/badge.svg)](https://docs.rs/nexosim) +[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](https://github.com/asynchronics/nexosim#license) ## Overview -Asynchronix is a simulator that leverages asynchronous programming to +NeXosim is a simulator that leverages asynchronous programming to transparently and efficiently auto-parallelize simulations by means of a custom multi-threaded executor. @@ -22,7 +23,7 @@ communicating with other models through message passing via connections defined during bench assembly. Although the main impetus for its development was the need for simulators able -to handle large cyberphysical systems, Asynchronix is a general-purpose +to handle large cyberphysical systems, NeXosim is a general-purpose discrete-event simulator expected to be suitable for a wide range of simulation activities. It draws from experience on spacecraft real-time simulators but differs from existing tools in the space industry in a number of respects, @@ -35,7 +36,7 @@ including: 2) *developer-friendliness*: an ergonomic API and Rust's support for algebraic types make it ideal for the "cyber" part in cyberphysical, i.e. for modelling digital devices with even very complex state machines, -3) *open-source*: last but not least, Asynchronix is distributed under the very +3) *open-source*: last but not least, NeXosim is distributed under the very permissive MIT and Apache 2 licenses, with the explicit intent to foster an ecosystem where models can be easily exchanged without reliance on proprietary APIs. @@ -49,10 +50,10 @@ The [API] documentation is relatively exhaustive and includes a practical overview which should provide all necessary information to get started. More fleshed out examples can also be found in the dedicated -[simulator](asynchronix/examples) and [utilities](asynchronix-util/examples) +[simulator](nexosim/examples) and [utilities](nexosim-util/examples) directories. -[API]: https://docs.rs/asynchronix +[API]: https://docs.rs/nexosim ## Usage @@ -61,7 +62,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -asynchronix = "0.2.2" +nexosim = "0.2.2" ``` @@ -76,9 +77,9 @@ asynchronix = "0.2.2" // Input ●─────►│ multiplier 1 ├─────►│ multiplier 2 ├─────► Output // │ │ │ │ // └──────────────┘ └──────────────┘ -use asynchronix::model::{Model, Output}; -use asynchronix::simulation::{Mailbox, SimInit}; -use asynchronix::time::{MonotonicTime, Scheduler}; +use nexosim::model::{Model, Output}; +use nexosim::simulation::{Mailbox, SimInit}; +use nexosim::time::{MonotonicTime, Scheduler}; use std::time::Duration; // A model that doubles its input and forwards it with a 1s delay. @@ -136,7 +137,7 @@ assert_eq!(output_slot.take(), Some(14.0)); # Implementation notes -Under the hood, Asynchronix is based on an asynchronous implementation of the +Under the hood, NeXosim is based on an asynchronous implementation of the [actor model][actor_model], where each simulation model is an actor. The messages actually exchanged between models are `async` closures which capture the event's or request's value and take the model as `&mut self` argument. The @@ -154,13 +155,13 @@ asynchronous runtimes such as [Tokio][tokio], because the end of a set of computations is technically a deadlock: the computation completes when all model have nothing left to do and are blocked on an empty mailbox. Also, instead of managing a conventional reactor, the runtime manages a priority queue containing -the posted events. For these reasons, Asynchronix relies on a fully custom +the posted events. For these reasons, NeXosim relies on a fully custom runtime. Even though the runtime was largely influenced by Tokio, it features additional optimizations that make its faster than any other multi-threaded Rust executor on the typically message-passing-heavy workloads seen in discrete-event -simulation (see [benchmark]). Asynchronix also improves over the state of the +simulation (see [benchmark]). NeXosim also improves over the state of the art with a very fast custom MPSC channel, which performance has been demonstrated through [Tachyonix][tachyonix], a general-purpose offshoot of this channel. diff --git a/asynchronix-util/Cargo.toml b/asynchronix-util/Cargo.toml deleted file mode 100644 index af5f158..0000000 --- a/asynchronix-util/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "asynchronix-util" -version = "0.1.0" -edition = "2021" - -[dependencies] -asynchronix = {version = "0.2.2", path = "../asynchronix"} diff --git a/asynchronix/src/executor/task/tests.rs b/asynchronix/src/executor/task/tests.rs deleted file mode 100644 index 1ba7a21..0000000 --- a/asynchronix/src/executor/task/tests.rs +++ /dev/null @@ -1,7 +0,0 @@ -use super::*; - -#[cfg(not(asynchronix_loom))] -mod general; - -#[cfg(asynchronix_loom)] -mod loom; diff --git a/nexosim-util/Cargo.toml b/nexosim-util/Cargo.toml new file mode 100644 index 0000000..014904c --- /dev/null +++ b/nexosim-util/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "nexosim-util" +version = "0.1.0" +edition = "2021" + +[dependencies] +nexosim = {version = "0.2.2", path = "../nexosim"} diff --git a/asynchronix-util/README.md b/nexosim-util/README.md similarity index 100% rename from asynchronix-util/README.md rename to nexosim-util/README.md diff --git a/asynchronix-util/examples/observables.rs b/nexosim-util/examples/observables.rs similarity index 95% rename from asynchronix-util/examples/observables.rs rename to nexosim-util/examples/observables.rs index 7f5ae96..16e598c 100644 --- a/asynchronix-util/examples/observables.rs +++ b/nexosim-util/examples/observables.rs @@ -17,11 +17,11 @@ use std::time::Duration; -use asynchronix::model::{Context, InitializedModel, Model}; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{AutoActionKey, Mailbox, SimInit, SimulationError}; -use asynchronix::time::MonotonicTime; -use asynchronix_util::observables::{Observable, ObservableState, ObservableValue}; +use nexosim::model::{Context, InitializedModel, Model}; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{AutoActionKey, Mailbox, SimInit, SimulationError}; +use nexosim::time::MonotonicTime; +use nexosim_util::observables::{Observable, ObservableState, ObservableValue}; /// House keeping TM. #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/asynchronix-util/src/lib.rs b/nexosim-util/src/lib.rs similarity index 100% rename from asynchronix-util/src/lib.rs rename to nexosim-util/src/lib.rs diff --git a/asynchronix-util/src/observables.rs b/nexosim-util/src/observables.rs similarity index 98% rename from asynchronix-util/src/observables.rs rename to nexosim-util/src/observables.rs index 6fee335..00d19a6 100644 --- a/asynchronix-util/src/observables.rs +++ b/nexosim-util/src/observables.rs @@ -6,7 +6,7 @@ use std::ops::Deref; -use asynchronix::ports::Output; +use nexosim::ports::Output; /// Observability trait. pub trait Observable { diff --git a/asynchronix/Cargo.toml b/nexosim/Cargo.toml similarity index 84% rename from asynchronix/Cargo.toml rename to nexosim/Cargo.toml index 3b8ade2..ba0c9d3 100644 --- a/asynchronix/Cargo.toml +++ b/nexosim/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "asynchronix" +name = "nexosim" # When incrementing version and releasing to crates.io: # - Update crate version in this Cargo.toml # - Update crate version in README.md @@ -14,7 +14,7 @@ version = "0.2.2" edition = "2021" rust-version = "1.77.0" license = "MIT OR Apache-2.0" -repository = "https://github.com/asynchronics/asynchronix" +repository = "https://github.com/asynchronics/nexosim" readme = "../README.md" description = """ A high performance asychronous compute framework for system simulation. @@ -64,17 +64,17 @@ futures-util = "0.3" futures-executor = "0.3" tracing-subscriber = { version= "0.3.18", features=["env-filter"] } -[target.'cfg(asynchronix_loom)'.dev-dependencies] +[target.'cfg(nexosim_loom)'.dev-dependencies] loom = "0.7" waker-fn = "1.1" -[target.'cfg(asynchronix_grpc_codegen)'.build-dependencies] +[target.'cfg(nexosim_grpc_codegen)'.build-dependencies] tonic-build = { version = "0.12" } [lints.rust] -# `asynchronix_loom` flag: run loom-based tests. -# `asynchronix_grpc_codegen` flag: regenerate gRPC code from .proto definitions. -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(asynchronix_loom)', 'cfg(asynchronix_grpc_codegen)'] } +# `nexosim_loom` flag: run loom-based tests. +# `nexosim_grpc_codegen` flag: regenerate gRPC code from .proto definitions. +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nexosim_loom)', 'cfg(nexosim_grpc_codegen)'] } [package.metadata.docs.rs] all-features = true diff --git a/asynchronix/build.rs b/nexosim/build.rs similarity index 85% rename from asynchronix/build.rs rename to nexosim/build.rs index cff7996..72ccc67 100644 --- a/asynchronix/build.rs +++ b/nexosim/build.rs @@ -1,5 +1,5 @@ fn main() -> Result<(), Box> { - #[cfg(asynchronix_grpc_codegen)] + #[cfg(nexosim_grpc_codegen)] tonic_build::configure() .build_client(false) .out_dir("src/grpc/codegen/") diff --git a/asynchronix/examples/assembly.rs b/nexosim/examples/assembly.rs similarity index 96% rename from asynchronix/examples/assembly.rs rename to nexosim/examples/assembly.rs index a2e1e44..6db48d9 100644 --- a/asynchronix/examples/assembly.rs +++ b/nexosim/examples/assembly.rs @@ -25,10 +25,10 @@ use std::time::Duration; -use asynchronix::model::{BuildContext, Model, ProtoModel}; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{Mailbox, SimInit, SimulationError}; -use asynchronix::time::MonotonicTime; +use nexosim::model::{BuildContext, Model, ProtoModel}; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{Mailbox, SimInit, SimulationError}; +use nexosim::time::MonotonicTime; mod stepper_motor; diff --git a/asynchronix/examples/espresso_machine.rs b/nexosim/examples/espresso_machine.rs similarity index 98% rename from asynchronix/examples/espresso_machine.rs rename to nexosim/examples/espresso_machine.rs index 0904c01..d350e8c 100644 --- a/asynchronix/examples/espresso_machine.rs +++ b/nexosim/examples/espresso_machine.rs @@ -33,10 +33,10 @@ use std::time::Duration; -use asynchronix::model::{Context, InitializedModel, Model}; -use asynchronix::ports::{EventSlot, Output}; -use asynchronix::simulation::{ActionKey, Mailbox, SimInit, SimulationError}; -use asynchronix::time::MonotonicTime; +use nexosim::model::{Context, InitializedModel, Model}; +use nexosim::ports::{EventSlot, Output}; +use nexosim::simulation::{ActionKey, Mailbox, SimInit, SimulationError}; +use nexosim::time::MonotonicTime; /// Water pump. pub struct Pump { diff --git a/asynchronix/examples/external_input.rs b/nexosim/examples/external_input.rs similarity index 96% rename from asynchronix/examples/external_input.rs rename to nexosim/examples/external_input.rs index b66db9e..1b5406a 100644 --- a/asynchronix/examples/external_input.rs +++ b/nexosim/examples/external_input.rs @@ -24,10 +24,10 @@ use std::sync::{Arc, Condvar, Mutex}; use std::thread::{self, sleep, JoinHandle}; use std::time::Duration; -use asynchronix::model::{BuildContext, Context, InitializedModel, Model, ProtoModel}; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{Mailbox, SimInit, SimulationError}; -use asynchronix::time::{AutoSystemClock, MonotonicTime}; +use nexosim::model::{BuildContext, Context, InitializedModel, Model, ProtoModel}; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{Mailbox, SimInit, SimulationError}; +use nexosim::time::{AutoSystemClock, MonotonicTime}; const DELTA: Duration = Duration::from_millis(2); const PERIOD: Duration = Duration::from_millis(20); diff --git a/asynchronix/examples/power_supply.rs b/nexosim/examples/power_supply.rs similarity index 96% rename from asynchronix/examples/power_supply.rs rename to nexosim/examples/power_supply.rs index 9d359f2..7c74401 100644 --- a/asynchronix/examples/power_supply.rs +++ b/nexosim/examples/power_supply.rs @@ -26,10 +26,10 @@ //! │ ├───────────────────────────────► Total power //! └──────────┘ //! ``` -use asynchronix::model::Model; -use asynchronix::ports::{EventSlot, Output, Requestor}; -use asynchronix::simulation::{Mailbox, SimInit, SimulationError}; -use asynchronix::time::MonotonicTime; +use nexosim::model::Model; +use nexosim::ports::{EventSlot, Output, Requestor}; +use nexosim::simulation::{Mailbox, SimInit, SimulationError}; +use nexosim::time::MonotonicTime; /// Power supply. pub struct PowerSupply { diff --git a/asynchronix/examples/stepper_motor.rs b/nexosim/examples/stepper_motor.rs similarity index 97% rename from asynchronix/examples/stepper_motor.rs rename to nexosim/examples/stepper_motor.rs index e1b1ad4..be8f0bb 100644 --- a/asynchronix/examples/stepper_motor.rs +++ b/nexosim/examples/stepper_motor.rs @@ -20,10 +20,10 @@ use std::future::Future; use std::time::Duration; -use asynchronix::model::{Context, InitializedModel, Model}; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{Mailbox, SimInit}; -use asynchronix::time::MonotonicTime; +use nexosim::model::{Context, InitializedModel, Model}; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{Mailbox, SimInit}; +use nexosim::time::MonotonicTime; /// Stepper motor. pub struct Motor { @@ -179,7 +179,7 @@ impl Driver { impl Model for Driver {} #[allow(dead_code)] -fn main() -> Result<(), asynchronix::simulation::SimulationError> { +fn main() -> Result<(), nexosim::simulation::SimulationError> { // --------------- // Bench assembly. // --------------- diff --git a/asynchronix/src/channel.rs b/nexosim/src/channel.rs similarity index 100% rename from asynchronix/src/channel.rs rename to nexosim/src/channel.rs diff --git a/asynchronix/src/channel/queue.rs b/nexosim/src/channel/queue.rs similarity index 99% rename from asynchronix/src/channel/queue.rs rename to nexosim/src/channel/queue.rs index 1d5336b..7876c3e 100644 --- a/asynchronix/src/channel/queue.rs +++ b/nexosim/src/channel/queue.rs @@ -413,7 +413,7 @@ impl Producer { } /// Checks if the queue is closed. - #[cfg(not(asynchronix_loom))] + #[cfg(not(nexosim_loom))] fn is_closed(&self) -> bool { self.inner.is_closed() } @@ -449,7 +449,7 @@ impl Consumer { } /// Returns the number of items. - #[cfg(not(asynchronix_loom))] + #[cfg(not(nexosim_loom))] fn len(&self) -> usize { self.inner.len() } @@ -470,7 +470,7 @@ fn queue(capacity: usize) -> (Producer, Consumer) { } /// Regular tests. -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use super::*; @@ -648,7 +648,7 @@ mod tests { } /// Loom tests. -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use super::*; diff --git a/asynchronix/src/dev_hooks.rs b/nexosim/src/dev_hooks.rs similarity index 100% rename from asynchronix/src/dev_hooks.rs rename to nexosim/src/dev_hooks.rs diff --git a/asynchronix/src/executor.rs b/nexosim/src/executor.rs similarity index 99% rename from asynchronix/src/executor.rs rename to nexosim/src/executor.rs index 1aa500e..80456f8 100644 --- a/asynchronix/src/executor.rs +++ b/nexosim/src/executor.rs @@ -139,7 +139,7 @@ impl Signal { } } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use std::sync::atomic::Ordering; use std::sync::Arc; diff --git a/asynchronix/src/executor/mt_executor.rs b/nexosim/src/executor/mt_executor.rs similarity index 100% rename from asynchronix/src/executor/mt_executor.rs rename to nexosim/src/executor/mt_executor.rs diff --git a/asynchronix/src/executor/mt_executor/injector.rs b/nexosim/src/executor/mt_executor/injector.rs similarity index 100% rename from asynchronix/src/executor/mt_executor/injector.rs rename to nexosim/src/executor/mt_executor/injector.rs diff --git a/asynchronix/src/executor/mt_executor/pool_manager.rs b/nexosim/src/executor/mt_executor/pool_manager.rs similarity index 100% rename from asynchronix/src/executor/mt_executor/pool_manager.rs rename to nexosim/src/executor/mt_executor/pool_manager.rs diff --git a/asynchronix/src/executor/st_executor.rs b/nexosim/src/executor/st_executor.rs similarity index 100% rename from asynchronix/src/executor/st_executor.rs rename to nexosim/src/executor/st_executor.rs diff --git a/asynchronix/src/executor/task.rs b/nexosim/src/executor/task.rs similarity index 100% rename from asynchronix/src/executor/task.rs rename to nexosim/src/executor/task.rs diff --git a/asynchronix/src/executor/task/cancel_token.rs b/nexosim/src/executor/task/cancel_token.rs similarity index 100% rename from asynchronix/src/executor/task/cancel_token.rs rename to nexosim/src/executor/task/cancel_token.rs diff --git a/asynchronix/src/executor/task/promise.rs b/nexosim/src/executor/task/promise.rs similarity index 100% rename from asynchronix/src/executor/task/promise.rs rename to nexosim/src/executor/task/promise.rs diff --git a/asynchronix/src/executor/task/runnable.rs b/nexosim/src/executor/task/runnable.rs similarity index 100% rename from asynchronix/src/executor/task/runnable.rs rename to nexosim/src/executor/task/runnable.rs diff --git a/nexosim/src/executor/task/tests.rs b/nexosim/src/executor/task/tests.rs new file mode 100644 index 0000000..dd69159 --- /dev/null +++ b/nexosim/src/executor/task/tests.rs @@ -0,0 +1,7 @@ +use super::*; + +#[cfg(not(nexosim_loom))] +mod general; + +#[cfg(nexosim_loom)] +mod loom; diff --git a/asynchronix/src/executor/task/tests/general.rs b/nexosim/src/executor/task/tests/general.rs similarity index 100% rename from asynchronix/src/executor/task/tests/general.rs rename to nexosim/src/executor/task/tests/general.rs diff --git a/asynchronix/src/executor/task/tests/loom.rs b/nexosim/src/executor/task/tests/loom.rs similarity index 100% rename from asynchronix/src/executor/task/tests/loom.rs rename to nexosim/src/executor/task/tests/loom.rs diff --git a/asynchronix/src/executor/task/util.rs b/nexosim/src/executor/task/util.rs similarity index 100% rename from asynchronix/src/executor/task/util.rs rename to nexosim/src/executor/task/util.rs diff --git a/asynchronix/src/grpc.rs b/nexosim/src/grpc.rs similarity index 100% rename from asynchronix/src/grpc.rs rename to nexosim/src/grpc.rs diff --git a/asynchronix/src/grpc/api/simulation.proto b/nexosim/src/grpc/api/simulation.proto similarity index 100% rename from asynchronix/src/grpc/api/simulation.proto rename to nexosim/src/grpc/api/simulation.proto diff --git a/asynchronix/src/grpc/codegen.rs b/nexosim/src/grpc/codegen.rs similarity index 100% rename from asynchronix/src/grpc/codegen.rs rename to nexosim/src/grpc/codegen.rs diff --git a/asynchronix/src/grpc/codegen/.gitkeep b/nexosim/src/grpc/codegen/.gitkeep similarity index 100% rename from asynchronix/src/grpc/codegen/.gitkeep rename to nexosim/src/grpc/codegen/.gitkeep diff --git a/asynchronix/src/grpc/codegen/simulation.rs b/nexosim/src/grpc/codegen/simulation.rs similarity index 100% rename from asynchronix/src/grpc/codegen/simulation.rs rename to nexosim/src/grpc/codegen/simulation.rs diff --git a/asynchronix/src/grpc/key_registry.rs b/nexosim/src/grpc/key_registry.rs similarity index 100% rename from asynchronix/src/grpc/key_registry.rs rename to nexosim/src/grpc/key_registry.rs diff --git a/asynchronix/src/grpc/run.rs b/nexosim/src/grpc/run.rs similarity index 100% rename from asynchronix/src/grpc/run.rs rename to nexosim/src/grpc/run.rs diff --git a/asynchronix/src/grpc/services.rs b/nexosim/src/grpc/services.rs similarity index 100% rename from asynchronix/src/grpc/services.rs rename to nexosim/src/grpc/services.rs diff --git a/asynchronix/src/grpc/services/controller_service.rs b/nexosim/src/grpc/services/controller_service.rs similarity index 100% rename from asynchronix/src/grpc/services/controller_service.rs rename to nexosim/src/grpc/services/controller_service.rs diff --git a/asynchronix/src/grpc/services/init_service.rs b/nexosim/src/grpc/services/init_service.rs similarity index 100% rename from asynchronix/src/grpc/services/init_service.rs rename to nexosim/src/grpc/services/init_service.rs diff --git a/asynchronix/src/grpc/services/monitor_service.rs b/nexosim/src/grpc/services/monitor_service.rs similarity index 100% rename from asynchronix/src/grpc/services/monitor_service.rs rename to nexosim/src/grpc/services/monitor_service.rs diff --git a/asynchronix/src/lib.rs b/nexosim/src/lib.rs similarity index 90% rename from asynchronix/src/lib.rs rename to nexosim/src/lib.rs index 028364e..9aac124 100644 --- a/asynchronix/src/lib.rs +++ b/nexosim/src/lib.rs @@ -1,9 +1,9 @@ //! A high-performance, discrete-event computation framework for system //! simulation. //! -//! Asynchronix is a developer-friendly, yet highly optimized software simulator -//! able to scale to very large simulation with complex time-driven state -//! machines. +//! NeXosim (né Asynchronix) is a developer-friendly, yet highly optimized +//! software simulator able to scale to very large simulation with complex +//! time-driven state machines. //! //! It promotes a component-oriented architecture that is familiar to system //! engineers and closely resembles [flow-based programming][FBP]: a model is @@ -12,10 +12,10 @@ //! defined during bench assembly. Unlike in conventional flow-based //! programming, request-reply patterns are also possible. //! -//! Asynchronix leverages asynchronous programming to perform -//! auto-parallelization in a manner that is fully transparent to model authors -//! and users, achieving high computational throughput on large simulation -//! benches by means of a custom multi-threaded executor. +//! NeXosim leverages asynchronous programming to perform auto-parallelization +//! in a manner that is fully transparent to model authors and users, achieving +//! high computational throughput on large simulation benches by means of a +//! custom multi-threaded executor. //! //! //! [FBP]: https://en.wikipedia.org/wiki/Flow-based_programming @@ -83,8 +83,8 @@ //! `Multiplier` could be implemented as follows: //! //! ``` -//! use asynchronix::model::Model; -//! use asynchronix::ports::Output; +//! use nexosim::model::Model; +//! use nexosim::ports::Output; //! //! #[derive(Default)] //! pub struct Multiplier { @@ -110,8 +110,8 @@ //! //! ``` //! use std::time::Duration; -//! use asynchronix::model::{Context, Model}; -//! use asynchronix::ports::Output; +//! use nexosim::model::{Context, Model}; +//! use nexosim::ports::Output; //! //! #[derive(Default)] //! pub struct Delay { @@ -172,8 +172,8 @@ //! ``` //! # mod models { //! # use std::time::Duration; -//! # use asynchronix::model::{Context, Model}; -//! # use asynchronix::ports::Output; +//! # use nexosim::model::{Context, Model}; +//! # use nexosim::ports::Output; //! # #[derive(Default)] //! # pub struct Multiplier { //! # pub output: Output, @@ -199,9 +199,9 @@ //! # impl Model for Delay {} //! # } //! use std::time::Duration; -//! use asynchronix::ports::EventSlot; -//! use asynchronix::simulation::{Mailbox, SimInit}; -//! use asynchronix::time::MonotonicTime; +//! use nexosim::ports::EventSlot; +//! use nexosim::simulation::{Mailbox, SimInit}; +//! use nexosim::time::MonotonicTime; //! //! use models::{Delay, Multiplier}; //! @@ -237,7 +237,7 @@ //! .add_model(delay2, delay2_mbox, "delay2") //! .init(t0)?; //! -//! # Ok::<(), asynchronix::simulation::SimulationError>(()) +//! # Ok::<(), nexosim::simulation::SimulationError>(()) //! ``` //! //! ## Running simulations @@ -273,8 +273,8 @@ //! ``` //! # mod models { //! # use std::time::Duration; -//! # use asynchronix::model::{Context, Model}; -//! # use asynchronix::ports::Output; +//! # use nexosim::model::{Context, Model}; +//! # use nexosim::ports::Output; //! # #[derive(Default)] //! # pub struct Multiplier { //! # pub output: Output, @@ -300,9 +300,9 @@ //! # impl Model for Delay {} //! # } //! # use std::time::Duration; -//! # use asynchronix::ports::EventSlot; -//! # use asynchronix::simulation::{Mailbox, SimInit}; -//! # use asynchronix::time::MonotonicTime; +//! # use nexosim::ports::EventSlot; +//! # use nexosim::simulation::{Mailbox, SimInit}; +//! # use nexosim::time::MonotonicTime; //! # use models::{Delay, Multiplier}; //! # let mut multiplier1 = Multiplier::default(); //! # let mut multiplier2 = Multiplier::default(); @@ -344,23 +344,23 @@ //! assert_eq!(simu.time(), t0 + Duration::from_secs(2)); //! assert_eq!(output_slot.next(), Some(42.0)); //! -//! # Ok::<(), asynchronix::simulation::SimulationError>(()) +//! # Ok::<(), nexosim::simulation::SimulationError>(()) //! ``` //! //! # Message ordering guarantees //! -//! The Asynchronix runtime is based on the [actor model][actor_model], meaning -//! that every simulation model can be thought of as an isolated entity running -//! in its own thread. While in practice the runtime will actually multiplex and +//! The NeXosim runtime is based on the [actor model][actor_model], meaning that +//! every simulation model can be thought of as an isolated entity running in +//! its own thread. While in practice the runtime will actually multiplex and //! migrate models over a fixed set of kernel threads, models will indeed run in //! parallel whenever possible. //! -//! Since Asynchronix is a time-based simulator, the runtime will always execute +//! Since NeXosim is a time-based simulator, the runtime will always execute //! tasks in chronological order, thus eliminating most ordering ambiguities //! that could result from parallel execution. Nevertheless, it is sometimes //! possible for events and queries generated in the same time slice to lead to //! ambiguous execution orders. In order to make it easier to reason about such -//! situations, Asynchronix provides a set of guarantees about message delivery +//! situations, NeXosim provides a set of guarantees about message delivery //! order. Borrowing from the [Pony][pony] programming language, we refer to //! this contract as *causal messaging*, a property that can be summarized by //! these two rules: @@ -394,7 +394,7 @@ //! //! ```toml //! [dependencies] -//! asynchronix = { version = "0.3", features = ["tracing"] } +//! nexosim = { version = "0.3", features = ["tracing"] } //! ``` //! //! See the [`tracing`] module for more information. @@ -409,7 +409,7 @@ //! framework. //! //! [gh_examples]: -//! https://github.com/asynchronics/asynchronix/tree/main/asynchronix/examples +//! https://github.com/asynchronics/nexosim/tree/main/nexosim/examples //! //! ## Modules documentation //! diff --git a/asynchronix/src/loom_exports.rs b/nexosim/src/loom_exports.rs similarity index 82% rename from asynchronix/src/loom_exports.rs rename to nexosim/src/loom_exports.rs index f168280..dc785c9 100644 --- a/asynchronix/src/loom_exports.rs +++ b/nexosim/src/loom_exports.rs @@ -1,4 +1,4 @@ -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] #[allow(unused_imports)] pub(crate) mod sync { pub(crate) use loom::sync::{Arc, LockResult, Mutex, MutexGuard}; @@ -10,7 +10,7 @@ pub(crate) mod sync { }; } } -#[cfg(not(all(test, asynchronix_loom)))] +#[cfg(not(all(test, nexosim_loom)))] #[allow(unused_imports)] pub(crate) mod sync { pub(crate) use std::sync::{Arc, LockResult, Mutex, MutexGuard, PoisonError}; @@ -22,11 +22,11 @@ pub(crate) mod sync { } } -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] pub(crate) mod cell { pub(crate) use loom::cell::UnsafeCell; } -#[cfg(not(all(test, asynchronix_loom)))] +#[cfg(not(all(test, nexosim_loom)))] pub(crate) mod cell { #[derive(Debug)] pub(crate) struct UnsafeCell(std::cell::UnsafeCell); @@ -50,11 +50,11 @@ pub(crate) mod cell { #[allow(unused_macros)] macro_rules! debug_or_loom_assert { - ($($arg:tt)*) => (if cfg!(any(debug_assertions, asynchronix_loom)) { assert!($($arg)*); }) + ($($arg:tt)*) => (if cfg!(any(debug_assertions, nexosim_loom)) { assert!($($arg)*); }) } #[allow(unused_macros)] macro_rules! debug_or_loom_assert_eq { - ($($arg:tt)*) => (if cfg!(any(debug_assertions, asynchronix_loom)) { assert_eq!($($arg)*); }) + ($($arg:tt)*) => (if cfg!(any(debug_assertions, nexosim_loom)) { assert_eq!($($arg)*); }) } #[allow(unused_imports)] pub(crate) use debug_or_loom_assert; diff --git a/asynchronix/src/macros.rs b/nexosim/src/macros.rs similarity index 100% rename from asynchronix/src/macros.rs rename to nexosim/src/macros.rs diff --git a/asynchronix/src/macros/scoped_thread_local.rs b/nexosim/src/macros/scoped_thread_local.rs similarity index 99% rename from asynchronix/src/macros/scoped_thread_local.rs rename to nexosim/src/macros/scoped_thread_local.rs index 587a8f8..0ac9d06 100644 --- a/asynchronix/src/macros/scoped_thread_local.rs +++ b/nexosim/src/macros/scoped_thread_local.rs @@ -123,7 +123,7 @@ impl ScopedLocalKey { } } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use std::cell::Cell; use std::sync::mpsc::{channel, Sender}; diff --git a/asynchronix/src/model.rs b/nexosim/src/model.rs similarity index 96% rename from asynchronix/src/model.rs rename to nexosim/src/model.rs index 35793fb..73969f8 100644 --- a/asynchronix/src/model.rs +++ b/nexosim/src/model.rs @@ -36,7 +36,7 @@ //! default implementation of the [`Model`] trait: //! //! ``` -//! use asynchronix::model::Model; +//! use nexosim::model::Model; //! //! pub struct MyModel { //! // ... @@ -48,7 +48,7 @@ //! methods can be explicitly implemented: //! //! ``` -//! use asynchronix::model::{Context, InitializedModel, Model}; +//! use nexosim::model::{Context, InitializedModel, Model}; //! //! pub struct MyModel { //! // ... @@ -69,8 +69,8 @@ //! explicitly implemented: //! //! ``` -//! use asynchronix::model::{BuildContext, InitializedModel, Model, ProtoModel}; -//! use asynchronix::ports::Output; +//! use nexosim::model::{BuildContext, InitializedModel, Model, ProtoModel}; +//! use nexosim::ports::Output; //! //! /// The final model. //! pub struct Multiplier { @@ -146,8 +146,8 @@ //! #### Example //! //! ``` -//! use asynchronix::model::Model; -//! use asynchronix::ports::{Output, Requestor}; +//! use nexosim::model::Model; +//! use nexosim::ports::{Output, Requestor}; //! //! pub struct MyModel { //! pub my_output: Output, @@ -213,7 +213,7 @@ //! #### Example //! //! ``` -//! use asynchronix::model::{Context, Model}; +//! use nexosim::model::{Context, Model}; //! //! pub struct MyModel { //! // ... @@ -264,7 +264,7 @@ pub trait Model: Sized + Send + 'static { /// use std::future::Future; /// use std::pin::Pin; /// - /// use asynchronix::model::{Context, InitializedModel, Model}; + /// use nexosim::model::{Context, InitializedModel, Model}; /// /// pub struct MyModel { /// // ... diff --git a/asynchronix/src/model/context.rs b/nexosim/src/model/context.rs similarity index 96% rename from asynchronix/src/model/context.rs rename to nexosim/src/model/context.rs index 6e8c70b..e71b7a4 100644 --- a/asynchronix/src/model/context.rs +++ b/nexosim/src/model/context.rs @@ -42,8 +42,8 @@ use super::{Model, ProtoModel}; /// /// ``` /// use std::time::Duration; -/// use asynchronix::model::{Context, Model}; -/// use asynchronix::ports::Output; +/// use nexosim::model::{Context, Model}; +/// use nexosim::ports::Output; /// /// #[derive(Default)] /// pub struct DelayedGreeter { @@ -120,7 +120,7 @@ impl Context { /// ``` /// use std::time::Duration; /// - /// use asynchronix::model::{Context, Model}; + /// use nexosim::model::{Context, Model}; /// /// // A timer. /// pub struct Timer {} @@ -165,9 +165,9 @@ impl Context { /// # Examples /// /// ``` - /// use asynchronix::model::{Context, Model}; - /// use asynchronix::simulation::ActionKey; - /// use asynchronix::time::MonotonicTime; + /// use nexosim::model::{Context, Model}; + /// use nexosim::simulation::ActionKey; + /// use nexosim::time::MonotonicTime; /// /// // An alarm clock that can be cancelled. /// #[derive(Default)] @@ -230,8 +230,8 @@ impl Context { /// ``` /// use std::time::Duration; /// - /// use asynchronix::model::{Context, Model}; - /// use asynchronix::time::MonotonicTime; + /// use nexosim::model::{Context, Model}; + /// use nexosim::time::MonotonicTime; /// /// // An alarm clock beeping at 1Hz. /// pub struct BeepingAlarmClock {} @@ -290,9 +290,9 @@ impl Context { /// ``` /// use std::time::Duration; /// - /// use asynchronix::model::{Context, Model}; - /// use asynchronix::simulation::ActionKey; - /// use asynchronix::time::MonotonicTime; + /// use nexosim::model::{Context, Model}; + /// use nexosim::simulation::ActionKey; + /// use nexosim::time::MonotonicTime; /// /// // An alarm clock beeping at 1Hz that can be cancelled before it sets off, or /// // stopped after it sets off. @@ -389,9 +389,9 @@ impl fmt::Debug for Context { /// /// ``` /// use std::time::Duration; -/// use asynchronix::model::{BuildContext, Model, ProtoModel}; -/// use asynchronix::ports::Output; -/// use asynchronix::simulation::Mailbox; +/// use nexosim::model::{BuildContext, Model, ProtoModel}; +/// use nexosim::ports::Output; +/// use nexosim::simulation::Mailbox; /// /// #[derive(Default)] /// struct MultiplyBy2 { diff --git a/asynchronix/src/ports.rs b/nexosim/src/ports.rs similarity index 92% rename from asynchronix/src/ports.rs rename to nexosim/src/ports.rs index f57f93e..d1a74b4 100644 --- a/asynchronix/src/ports.rs +++ b/nexosim/src/ports.rs @@ -27,12 +27,12 @@ //! assemblies, see the [`assembly example`][assembly]. //! //! [assembly]: -//! https://github.com/asynchronics/asynchronix/tree/main/asynchronix/examples/assembly.rs +//! https://github.com/asynchronics/nexosim/tree/main/nexosim/examples/assembly.rs //! //! ``` -//! use asynchronix::model::{BuildContext, Model, ProtoModel}; -//! use asynchronix::ports::Output; -//! use asynchronix::simulation::Mailbox; +//! use nexosim::model::{BuildContext, Model, ProtoModel}; +//! use nexosim::ports::Output; +//! use nexosim::simulation::Mailbox; //! //! pub struct ChildModel { //! pub output: Output, diff --git a/asynchronix/src/ports/input.rs b/nexosim/src/ports/input.rs similarity index 100% rename from asynchronix/src/ports/input.rs rename to nexosim/src/ports/input.rs diff --git a/asynchronix/src/ports/input/markers.rs b/nexosim/src/ports/input/markers.rs similarity index 100% rename from asynchronix/src/ports/input/markers.rs rename to nexosim/src/ports/input/markers.rs diff --git a/asynchronix/src/ports/input/model_fn.rs b/nexosim/src/ports/input/model_fn.rs similarity index 100% rename from asynchronix/src/ports/input/model_fn.rs rename to nexosim/src/ports/input/model_fn.rs diff --git a/asynchronix/src/ports/output.rs b/nexosim/src/ports/output.rs similarity index 100% rename from asynchronix/src/ports/output.rs rename to nexosim/src/ports/output.rs diff --git a/asynchronix/src/ports/output/broadcaster.rs b/nexosim/src/ports/output/broadcaster.rs similarity index 99% rename from asynchronix/src/ports/output/broadcaster.rs rename to nexosim/src/ports/output/broadcaster.rs index f271414..bb3ac47 100644 --- a/asynchronix/src/ports/output/broadcaster.rs +++ b/nexosim/src/ports/output/broadcaster.rs @@ -504,7 +504,7 @@ fn recycle_vec(mut v: Vec) -> Vec { v_out } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; @@ -834,7 +834,7 @@ mod tests { } } -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use futures_channel::mpsc; use futures_util::StreamExt; diff --git a/asynchronix/src/ports/output/sender.rs b/nexosim/src/ports/output/sender.rs similarity index 100% rename from asynchronix/src/ports/output/sender.rs rename to nexosim/src/ports/output/sender.rs diff --git a/asynchronix/src/ports/sink.rs b/nexosim/src/ports/sink.rs similarity index 100% rename from asynchronix/src/ports/sink.rs rename to nexosim/src/ports/sink.rs diff --git a/asynchronix/src/ports/sink/event_buffer.rs b/nexosim/src/ports/sink/event_buffer.rs similarity index 100% rename from asynchronix/src/ports/sink/event_buffer.rs rename to nexosim/src/ports/sink/event_buffer.rs diff --git a/asynchronix/src/ports/sink/event_slot.rs b/nexosim/src/ports/sink/event_slot.rs similarity index 100% rename from asynchronix/src/ports/sink/event_slot.rs rename to nexosim/src/ports/sink/event_slot.rs diff --git a/asynchronix/src/ports/source.rs b/nexosim/src/ports/source.rs similarity index 100% rename from asynchronix/src/ports/source.rs rename to nexosim/src/ports/source.rs diff --git a/asynchronix/src/ports/source/broadcaster.rs b/nexosim/src/ports/source/broadcaster.rs similarity index 99% rename from asynchronix/src/ports/source/broadcaster.rs rename to nexosim/src/ports/source/broadcaster.rs index 55cfe4d..7bd1bce 100644 --- a/asynchronix/src/ports/source/broadcaster.rs +++ b/nexosim/src/ports/source/broadcaster.rs @@ -408,7 +408,7 @@ impl Iterator for ReplyIterator { } } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; @@ -738,7 +738,7 @@ mod tests { } } -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use futures_channel::mpsc; use futures_util::StreamExt; diff --git a/asynchronix/src/ports/source/sender.rs b/nexosim/src/ports/source/sender.rs similarity index 100% rename from asynchronix/src/ports/source/sender.rs rename to nexosim/src/ports/source/sender.rs diff --git a/asynchronix/src/registry.rs b/nexosim/src/registry.rs similarity index 100% rename from asynchronix/src/registry.rs rename to nexosim/src/registry.rs diff --git a/asynchronix/src/registry/event_sink_registry.rs b/nexosim/src/registry/event_sink_registry.rs similarity index 100% rename from asynchronix/src/registry/event_sink_registry.rs rename to nexosim/src/registry/event_sink_registry.rs diff --git a/asynchronix/src/registry/event_source_registry.rs b/nexosim/src/registry/event_source_registry.rs similarity index 100% rename from asynchronix/src/registry/event_source_registry.rs rename to nexosim/src/registry/event_source_registry.rs diff --git a/asynchronix/src/registry/query_source_registry.rs b/nexosim/src/registry/query_source_registry.rs similarity index 100% rename from asynchronix/src/registry/query_source_registry.rs rename to nexosim/src/registry/query_source_registry.rs diff --git a/asynchronix/src/simulation.rs b/nexosim/src/simulation.rs similarity index 98% rename from asynchronix/src/simulation.rs rename to nexosim/src/simulation.rs index e3c949b..29c6c96 100644 --- a/asynchronix/src/simulation.rs +++ b/nexosim/src/simulation.rs @@ -47,10 +47,10 @@ //! //! ## Avoiding deadlocks //! -//! While the underlying architecture of Asynchronix—the actor model—should -//! prevent most race conditions (including obviously data races which are not -//! possible in safe Rust) it is still possible in theory to generate deadlocks. -//! Though rare in practice, these may occur due to one of the below: +//! While the underlying architecture of NeXosim—the actor model—should prevent +//! most race conditions (including obviously data races which are not possible +//! in safe Rust) it is still possible in theory to generate deadlocks. Though +//! rare in practice, these may occur due to one of the below: //! //! 1. *query loopback*: if a model sends a query which loops back to itself //! (either directly or transitively via other models), that model diff --git a/asynchronix/src/simulation/mailbox.rs b/nexosim/src/simulation/mailbox.rs similarity index 100% rename from asynchronix/src/simulation/mailbox.rs rename to nexosim/src/simulation/mailbox.rs diff --git a/asynchronix/src/simulation/scheduler.rs b/nexosim/src/simulation/scheduler.rs similarity index 99% rename from asynchronix/src/simulation/scheduler.rs rename to nexosim/src/simulation/scheduler.rs index 597a6fb..9ea00bf 100644 --- a/asynchronix/src/simulation/scheduler.rs +++ b/nexosim/src/simulation/scheduler.rs @@ -36,8 +36,8 @@ impl Scheduler { /// # Examples /// /// ``` - /// use asynchronix::simulation::Scheduler; - /// use asynchronix::time::MonotonicTime; + /// use nexosim::simulation::Scheduler; + /// use nexosim::time::MonotonicTime; /// /// fn is_third_millenium(scheduler: &Scheduler) -> bool { /// let time = scheduler.time(); diff --git a/asynchronix/src/simulation/sim_init.rs b/nexosim/src/simulation/sim_init.rs similarity index 100% rename from asynchronix/src/simulation/sim_init.rs rename to nexosim/src/simulation/sim_init.rs diff --git a/asynchronix/src/time.rs b/nexosim/src/time.rs similarity index 96% rename from asynchronix/src/time.rs rename to nexosim/src/time.rs index 5bcdebb..b135119 100644 --- a/asynchronix/src/time.rs +++ b/nexosim/src/time.rs @@ -15,8 +15,8 @@ //! the specified timestamp. //! //! ``` -//! use asynchronix::model::{Context, Model}; -//! use asynchronix::time::MonotonicTime; +//! use nexosim::model::{Context, Model}; +//! use nexosim::time::MonotonicTime; //! //! // An alarm clock model. //! pub struct AlarmClock { diff --git a/asynchronix/src/time/clock.rs b/nexosim/src/time/clock.rs similarity index 96% rename from asynchronix/src/time/clock.rs rename to nexosim/src/time/clock.rs index 64d299e..dc9dc17 100644 --- a/asynchronix/src/time/clock.rs +++ b/nexosim/src/time/clock.rs @@ -66,8 +66,8 @@ impl SystemClock { /// ``` /// use std::time::{Duration, Instant}; /// - /// use asynchronix::simulation::SimInit; - /// use asynchronix::time::{MonotonicTime, SystemClock}; + /// use nexosim::simulation::SimInit; + /// use nexosim::time::{MonotonicTime, SystemClock}; /// /// let t0 = MonotonicTime::new(1_234_567_890, 0).unwrap(); /// @@ -107,8 +107,8 @@ impl SystemClock { /// ``` /// use std::time::{Duration, UNIX_EPOCH}; /// - /// use asynchronix::simulation::SimInit; - /// use asynchronix::time::{MonotonicTime, SystemClock}; + /// use nexosim::simulation::SimInit; + /// use nexosim::time::{MonotonicTime, SystemClock}; /// /// let t0 = MonotonicTime::new(1_234_567_890, 0).unwrap(); /// diff --git a/asynchronix/src/time/monotonic_time.rs b/nexosim/src/time/monotonic_time.rs similarity index 100% rename from asynchronix/src/time/monotonic_time.rs rename to nexosim/src/time/monotonic_time.rs diff --git a/asynchronix/src/tracing.rs b/nexosim/src/tracing.rs similarity index 97% rename from asynchronix/src/tracing.rs rename to nexosim/src/tracing.rs index 0ec5386..ef590b9 100644 --- a/asynchronix/src/tracing.rs +++ b/nexosim/src/tracing.rs @@ -6,7 +6,7 @@ //! by a model is wrapped in a [`tracing::Span`] with the following metadata: //! //! - name: `model`, -//! - target: `asynchronix`, +//! - target: `nexosim`, //! - verbosity level: [`Level::INFO`](tracing::Level::INFO), //! - a unique field called `name`, associated to the model name provided in //! [`SimInit::add_model`](crate::simulation::SimInit::add_model). @@ -53,7 +53,7 @@ //! configured: //! //! ``` -//! use asynchronix::tracing::SimulationTime; +//! use nexosim::tracing::SimulationTime; //! //! tracing_subscriber::fmt() //! .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) @@ -105,8 +105,8 @@ //! ``` //! //! If the `model` span name collides with that of spans defined outside -//! `asynchronix`, the above filters can be made more specific using -//! `asynchronix[model]` instead of just `[model]`. +//! `nexosim`, the above filters can be made more specific using +//! `nexosim[model]` instead of just `[model]`. //! //! //! # Customization diff --git a/asynchronix/src/util.rs b/nexosim/src/util.rs similarity index 100% rename from asynchronix/src/util.rs rename to nexosim/src/util.rs diff --git a/asynchronix/src/util/bit.rs b/nexosim/src/util/bit.rs similarity index 99% rename from asynchronix/src/util/bit.rs rename to nexosim/src/util/bit.rs index c1e6368..338ba7f 100644 --- a/asynchronix/src/util/bit.rs +++ b/nexosim/src/util/bit.rs @@ -121,7 +121,7 @@ const fn sum_masks() -> [usize; usize::BITS.trailing_zeros() as usize] { m } -#[cfg(all(test, not(asynchronix_loom), not(miri)))] +#[cfg(all(test, not(nexosim_loom), not(miri)))] mod tests { use super::*; use crate::util::rng; diff --git a/asynchronix/src/util/cached_rw_lock.rs b/nexosim/src/util/cached_rw_lock.rs similarity index 99% rename from asynchronix/src/util/cached_rw_lock.rs rename to nexosim/src/util/cached_rw_lock.rs index 1ba6079..c1ea279 100644 --- a/asynchronix/src/util/cached_rw_lock.rs +++ b/nexosim/src/util/cached_rw_lock.rs @@ -119,7 +119,7 @@ impl DerefMut for CachedRwLockWriteGuard<'_, T> { } } -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use super::*; diff --git a/asynchronix/src/util/indexed_priority_queue.rs b/nexosim/src/util/indexed_priority_queue.rs similarity index 99% rename from asynchronix/src/util/indexed_priority_queue.rs rename to nexosim/src/util/indexed_priority_queue.rs index d9339b9..7b28ca5 100644 --- a/asynchronix/src/util/indexed_priority_queue.rs +++ b/nexosim/src/util/indexed_priority_queue.rs @@ -423,7 +423,7 @@ struct UniqueKey { epoch: u64, } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use std::fmt::Debug; diff --git a/asynchronix/src/util/priority_queue.rs b/nexosim/src/util/priority_queue.rs similarity index 98% rename from asynchronix/src/util/priority_queue.rs rename to nexosim/src/util/priority_queue.rs index f8cf5cf..38e24c5 100644 --- a/asynchronix/src/util/priority_queue.rs +++ b/nexosim/src/util/priority_queue.rs @@ -109,7 +109,7 @@ impl PriorityQueue { } } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use super::PriorityQueue; diff --git a/asynchronix/src/util/rng.rs b/nexosim/src/util/rng.rs similarity index 97% rename from asynchronix/src/util/rng.rs rename to nexosim/src/util/rng.rs index c5ae38b..f115b9c 100644 --- a/asynchronix/src/util/rng.rs +++ b/nexosim/src/util/rng.rs @@ -36,7 +36,7 @@ impl Rng { } } -#[cfg(all(test, not(asynchronix_loom), not(miri)))] +#[cfg(all(test, not(nexosim_loom), not(miri)))] mod tests { use super::*; diff --git a/asynchronix/src/util/seq_futures.rs b/nexosim/src/util/seq_futures.rs similarity index 100% rename from asynchronix/src/util/seq_futures.rs rename to nexosim/src/util/seq_futures.rs diff --git a/asynchronix/src/util/slot.rs b/nexosim/src/util/slot.rs similarity index 99% rename from asynchronix/src/util/slot.rs rename to nexosim/src/util/slot.rs index 8dbef05..c8fa52b 100644 --- a/asynchronix/src/util/slot.rs +++ b/nexosim/src/util/slot.rs @@ -321,7 +321,7 @@ pub(crate) fn slot() -> (SlotWriter, SlotReader) { (writer, reader) } -#[cfg(all(test, not(asynchronix_loom)))] +#[cfg(all(test, not(nexosim_loom)))] mod tests { use super::*; @@ -386,7 +386,7 @@ mod tests { } } -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use super::*; diff --git a/asynchronix/src/util/sync_cell.rs b/nexosim/src/util/sync_cell.rs similarity index 99% rename from asynchronix/src/util/sync_cell.rs rename to nexosim/src/util/sync_cell.rs index 075d2b6..164c7c7 100644 --- a/asynchronix/src/util/sync_cell.rs +++ b/nexosim/src/util/sync_cell.rs @@ -208,7 +208,7 @@ impl Clone for SyncCellReader { pub(crate) struct SyncCellReadError {} /// Loom tests. -#[cfg(all(test, asynchronix_loom))] +#[cfg(all(test, nexosim_loom))] mod tests { use super::*; diff --git a/asynchronix/src/util/task_set.rs b/nexosim/src/util/task_set.rs similarity index 100% rename from asynchronix/src/util/task_set.rs rename to nexosim/src/util/task_set.rs diff --git a/asynchronix/tests/integration/main.rs b/nexosim/tests/integration/main.rs similarity index 100% rename from asynchronix/tests/integration/main.rs rename to nexosim/tests/integration/main.rs diff --git a/asynchronix/tests/integration/model_scheduling.rs b/nexosim/tests/integration/model_scheduling.rs similarity index 97% rename from asynchronix/tests/integration/model_scheduling.rs rename to nexosim/tests/integration/model_scheduling.rs index da405d5..f72d90c 100644 --- a/asynchronix/tests/integration/model_scheduling.rs +++ b/nexosim/tests/integration/model_scheduling.rs @@ -2,10 +2,10 @@ use std::time::Duration; -use asynchronix::model::{Context, Model}; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{ActionKey, Mailbox, SimInit}; -use asynchronix::time::MonotonicTime; +use nexosim::model::{Context, Model}; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{ActionKey, Mailbox, SimInit}; +use nexosim::time::MonotonicTime; const MT_NUM_THREADS: usize = 4; diff --git a/asynchronix/tests/integration/simulation_clock_sync.rs b/nexosim/tests/integration/simulation_clock_sync.rs similarity index 95% rename from asynchronix/tests/integration/simulation_clock_sync.rs rename to nexosim/tests/integration/simulation_clock_sync.rs index b819247..1ea7429 100644 --- a/asynchronix/tests/integration/simulation_clock_sync.rs +++ b/nexosim/tests/integration/simulation_clock_sync.rs @@ -3,9 +3,9 @@ use std::thread; use std::time::Duration; -use asynchronix::model::Model; -use asynchronix::simulation::{ExecutionError, Mailbox, SimInit}; -use asynchronix::time::{AutoSystemClock, MonotonicTime}; +use nexosim::model::Model; +use nexosim::simulation::{ExecutionError, Mailbox, SimInit}; +use nexosim::time::{AutoSystemClock, MonotonicTime}; const MT_NUM_THREADS: usize = 4; diff --git a/asynchronix/tests/integration/simulation_deadlock.rs b/nexosim/tests/integration/simulation_deadlock.rs similarity index 97% rename from asynchronix/tests/integration/simulation_deadlock.rs rename to nexosim/tests/integration/simulation_deadlock.rs index 0616c5f..a639b4f 100644 --- a/asynchronix/tests/integration/simulation_deadlock.rs +++ b/nexosim/tests/integration/simulation_deadlock.rs @@ -1,9 +1,9 @@ //! Deadlock-detection for model loops. -use asynchronix::model::Model; -use asynchronix::ports::{Output, Requestor}; -use asynchronix::simulation::{DeadlockInfo, ExecutionError, Mailbox, SimInit}; -use asynchronix::time::MonotonicTime; +use nexosim::model::Model; +use nexosim::ports::{Output, Requestor}; +use nexosim::simulation::{DeadlockInfo, ExecutionError, Mailbox, SimInit}; +use nexosim::time::MonotonicTime; const MT_NUM_THREADS: usize = 4; diff --git a/asynchronix/tests/integration/simulation_panic.rs b/nexosim/tests/integration/simulation_panic.rs similarity index 92% rename from asynchronix/tests/integration/simulation_panic.rs rename to nexosim/tests/integration/simulation_panic.rs index f779d2f..0ab506a 100644 --- a/asynchronix/tests/integration/simulation_panic.rs +++ b/nexosim/tests/integration/simulation_panic.rs @@ -1,9 +1,9 @@ //! Model panic reporting. -use asynchronix::model::Model; -use asynchronix::ports::Output; -use asynchronix::simulation::{ExecutionError, Mailbox, SimInit}; -use asynchronix::time::MonotonicTime; +use nexosim::model::Model; +use nexosim::ports::Output; +use nexosim::simulation::{ExecutionError, Mailbox, SimInit}; +use nexosim::time::MonotonicTime; const MT_NUM_THREADS: usize = 4; diff --git a/asynchronix/tests/integration/simulation_scheduling.rs b/nexosim/tests/integration/simulation_scheduling.rs similarity index 97% rename from asynchronix/tests/integration/simulation_scheduling.rs rename to nexosim/tests/integration/simulation_scheduling.rs index 0057071..98db53a 100644 --- a/asynchronix/tests/integration/simulation_scheduling.rs +++ b/nexosim/tests/integration/simulation_scheduling.rs @@ -3,11 +3,11 @@ use std::time::Duration; #[cfg(not(miri))] -use asynchronix::model::Context; -use asynchronix::model::Model; -use asynchronix::ports::{EventBuffer, Output}; -use asynchronix::simulation::{Address, Mailbox, Scheduler, SimInit, Simulation}; -use asynchronix::time::MonotonicTime; +use nexosim::model::Context; +use nexosim::model::Model; +use nexosim::ports::{EventBuffer, Output}; +use nexosim::simulation::{Address, Mailbox, Scheduler, SimInit, Simulation}; +use nexosim::time::MonotonicTime; const MT_NUM_THREADS: usize = 4; @@ -259,7 +259,7 @@ fn schedule_periodic_keyed_events_mt() { use std::time::{Instant, SystemTime}; #[cfg(not(miri))] -use asynchronix::time::{AutoSystemClock, Clock, SystemClock}; +use nexosim::time::{AutoSystemClock, Clock, SystemClock}; // Model that outputs timestamps at init and each time its input is triggered. #[cfg(not(miri))] @@ -275,7 +275,7 @@ impl TimestampModel { } #[cfg(not(miri))] impl Model for TimestampModel { - async fn init(mut self, _: &mut Context) -> asynchronix::model::InitializedModel { + async fn init(mut self, _: &mut Context) -> nexosim::model::InitializedModel { self.stamp.send((Instant::now(), SystemTime::now())).await; self.into() } diff --git a/asynchronix/tests/integration/simulation_timeout.rs b/nexosim/tests/integration/simulation_timeout.rs similarity index 93% rename from asynchronix/tests/integration/simulation_timeout.rs rename to nexosim/tests/integration/simulation_timeout.rs index f5bc825..454f354 100644 --- a/asynchronix/tests/integration/simulation_timeout.rs +++ b/nexosim/tests/integration/simulation_timeout.rs @@ -5,10 +5,10 @@ use std::sync::Arc; use std::thread; use std::time::Duration; -use asynchronix::model::Model; -use asynchronix::ports::Output; -use asynchronix::simulation::{ExecutionError, Mailbox, SimInit}; -use asynchronix::time::MonotonicTime; +use nexosim::model::Model; +use nexosim::ports::Output; +use nexosim::simulation::{ExecutionError, Mailbox, SimInit}; +use nexosim::time::MonotonicTime; const MT_NUM_THREADS: usize = 4;