我想将逻辑打包数组转换longint unsigned
为 systemverilog,然后我可以使用 DPI-C 将其导出为 C++ unsigned long。我使用的模拟器是 Verilator。检查下面的示例。
logic[31:0] v1;
logic[63:0] v2;
int a = signed'(v1); //cast to signed int
int b = int'(v1); //cast to signed int
int unsigned c = unsigned'(v1); //cast to unsigned int
longint d = longint'(v2); //cast to signed long
//longint unsigned e = longint unsigned'(v2); //This doesn't work. I need to cast to unsigned long.