From e08e9ccdf233188a00e156f858bff9fb0c94fefc Mon Sep 17 00:00:00 2001 From: NotAFile Date: Wed, 6 Apr 2022 00:09:12 +0200 Subject: [PATCH] fix rtlil const formatting --- src/rtlil.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtlil.rs b/src/rtlil.rs index 29519ca..083deb2 100644 --- a/src/rtlil.rs +++ b/src/rtlil.rs @@ -63,7 +63,7 @@ impl SigSpec { impl std::fmt::Display for SigSpec { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - SigSpec::Const(val, width) => write!(f, "{}'{}", width, val)?, + SigSpec::Const(val, width) => write!(f, "{0}'{2:01$b}", width, *width as usize, val)?, SigSpec::Wire(id) => write!(f, "{}", id)?, }; Ok(())