dsn: add loading of assignments of pins to nets

This commit is contained in:
Tomasz Cichoń 2024-02-23 05:45:32 +01:00
parent bf7d89e7bd
commit 786953787f
2 changed files with 21 additions and 1 deletions

View File

@ -611,7 +611,12 @@ impl<'de, 'a> SeqAccess<'de> for StructFields<'a, 'de> {
// TODO explain this part of empty option detection
if let Some(lookahead) = self.de.next_name_lookahead() {
if lookahead != self.fields[self.current_field] {
self.de.next_option_empty_hint = true;
if lookahead + "s" != self.fields[self.current_field] {
self.de.next_option_empty_hint = true;
}
else {
self.de.next_option_empty_hint = false;
}
} else {
self.de.next_option_empty_hint = false;
}

View File

@ -171,9 +171,24 @@ pub struct Attach(pub bool);
#[derive(Deserialize, Debug)]
#[serde(rename = "network")]
pub struct Network {
pub nets: Option<Vec<NetPinAssignments>>,
pub classes: Vec<Class>,
}
#[derive(Deserialize, Debug)]
#[serde(rename = "net")]
// dsn names this "net", but it's a structure unrelated to "net" in wiring or elsewhere
pub struct NetPinAssignments {
pub net: String,
pub pins: Vec<Pins>,
}
#[derive(Deserialize, Debug)]
#[serde(rename = "pins")]
pub struct Pins {
pub ids: Vec<String>,
}
#[derive(Deserialize, Debug)]
#[serde(rename = "class")]
pub struct Class {