pub struct RiscvCommunicationInterface { /* private fields */ }
Expand description

A interface that implements controls for RISC-V cores.

Implementations§

source§

impl RiscvCommunicationInterface

source

pub fn new( probe: Box<dyn JTAGAccess> ) -> Result<Self, (Box<dyn JTAGAccess>, RiscvError)>

Creates a new RISC-V communication interface with a given probe driver.

source

pub fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>

Deassert the target reset.

source

pub fn read_idcode(&mut self) -> Result<u32, DebugProbeError>

Read the targets IDCODE.

source

pub fn read_csr_progbuf(&mut self, address: u16) -> Result<u32, RiscvError>

Read the CSR progbuf register.

source

pub fn write_csr_progbuf( &mut self, address: u16, value: u32 ) -> Result<(), RiscvError>

Write the CSR progbuf register.

source

pub fn close(self) -> Probe

Destruct the interface and return the stored probe driver.

Trait Implementations§

source§

impl Debug for RiscvCommunicationInterface

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl MemoryInterface for RiscvCommunicationInterface

source§

fn supports_native_64bit_access(&mut self) -> bool

Does this interface support native 64-bit wide accesses Read more
source§

fn read_word_64(&mut self, address: u64) -> Result<u64, Error>

Read a 64bit word of at address. Read more
source§

fn read_word_32(&mut self, address: u64) -> Result<u32, Error>

Read a 32bit word of at address. Read more
source§

fn read_word_8(&mut self, address: u64) -> Result<u8, Error>

Read an 8bit word of at address.
source§

fn read_64(&mut self, address: u64, data: &mut [u64]) -> Result<(), Error>

Read a block of 64bit words at address. Read more
source§

fn read_32(&mut self, address: u64, data: &mut [u32]) -> Result<(), Error>

Read a block of 32bit words at address. Read more
source§

fn read_8(&mut self, address: u64, data: &mut [u8]) -> Result<(), Error>

Read a block of 8bit words at address.
source§

fn read(&mut self, address: u64, data: &mut [u8]) -> Result<(), Error>

Read data from address. Read more
source§

fn write_word_64(&mut self, address: u64, data: u64) -> Result<(), Error>

Write a 64bit word at address. Read more
source§

fn write_word_32(&mut self, address: u64, data: u32) -> Result<(), Error>

Write a 32bit word at address. Read more
source§

fn write_word_8(&mut self, address: u64, data: u8) -> Result<(), Error>

Write an 8bit word at address.
source§

fn write_64(&mut self, address: u64, data: &[u64]) -> Result<(), Error>

Write a block of 64bit words at address. Read more
source§

fn write_32(&mut self, address: u64, data: &[u32]) -> Result<(), Error>

Write a block of 32bit words at address. Read more
source§

fn write_8(&mut self, address: u64, data: &[u8]) -> Result<(), Error>

Write a block of 8bit words at address.
source§

fn write(&mut self, address: u64, data: &[u8]) -> Result<(), Error>

Write a block of 8bit words at address. May use 64 bit memory access, so should only be used if reading memory locations that don’t have side effects. Generally faster than MemoryInterface::write_8. Read more
source§

fn supports_8bit_transfers(&self) -> Result<bool, Error>

Returns whether the current platform supports native 8bit transfers.
source§

fn flush(&mut self) -> Result<(), Error>

Flush any outstanding operations. Read more
source§

fn read_mem_64bit(&mut self, address: u64, data: &mut [u8]) -> Result<(), Error>

Reads bytes using 64 bit memory access. Address must be 64 bit aligned and data must be an exact multiple of 8.
source§

fn read_mem_32bit(&mut self, address: u64, data: &mut [u8]) -> Result<(), Error>

Reads bytes using 32 bit memory access. Address must be 32 bit aligned and data must be an exact multiple of 4.
source§

fn write_mem_64bit(&mut self, address: u64, data: &[u8]) -> Result<(), Error>

Writes bytes using 64 bit memory access. Address must be 64 bit aligned and data must be an exact multiple of 8.
source§

fn write_mem_32bit(&mut self, address: u64, data: &[u8]) -> Result<(), Error>

Writes bytes using 32 bit memory access. Address must be 32 bit aligned and data must be an exact multiple of 8.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more