use probe_rs_target::Chip;
use crate::{
config::{DebugSequence, Registry},
error::Error,
vendor::Vendor,
};
pub mod sequences;
#[derive(docsplay::Display)]
pub struct Sifive;
impl Vendor for Sifive {
fn try_create_debug_sequence(&self, chip: &Chip) -> Option<DebugSequence> {
if chip.name.starts_with("FU740") {
Some(DebugSequence::Riscv(sequences::SifiveSequence::create()))
} else {
None
}
}
fn try_detect_riscv_chip(
&self,
_registry: &Registry,
_probe: &mut crate::architecture::riscv::communication_interface::RiscvCommunicationInterface,
idcode: u32,
) -> Result<Option<String>, Error> {
if idcode == 0x2000_0913 {
tracing::info!(
"SifiveVendor: detected FU740-C000 via IDCODE {:#010x}",
idcode
);
return Ok(Some("FU740-C000".to_string()));
}
Ok(None)
}
}