From 11c619e265fc5977e8c46826607fccfb2f3147d0 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 2 May 2026 17:54:10 -0700 Subject: [PATCH] Fix drive strength in net declaration parsing The drive strength of a net must be declared between the net type and the data type. E.g. wire (weak0, strong1) [7:0] x; The current implementation expects the drive strength after the data type. Update the parser to fix this. Signed-off-by: Lars-Peter Clausen --- parse.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.y b/parse.y index d1767a86b..0daadfeaf 100644 --- a/parse.y +++ b/parse.y @@ -4954,14 +4954,14 @@ module_item /* This form doesn't have the range, but does have strengths. This gives strength to the assignment drivers. */ - | attribute_list_opt net_type data_type_or_implicit drive_strength net_decl_assigns ';' - { data_type_t*data_type = $3; - pform_check_net_data_type(@2, $2, $3); + | attribute_list_opt net_type drive_strength data_type_or_implicit net_decl_assigns ';' + { data_type_t*data_type = $4; + pform_check_net_data_type(@2, $2, $4); if (data_type == 0) { data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); FILE_NAME(data_type, @2); } - pform_makewire(@2, 0, $4, $5, $2, data_type, $1); + pform_makewire(@2, 0, $3, $5, $2, data_type, $1); delete $1; }