TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
523 stars 42 forks source link

Schematic viewer build failed with systemverilog file #423

Open ilongshan opened 11 months ago

ilongshan commented 11 months ago

Describe the bug Schematic viewer failed with the following systemverilog file:

Code

`ifndef INCLUDED_types_def
`define INCLUDED_types_def

typedef struct packed {
    logic                               sao_merge_left_flag  ;
    logic                               sao_merge_up_flag    ;
    logic             [0:2][1:0]        sao_type_idx         ;
    logic signed [0:2][0:4][3:0]        sao_offset           ;

    logic             [0:2][4:0]        sao_band_position    ;
    logic             [0:2][1:0]        sao_eo_class         ;

} sao_params_t;

typedef struct packed {
    logic               [11:0]       reserved;
    logic               [ 3:0]       num_of_pics;
    logic [0:15][14:0]       deltaPoc; 
} rps_t;

typedef struct packed {
    logic signed [1: 0][14:0]         mv     ;
} Mv;

typedef struct packed {
    Mv                                 mv         ;
    logic               [ 3:0]         refIdx     ;

} MvField;

`define BitsMvf 34

typedef struct packed {
    logic              [11:0]   x0;
    logic              [11:0]   y0;
    logic              [ 6:0]   CbSize;
    logic         [3:0][ 6:0]   nPbW;
    logic         [3:0][ 6:0]   nPbH;
    logic         [3:0][ 5:0]   xPb;
    logic         [3:0][ 5:0]   yPb;
    MvField       [3:0]         mvf;
    logic         [3:0]         parse_done;
} PuInfo;

`endif

Please complete the following information:

Screenshots

image

Additional context The terosHDL version is V5.0.5

gmartina commented 1 month ago

@ilongshan The reason it fails is because it can not find a top level. Toplevel keywords are defined in this line:

_packages/colibri/src/utils/hdlutils.ts regex = /(?<type>module|program|interface|package|primitive|config|property)\s+(?:automatic\s+)?( <name>\w+)/gm;