From 3fcb6b064b2d6e06c78124259f2ae3e584328088 Mon Sep 17 00:00:00 2001 From: Lennart Van Hirtum Date: Fri, 26 Jul 2024 12:54:11 +0200 Subject: [PATCH] Move arrays back to type in codegen --- src/codegen_fallback.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/codegen_fallback.rs b/src/codegen_fallback.rs index e5d39bc..95733cc 100644 --- a/src/codegen_fallback.rs +++ b/src/codegen_fallback.rs @@ -47,9 +47,9 @@ fn typ_to_declaration(mut typ: &ConcreteType, var_name: &str) -> String { ConcreteType::Named(id) => { let sz = get_type_name_size(*id); if sz == 1 { - format!("logic {var_name}{array_string}") + format!("logic{array_string} {var_name}") } else { - format!("logic[{}:0] {var_name}{array_string}", sz - 1) + format!("logic{array_string}[{}:0] {var_name}", sz - 1) } } ConcreteType::Array(_) => unreachable!("All arrays have been used up already"), @@ -93,6 +93,10 @@ impl<'g, 'out, Stream: std::fmt::Write> CodeGenerationContext<'g, 'out, Stream> } } + fn can_inline_assign(&self, wire: &RealWire) -> bool { + + } + fn operation_to_string(&self, wire: &RealWire) -> String { match &wire.source { RealWireDataSource::Constant { value } => value.to_string(),