System Verilog syntax Error--数据类型

文章讨论了在SystemVerilog中使用VCS时遇到的错误,特别是关于packed和unpackedunion的成员大小一致性问题,以及unpacked结构中包含packed成员的情况。默认情况下,VCS不支持unpackedunion的编译。
摘要由CSDN通过智能技术生成

Union 

Error-[PUMSS] Incorrect packed union members size

Packed union members must have same size

Error-[USVSUU] Unsupported System Verilog construct

默认情况为unpacked的,VCS不支持编译unpacked的 union

Unpacked unions are not yet supported

//typedef union{   //❌,VCS不支持
typedef union packed{//👌
    //bit [15:0] buf_a; //❌ 联合体成员buf_a和buf_b size须相同
    bit [7:0] buf_a;//👌
    bit [7:0] buf_b;  
} data_u;

array

Error-[UMPSU] Unpacked member

Packed structure 'io_tx_wqe' contains unpacked members

  typedef struct packed {
        bit [31:0] buf_addr_hi;
        bit [31:0] buf_addr_lo;
    } io_tx_buf_desc;

    typedef struct packed {
        io_tx_buf_desc [2:0] sgl;  //👌
        //io_tx_buf_desc  sgl[3];  //❌
        bit [7:0] aa;
    } io_tx_wqe;

合并数组:io_tx_buf_desc [2:0] sgl;

非合并数组:io_tx_buf_desc  sgl[3];

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值