Add has_index flag to interconnect_port_s

This commit is contained in:
mole99 2023-09-02 15:57:04 +02:00
parent 665295ba00
commit 0c95493794
2 changed files with 5 additions and 4 deletions

View File

@ -469,16 +469,15 @@ port
/* | hierarchical_identifier '[' INTEGER ']' */ /* | hierarchical_identifier '[' INTEGER ']' */
; ;
/* Since INTERCONNECT is ignored we can also ignore a vector bit. */
port_interconnect port_interconnect
: hierarchical_identifier : hierarchical_identifier
{ {
struct interconnect_port_s tmp = {$1, -1}; struct interconnect_port_s tmp = {$1, false, 0};
$$ = tmp; $$ = tmp;
} }
| hierarchical_identifier '[' INTEGER ']' | hierarchical_identifier '[' INTEGER ']'
{ {
struct interconnect_port_s tmp = {$1, $3}; struct interconnect_port_s tmp = {$1, true, $3};
$$ = tmp; $$ = tmp;
} }
; ;

View File

@ -20,6 +20,7 @@
*/ */
# include <stdio.h> # include <stdio.h>
# include <stdbool.h>
/* /*
* Invoke the parser to parse the opened SDF file. The fd is the SDF * 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 { struct interconnect_port_s {
char* name; 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, extern void sdf_select_instance(const char*celltype, const char*inst,