diff --git a/src/DesignCompile/CompileType.cpp b/src/DesignCompile/CompileType.cpp index 2ff5d4acfe..baacb65ab9 100644 --- a/src/DesignCompile/CompileType.cpp +++ b/src/DesignCompile/CompileType.cpp @@ -1165,32 +1165,34 @@ UHDM::typespec* CompileHelper::compileTypespec( break; } case VObjectType::slSigning_Signed: { - // Parameter implicit type is int - if (ranges) { - int_typespec* tps = s.MakeInt_typespec(); + if (isVariable) { + // 6.8 Variable declarations, implicit type + logic_typespec* tps = s.MakeLogic_typespec(); tps->VpiSigned(true); tps->Ranges(ranges); result = tps; } else { + // Parameter implicit type is int int_typespec* tps = s.MakeInt_typespec(); tps->VpiSigned(true); + tps->Ranges(ranges); result = tps; } - fC->populateCoreMembers(type, type, result); break; } case VObjectType::slSigning_Unsigned: { - // Parameter implicit type is int - if (ranges) { - int_typespec* tps = s.MakeInt_typespec(); + if (isVariable) { + // 6.8 Variable declarations, implicit type + logic_typespec* tps = s.MakeLogic_typespec(); tps->Ranges(ranges); result = tps; } else { + // Parameter implicit type is int int_typespec* tps = s.MakeInt_typespec(); + tps->Ranges(ranges); result = tps; } - fC->populateCoreMembers(type, type, result); break; } diff --git a/tests/ImplicitPort/ImplicitPort.log b/tests/ImplicitPort/ImplicitPort.log index 2fb3135888..cc6f88b85f 100644 --- a/tests/ImplicitPort/ImplicitPort.log +++ b/tests/ImplicitPort/ImplicitPort.log @@ -362,11 +362,11 @@ enum_const 5 enum_typespec 1 enum_var 1 function 9 -int_typespec 12 +int_typespec 9 int_var 4 io_decl 11 logic_net 6 -logic_typespec 4 +logic_typespec 7 logic_var 1 module 3 operation 1 @@ -389,11 +389,11 @@ enum_const 10 enum_typespec 2 enum_var 1 function 18 -int_typespec 12 +int_typespec 9 int_var 4 io_decl 22 logic_net 6 -logic_typespec 4 +logic_typespec 7 logic_var 1 module 3 operation 2 @@ -985,8 +985,7 @@ design: (work@add) |vpiActual: \_logic_net: (work@add.sum), line:3:24, endln:3:27 |vpiTypedef: - \_int_typespec: , line:3:10, endln:3:16 - |vpiSigned:1 + \_logic_typespec: , line:3:10, endln:3:16 |vpiRange: \_range: , line:3:17, endln:3:23 |vpiLeftRange: @@ -1005,6 +1004,7 @@ design: (work@add) |vpiSize:64 |UINT:0 |vpiConstType:9 + |vpiSigned:1 |vpiContAssign: \_cont_assign: , line:5:8, endln:5:19 |vpiParent: @@ -1082,8 +1082,7 @@ design: (work@add) |vpiParent: \_module: work@add (work@add), file:dut.sv, line:1:1, endln:6:10 |vpiTypespec: - \_int_typespec: , line:3:10, endln:3:16 - |vpiSigned:1 + \_logic_typespec: , line:3:10, endln:3:16 |vpiRange: \_range: , line:3:17, endln:3:23 |vpiLeftRange: @@ -1102,6 +1101,7 @@ design: (work@add) |vpiSize:64 |UINT:0 |vpiConstType:9 + |vpiSigned:1 |vpiName:sum |vpiFullName:work@add.sum |vpiSigned:1 @@ -1177,8 +1177,7 @@ design: (work@add) |vpiActual: \_logic_net: (work@add.sum), line:3:24, endln:3:27 |vpiTypedef: - \_int_typespec: , line:3:10, endln:3:16 - |vpiSigned:1 + \_logic_typespec: , line:3:10, endln:3:16 |vpiRange: \_range: , line:3:17, endln:3:23 |vpiParent: @@ -1199,6 +1198,7 @@ design: (work@add) |vpiSize:64 |UINT:0 |vpiConstType:9 + |vpiSigned:1 |vpiInstance: \_module: work@add (work@add), file:dut.sv, line:1:1, endln:6:10 |vpiContAssign: diff --git a/tests/SimpleClass1/SimpleClass1.log b/tests/SimpleClass1/SimpleClass1.log index e80c9dd83c..8782eefe5a 100644 --- a/tests/SimpleClass1/SimpleClass1.log +++ b/tests/SimpleClass1/SimpleClass1.log @@ -832,11 +832,11 @@ if_stmt 10696 import_typespec 1 include_file_info 166 indexed_part_select 121 -int_typespec 6535 +int_typespec 6533 int_var 2626 io_decl 12883 logic_net 347 -logic_typespec 200 +logic_typespec 202 logic_var 71 long_int_typespec 179 long_int_var 15 diff --git a/tests/SimpleInterface/SimpleInterface.log b/tests/SimpleInterface/SimpleInterface.log index dabd7f5998..a3c3dffb67 100644 --- a/tests/SimpleInterface/SimpleInterface.log +++ b/tests/SimpleInterface/SimpleInterface.log @@ -2213,13 +2213,13 @@ if_stmt 4422 include_file_info 166 indexed_part_select 41 initial 1 -int_typespec 2680 +int_typespec 2678 int_var 1171 interface 5 interface_typespec 3 io_decl 6913 logic_net 475 -logic_typespec 104 +logic_typespec 106 logic_var 42 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/AmiqEth/AmiqEth.log b/third_party/tests/AmiqEth/AmiqEth.log index d486465145..6e80494482 100644 --- a/third_party/tests/AmiqEth/AmiqEth.log +++ b/third_party/tests/AmiqEth/AmiqEth.log @@ -1655,13 +1655,13 @@ import_typespec 12 include_file_info 332 indexed_part_select 241 initial 1 -int_typespec 49110 +int_typespec 49108 int_var 6809 integer_typespec 190 integer_var 107 io_decl 22344 logic_net 988 -logic_typespec 437 +logic_typespec 439 logic_var 136 long_int_typespec 256 long_int_var 26 diff --git a/third_party/tests/AmiqSimpleTestSuite/AmiqSimpleTestSuite.log b/third_party/tests/AmiqSimpleTestSuite/AmiqSimpleTestSuite.log index acabf90202..1dde0dad4a 100644 --- a/third_party/tests/AmiqSimpleTestSuite/AmiqSimpleTestSuite.log +++ b/third_party/tests/AmiqSimpleTestSuite/AmiqSimpleTestSuite.log @@ -918,13 +918,13 @@ import_typespec 17 include_file_info 200 indexed_part_select 121 initial 8 -int_typespec 7109 +int_typespec 7107 int_var 2733 interface 14 interface_typespec 3 io_decl 13135 logic_net 702 -logic_typespec 227 +logic_typespec 229 logic_var 92 long_int_typespec 179 long_int_var 15 diff --git a/third_party/tests/BuildUVMPkg/BuildUVMPkg.log b/third_party/tests/BuildUVMPkg/BuildUVMPkg.log index a3f296d613..3f9d09fecd 100644 --- a/third_party/tests/BuildUVMPkg/BuildUVMPkg.log +++ b/third_party/tests/BuildUVMPkg/BuildUVMPkg.log @@ -727,10 +727,10 @@ hier_path 8021 if_else 811 if_stmt 4420 indexed_part_select 41 -int_typespec 2321 +int_typespec 2319 int_var 1157 io_decl 6904 -logic_typespec 76 +logic_typespec 78 logic_var 38 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/CoresSweRV/CoresSweRV.log b/third_party/tests/CoresSweRV/CoresSweRV.log index 57204c8485..8306fda5a0 100644 --- a/third_party/tests/CoresSweRV/CoresSweRV.log +++ b/third_party/tests/CoresSweRV/CoresSweRV.log @@ -4852,13 +4852,13 @@ import_typespec 29 include_file_info 177 indexed_part_select 122 initial 1 -int_typespec 12069 +int_typespec 12067 int_var 1205 integer_typespec 24 integer_var 3 io_decl 6982 logic_net 29243 -logic_typespec 50486 +logic_typespec 50488 logic_var 4305 long_int_typespec 99 long_int_var 7 @@ -4954,13 +4954,13 @@ import_typespec 29 include_file_info 177 indexed_part_select 188 initial 2 -int_typespec 12081 +int_typespec 12079 int_var 8488 integer_typespec 24 integer_var 3 io_decl 55673 logic_net 29243 -logic_typespec 50486 +logic_typespec 50488 logic_var 4412 long_int_typespec 99 long_int_var 139 diff --git a/third_party/tests/Driver/Driver.log b/third_party/tests/Driver/Driver.log index db4de1c61c..3446f23b65 100644 --- a/third_party/tests/Driver/Driver.log +++ b/third_party/tests/Driver/Driver.log @@ -838,7 +838,7 @@ if_stmt 4452 include_file_info 175 indexed_part_select 41 initial 1 -int_typespec 2651 +int_typespec 2649 int_var 1181 integer_typespec 5 integer_var 5 @@ -846,7 +846,7 @@ interface 3 interface_typespec 1 io_decl 6955 logic_net 343 -logic_typespec 85 +logic_typespec 87 logic_var 42 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/Ibex/Ibex.log b/third_party/tests/Ibex/Ibex.log index 78517a0eb9..2624a1cfb2 100644 --- a/third_party/tests/Ibex/Ibex.log +++ b/third_party/tests/Ibex/Ibex.log @@ -1615,14 +1615,14 @@ import_typespec 51 include_file_info 212 indexed_part_select 290 initial 9 -int_typespec 26230 +int_typespec 26228 int_var 6019 integer_typespec 41 interface 24 interface_typespec 15 io_decl 25063 logic_net 3457 -logic_typespec 5175 +logic_typespec 5177 logic_var 902 long_int_typespec 339 long_int_var 31 diff --git a/third_party/tests/IbexGoogle/IbexGoogle.log b/third_party/tests/IbexGoogle/IbexGoogle.log index b065ea1e02..3a0cafb62c 100644 --- a/third_party/tests/IbexGoogle/IbexGoogle.log +++ b/third_party/tests/IbexGoogle/IbexGoogle.log @@ -978,11 +978,11 @@ import_typespec 10 include_file_info 196 indexed_part_select 126 initial 1 -int_typespec 8209 +int_typespec 8207 int_var 2868 io_decl 13340 logic_net 409 -logic_typespec 200 +logic_typespec 202 logic_var 71 long_int_typespec 179 long_int_var 15 diff --git a/third_party/tests/MiniAmiq/MiniAmiq.log b/third_party/tests/MiniAmiq/MiniAmiq.log index 84c1dac637..e919dda8d2 100644 --- a/third_party/tests/MiniAmiq/MiniAmiq.log +++ b/third_party/tests/MiniAmiq/MiniAmiq.log @@ -845,13 +845,13 @@ import_typespec 4 include_file_info 183 indexed_part_select 81 initial 1 -int_typespec 4406 +int_typespec 4404 int_var 1985 interface 1 interface_typespec 1 io_decl 10137 logic_net 57 -logic_typespec 138 +logic_typespec 140 logic_var 55 long_int_typespec 139 long_int_var 11 diff --git a/third_party/tests/Monitor/Monitor.log b/third_party/tests/Monitor/Monitor.log index 845aa95a61..d28282c027 100644 --- a/third_party/tests/Monitor/Monitor.log +++ b/third_party/tests/Monitor/Monitor.log @@ -908,7 +908,7 @@ import_typespec 4 include_file_info 245 indexed_part_select 81 initial 2 -int_typespec 4741 +int_typespec 4739 int_var 2008 integer_typespec 5 integer_var 5 @@ -916,7 +916,7 @@ interface 4 interface_typespec 2 io_decl 10158 logic_net 425 -logic_typespec 147 +logic_typespec 149 logic_var 61 long_int_typespec 139 long_int_var 11 diff --git a/third_party/tests/Opentitan/Opentitan.log b/third_party/tests/Opentitan/Opentitan.log index 99751ecac6..47c5329886 100644 --- a/third_party/tests/Opentitan/Opentitan.log +++ b/third_party/tests/Opentitan/Opentitan.log @@ -8363,14 +8363,14 @@ import_typespec 93 include_file_info 153 indexed_part_select 452 initial 123 -int_typespec 16327 +int_typespec 16325 int_var 1240 integer_typespec 207 integer_var 2 interface 5 io_decl 7045 logic_net 20830 -logic_typespec 44337 +logic_typespec 44339 logic_var 9305 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/Scoreboard/Scoreboard.log b/third_party/tests/Scoreboard/Scoreboard.log index 3f18d40ad1..dbf2f45ee5 100644 --- a/third_party/tests/Scoreboard/Scoreboard.log +++ b/third_party/tests/Scoreboard/Scoreboard.log @@ -822,13 +822,13 @@ if_else 822 if_stmt 4432 include_file_info 174 indexed_part_select 41 -int_typespec 2383 +int_typespec 2381 int_var 1169 integer_typespec 6 integer_var 6 io_decl 6943 logic_net 10 -logic_typespec 76 +logic_typespec 78 logic_var 42 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/SeqDriver/SeqDriver.log b/third_party/tests/SeqDriver/SeqDriver.log index 97f03ab82b..43c474dbb2 100644 --- a/third_party/tests/SeqDriver/SeqDriver.log +++ b/third_party/tests/SeqDriver/SeqDriver.log @@ -810,13 +810,13 @@ import_typespec 4 include_file_info 166 indexed_part_select 81 initial 3 -int_typespec 3973 +int_typespec 3971 int_var 1874 interface 3 interface_typespec 1 io_decl 9911 logic_net 324 -logic_typespec 143 +logic_typespec 145 logic_var 60 long_int_typespec 139 long_int_var 11 diff --git a/third_party/tests/SimpleUVM/SimpleUVM.log b/third_party/tests/SimpleUVM/SimpleUVM.log index 9084eec29b..f07cf952f0 100644 --- a/third_party/tests/SimpleUVM/SimpleUVM.log +++ b/third_party/tests/SimpleUVM/SimpleUVM.log @@ -803,13 +803,13 @@ immediate_assert 1 include_file_info 166 indexed_part_select 41 initial 3 -int_typespec 2432 +int_typespec 2430 int_var 1163 interface 1 interface_typespec 1 io_decl 6908 logic_net 311 -logic_typespec 91 +logic_typespec 93 logic_var 39 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/UVMNestedSeq/UVMNestedSeq.log b/third_party/tests/UVMNestedSeq/UVMNestedSeq.log index ead3ddd331..ec2bb14cd7 100644 --- a/third_party/tests/UVMNestedSeq/UVMNestedSeq.log +++ b/third_party/tests/UVMNestedSeq/UVMNestedSeq.log @@ -903,13 +903,13 @@ import_typespec 11 include_file_info 218 indexed_part_select 201 initial 2 -int_typespec 9397 +int_typespec 9395 int_var 4059 interface 4 interface_typespec 7 io_decl 18988 logic_net 352 -logic_typespec 332 +logic_typespec 334 logic_var 116 long_int_typespec 259 long_int_var 23 diff --git a/third_party/tests/UVMSwitch/UVMSwitch.log b/third_party/tests/UVMSwitch/UVMSwitch.log index 5b4ddccf06..023bd2e3ee 100644 --- a/third_party/tests/UVMSwitch/UVMSwitch.log +++ b/third_party/tests/UVMSwitch/UVMSwitch.log @@ -6847,7 +6847,7 @@ immediate_assert 3 include_file_info 175 indexed_part_select 41 initial 2 -int_typespec 3563 +int_typespec 3561 int_var 1223 integer_typespec 9 integer_var 9 @@ -6855,7 +6855,7 @@ interface 17 interface_typespec 6 io_decl 6968 logic_net 565 -logic_typespec 248 +logic_typespec 250 logic_var 44 long_int_typespec 99 long_int_var 7 diff --git a/third_party/tests/UnitAmiqEth/UnitAmiqEth.log b/third_party/tests/UnitAmiqEth/UnitAmiqEth.log index f3cba9bfe8..fb4cbe0486 100644 --- a/third_party/tests/UnitAmiqEth/UnitAmiqEth.log +++ b/third_party/tests/UnitAmiqEth/UnitAmiqEth.log @@ -1325,13 +1325,13 @@ immediate_assert 4 import_typespec 4 include_file_info 259 indexed_part_select 113 -int_typespec 6416 +int_typespec 6414 int_var 2598 integer_typespec 129 integer_var 80 io_decl 13487 logic_net 52 -logic_typespec 221 +logic_typespec 223 logic_var 86 long_int_typespec 139 long_int_var 11 diff --git a/third_party/tests/YosysSmall/YosysSmall.log b/third_party/tests/YosysSmall/YosysSmall.log index 09c3d4b1af..b8e5f30921 100644 --- a/third_party/tests/YosysSmall/YosysSmall.log +++ b/third_party/tests/YosysSmall/YosysSmall.log @@ -81,13 +81,13 @@ if_else 4 if_stmt 2 include_file_info 1 initial 2 -int_typespec 12 +int_typespec 9 int_var 4 integer_typespec 1 integer_var 1 io_decl 11 logic_net 54 -logic_typespec 49 +logic_typespec 52 logic_var 1 module 13 operation 32 diff --git a/third_party/tests/xgate/Xgate.log b/third_party/tests/xgate/Xgate.log index a0d51ca133..009b4f02f8 100644 --- a/third_party/tests/xgate/Xgate.log +++ b/third_party/tests/xgate/Xgate.log @@ -5482,12 +5482,12 @@ if_else 2556 if_stmt 2592 indexed_part_select 33 initial 23 -int_typespec 24159 +int_typespec 24122 int_var 4 integer_typespec 61 io_decl 11 logic_net 115231 -logic_typespec 107499 +logic_typespec 107536 logic_var 1 module 23127 operation 42458 @@ -5531,12 +5531,12 @@ if_else 5075 if_stmt 5111 indexed_part_select 33 initial 2542 -int_typespec 24159 +int_typespec 24122 int_var 4 integer_typespec 61 io_decl 22 logic_net 115231 -logic_typespec 107499 +logic_typespec 107536 logic_var 1 module 23127 operation 90504