pub struct System {
pub clock: Instant,
pub devices: HashMap<String, Device>,
pub event_queue: Vec<NextStep>,
pub debuggables: Vec<Device>,
pub bus: Rc<RefCell<Bus>>,
pub buses: HashMap<String, Rc<RefCell<Bus>>>,
pub interrupt_controller: RefCell<InterruptController>,
}
Fields§
§clock: Instant
§devices: HashMap<String, Device>
§event_queue: Vec<NextStep>
§debuggables: Vec<Device>
§bus: Rc<RefCell<Bus>>
§buses: HashMap<String, Rc<RefCell<Bus>>>
§interrupt_controller: RefCell<InterruptController>
Implementations§
source§impl System
impl System
pub fn get_bus(&self) -> RefMut<'_, Bus>
pub fn get_interrupt_controller(&self) -> RefMut<'_, InterruptController>
pub fn get_device(&self, name: &str) -> Result<Device, Error>
pub fn add_device(&mut self, name: &str, device: Device) -> Result<(), Error>
pub fn add_addressable_device( &mut self, addr: Address, device: Device ) -> Result<(), Error>
pub fn add_peripheral( &mut self, name: &str, addr: Address, device: Device ) -> Result<(), Error>
pub fn add_interruptable_device( &mut self, name: &str, device: Device ) -> Result<(), Error>
fn process_one_event(&mut self) -> Result<(), Error>
sourcepub fn step_until_device(&mut self, device: Device) -> Result<(), Error>
pub fn step_until_device(&mut self, device: Device) -> Result<(), Error>
Step through the simulation until the next event is for the given device
sourcepub fn step_until_debuggable(&mut self) -> Result<(), Error>
pub fn step_until_debuggable(&mut self) -> Result<(), Error>
Step through the simulation until the next event scheduled is for a debuggable device
sourcepub fn run_until_clock(&mut self, clock: Instant) -> Result<(), Error>
pub fn run_until_clock(&mut self, clock: Instant) -> Result<(), Error>
Run the simulation until the given simulation clock time has been reached
sourcepub fn run_for_duration(&mut self, elapsed: Duration) -> Result<(), Error>
pub fn run_for_duration(&mut self, elapsed: Duration) -> Result<(), Error>
Run the simulation for elapsed
amount of simulation time
sourcepub fn run_forever(&mut self) -> Result<(), Error>
pub fn run_forever(&mut self) -> Result<(), Error>
Run the simulation forever, or until there is an error
pub fn exit_error(&mut self)
pub fn get_next_event_device(&self) -> Device
pub fn get_next_debuggable_device(&self) -> Option<Device>
fn try_add_debuggable(&mut self, device: Device)
fn try_queue_device(&mut self, device: Device)
fn queue_device(&mut self, device_step: NextStep)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for System
impl !RefUnwindSafe for System
impl !Send for System
impl !Sync for System
impl Unpin for System
impl !UnwindSafe for System
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, S> IntoAddress<T> for Swhere
T: FromAddress<S>,
impl<T, S> IntoAddress<T> for Swhere
T: FromAddress<S>,
source§fn into_address(self) -> T
fn into_address(self) -> T
Translate the given address into an address of type
T