From 786953787ffa29392a7b67c7aedd44b8cd79b6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Cicho=C5=84?= Date: Fri, 23 Feb 2024 05:45:32 +0100 Subject: [PATCH] dsn: add loading of assignments of pins to nets --- src/dsn/de.rs | 7 ++++++- src/dsn/structure.rs | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/dsn/de.rs b/src/dsn/de.rs index bb4fb80..cda0736 100644 --- a/src/dsn/de.rs +++ b/src/dsn/de.rs @@ -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; } diff --git a/src/dsn/structure.rs b/src/dsn/structure.rs index 23c821e..b283b84 100644 --- a/src/dsn/structure.rs +++ b/src/dsn/structure.rs @@ -171,9 +171,24 @@ pub struct Attach(pub bool); #[derive(Deserialize, Debug)] #[serde(rename = "network")] pub struct Network { + pub nets: Option>, pub classes: Vec, } +#[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, +} + +#[derive(Deserialize, Debug)] +#[serde(rename = "pins")] +pub struct Pins { + pub ids: Vec, +} + #[derive(Deserialize, Debug)] #[serde(rename = "class")] pub struct Class {