From 0c9549379436a6e73b1a89d2a6c1a050e76a5473 Mon Sep 17 00:00:00 2001 From: mole99 Date: Sat, 2 Sep 2023 15:57:04 +0200 Subject: [PATCH] Add has_index flag to interconnect_port_s --- vpi/sdf_parse.y | 5 ++--- vpi/sdf_priv.h | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vpi/sdf_parse.y b/vpi/sdf_parse.y index caad9b898..70f0b6af5 100644 --- a/vpi/sdf_parse.y +++ b/vpi/sdf_parse.y @@ -469,16 +469,15 @@ port /* | hierarchical_identifier '[' INTEGER ']' */ ; - /* Since INTERCONNECT is ignored we can also ignore a vector bit. */ port_interconnect : hierarchical_identifier { - struct interconnect_port_s tmp = {$1, -1}; + struct interconnect_port_s tmp = {$1, false, 0}; $$ = tmp; } | hierarchical_identifier '[' INTEGER ']' { - struct interconnect_port_s tmp = {$1, $3}; + struct interconnect_port_s tmp = {$1, true, $3}; $$ = tmp; } ; diff --git a/vpi/sdf_priv.h b/vpi/sdf_priv.h index f1b9bdfb4..60889eb9a 100644 --- a/vpi/sdf_priv.h +++ b/vpi/sdf_priv.h @@ -20,6 +20,7 @@ */ # include +# include /* * Invoke the parser to parse the opened SDF file. The fd is the SDF @@ -55,7 +56,8 @@ struct port_with_edge_s { struct interconnect_port_s { char* name; - int index; // -1 for whole vector + bool has_index; + int index; // invalid if has_index is false }; extern void sdf_select_instance(const char*celltype, const char*inst,