-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
target-specific configuration in settings.yaml
- Loading branch information
1 parent
b198aec
commit f598498
Showing
7 changed files
with
97 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] | ||
#[derive(Clone, PartialEq, Eq, Debug, Default)] | ||
#[non_exhaustive] | ||
pub struct RiscvConfig { | ||
pub core_interrupts: Vec<RiscvEnumItem>, | ||
pub exceptions: Vec<RiscvEnumItem>, | ||
pub priorities: Vec<RiscvEnumItem>, | ||
pub harts: Vec<RiscvEnumItem>, | ||
pub clint: Option<RiscvClintConfig>, | ||
pub plic: Option<RiscvPlicConfig>, | ||
} | ||
|
||
#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] | ||
#[derive(Clone, PartialEq, Eq, Debug, Default)] | ||
#[non_exhaustive] | ||
pub struct RiscvEnumItem { | ||
pub name: String, | ||
pub value: usize, | ||
pub description: Option<String>, | ||
} | ||
|
||
impl RiscvEnumItem { | ||
pub fn description(&self) -> String { | ||
let description = match &self.description { | ||
Some(d) => d, | ||
None => &self.name, | ||
}; | ||
format!("{} - {}", self.value, description) | ||
} | ||
} | ||
|
||
#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] | ||
#[derive(Clone, PartialEq, Eq, Debug, Default)] | ||
#[non_exhaustive] | ||
pub struct RiscvClintConfig { | ||
pub name: String, | ||
pub freq: Option<usize>, | ||
pub async_delay: bool, | ||
} | ||
|
||
#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] | ||
#[derive(Clone, PartialEq, Eq, Debug, Default)] | ||
#[non_exhaustive] | ||
pub struct RiscvPlicConfig { | ||
pub name: String, | ||
pub core_interrupt: Option<String>, | ||
pub hart_id: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters