Skip to content

Commit

Permalink
Merge pull request #3233 from alainmarcel/alainmarcel-patch-1
Browse files Browse the repository at this point in the history
Implicit signed/unsigned var
  • Loading branch information
alaindargelas authored Sep 20, 2022
2 parents d173e85 + 615a611 commit b4ad3fc
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 62 deletions.
18 changes: 10 additions & 8 deletions src/DesignCompile/CompileType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
20 changes: 10 additions & 10 deletions tests/ImplicitPort/ImplicitPort.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -985,8 +985,7 @@ design: (work@add)
|vpiActual:
\_logic_net: ([email protected]), 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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -1102,6 +1101,7 @@ design: (work@add)
|vpiSize:64
|UINT:0
|vpiConstType:9
|vpiSigned:1
|vpiName:sum
|vpiFullName:[email protected]
|vpiSigned:1
Expand Down Expand Up @@ -1177,8 +1177,7 @@ design: (work@add)
|vpiActual:
\_logic_net: ([email protected]), 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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/SimpleClass1/SimpleClass1.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/SimpleInterface/SimpleInterface.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/AmiqEth/AmiqEth.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/AmiqSimpleTestSuite/AmiqSimpleTestSuite.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/BuildUVMPkg/BuildUVMPkg.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions third_party/tests/CoresSweRV/CoresSweRV.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/Driver/Driver.log
Original file line number Diff line number Diff line change
Expand Up @@ -838,15 +838,15 @@ 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
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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/Ibex/Ibex.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/IbexGoogle/IbexGoogle.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/MiniAmiq/MiniAmiq.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/Monitor/Monitor.log
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,15 @@ 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
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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/Opentitan/Opentitan.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/Scoreboard/Scoreboard.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/SeqDriver/SeqDriver.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions third_party/tests/SimpleUVM/SimpleUVM.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit b4ad3fc

Please sign in to comment.