Skip to content

Commit

Permalink
Merge pull request #3947 from alainmarcel/alainmarcel-patch-1
Browse files Browse the repository at this point in the history
vpiSigned property on vars, typespec ignored by synlig
  • Loading branch information
alaindargelas authored Dec 27, 2023
2 parents 2f3b7aa + 65838fa commit f1e9d4d
Show file tree
Hide file tree
Showing 44 changed files with 122 additions and 6 deletions.
12 changes: 11 additions & 1 deletion src/DesignCompile/CompileHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,14 @@ bool CompileHelper::compileDataDeclaration(
NodeId intVec_TypeReg = fC->Child(data_type);
if (fC->Type(intVec_TypeReg) == VObjectType::paVIRTUAL)
intVec_TypeReg = fC->Sibling(intVec_TypeReg);
if (fC->Type(intVec_TypeReg) == VObjectType::paIntegerAtomType_Byte ||
fC->Type(intVec_TypeReg) == VObjectType::paIntegerAtomType_Int ||
fC->Type(intVec_TypeReg) == VObjectType::paIntegerAtomType_Integer ||
fC->Type(intVec_TypeReg) == VObjectType::paIntegerAtomType_LongInt ||
fC->Type(intVec_TypeReg) == VObjectType::paIntegerAtomType_Shortint ||
fC->Type(intVec_TypeReg) == VObjectType::paReal_number) {
is_signed = true;
}
NodeId packedDimension = fC->Sibling(intVec_TypeReg);
if (fC->Type(packedDimension) == VObjectType::slStringConst) {
// class or package name;
Expand All @@ -2294,6 +2302,7 @@ bool CompileHelper::compileDataDeclaration(
packedDimension = fC->Sibling(packedDimension);
} else if (fC->Type(packedDimension) == VObjectType::paSigning_Unsigned) {
packedDimension = fC->Sibling(packedDimension);
is_signed = false;
}
NodeId unpackedDimension;
NodeId list_of_variable_decl_assignments = fC->Sibling(data_type);
Expand Down Expand Up @@ -3486,7 +3495,8 @@ bool CompileHelper::compileParameterDeclaration(
type == VObjectType::paIntegerAtomType_Int ||
type == VObjectType::paIntegerAtomType_Integer ||
type == VObjectType::paIntegerAtomType_LongInt ||
type == VObjectType::paIntegerAtomType_Shortint) {
type == VObjectType::paIntegerAtomType_Shortint ||
type == VObjectType::paReal_number) {
isSigned = true;
}
if (fC->Type(Signage) == VObjectType::paSigning_Signed) isSigned = true;
Expand Down
1 change: 1 addition & 0 deletions tests/AlwaysNoElab/AlwaysNoElab.log
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ design: (work@dut)
\_int_typespec: , line:7:3, endln:7:6
|vpiName:device
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_constant: , line:7:16, endln:7:17
Expand Down
2 changes: 2 additions & 0 deletions tests/ArrayMethodIterator/ArrayMethodIterator.log
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ design: (work@top)
\_int_typespec: , line:7:4, endln:7:7
|vpiName:get_inst_id
|vpiFullName:pkg::uvm_callback::get_inst_id
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiClassDefn:
Expand Down Expand Up @@ -647,6 +648,7 @@ design: (work@top)
\_int_typespec: , line:7:4, endln:7:7
|vpiName:get_inst_id
|vpiFullName:pkg::uvm_callback::get_inst_id
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_class_typespec: (pkg::uvm_callbacks), line:29:1, endln:29:6
Expand Down
2 changes: 2 additions & 0 deletions tests/AssociativeArray/AssociativeArray.log
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ design: (work@top)
\_array_typespec:
|vpiName:a
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:3
Expand Down Expand Up @@ -262,6 +263,7 @@ design: (work@top)
\_array_typespec:
|vpiName:b
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:3
Expand Down
2 changes: 2 additions & 0 deletions tests/BindMethod/BindMethod.log
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ design: (unnamed)
\_int_typespec: , line:10:3, endln:10:6
|vpiName:fname
|vpiFullName:uvm::uvm_vreg_field_cbs::fname
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiExtends:
Expand Down Expand Up @@ -522,6 +523,7 @@ design: (unnamed)
\_int_typespec: , line:10:3, endln:10:6
|vpiName:fname
|vpiFullName:uvm::uvm_vreg_field_cbs::fname
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
===================
Expand Down
1 change: 1 addition & 0 deletions tests/Bindings/Bindings.log
Original file line number Diff line number Diff line change
Expand Up @@ -3494,6 +3494,7 @@ design: (work@dut1)
\_int_typespec: , line:26:3, endln:26:6
|vpiName:device
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_constant: , line:26:16, endln:26:17
Expand Down
2 changes: 2 additions & 0 deletions tests/BlackBox/BlackBox.log
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ design: (work@top)
\_int_typespec: , line:7:1, endln:7:4
|vpiName:wb_writeback_en
|vpiFullName:[email protected]_gen[0].core.wb_writeback_en
|vpiSigned:1
|vpiVisibility:1
|vpiInstance:
\_module_inst: work@core ([email protected]_gen[0].core), file:${SURELOG_DIR}/tests/BlackBox/dut.sv, line:18:13, endln:18:26
Expand Down Expand Up @@ -425,6 +426,7 @@ design: (work@top)
\_int_typespec: , line:7:1, endln:7:4
|vpiName:wb_writeback_en
|vpiFullName:[email protected]_gen[0].core.wb_writeback_en
|vpiSigned:1
|vpiVisibility:1
\_int_typespec: , line:7:1, endln:7:4
|vpiSigned:1
Expand Down
5 changes: 5 additions & 0 deletions tests/BuiltInMethod/BuiltInMethod.log
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ design: (work@top)
\_array_typespec:
|vpiName:b
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiExpr:
Expand Down Expand Up @@ -326,6 +327,7 @@ design: (work@top)
\_byte_typespec: , line:3:5, endln:3:9
|vpiName:o
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_hier_path: (b), line:3:14, endln:3:19
Expand Down Expand Up @@ -358,6 +360,7 @@ design: (work@top)
\_byte_typespec: , line:4:5, endln:4:9
|vpiName:o
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_hier_path: (b), line:4:14, endln:4:18
Expand Down Expand Up @@ -390,6 +393,7 @@ design: (work@top)
\_byte_typespec: , line:5:5, endln:5:9
|vpiName:o
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_hier_path: (b), line:5:14, endln:5:19
Expand Down Expand Up @@ -422,6 +426,7 @@ design: (work@top)
\_byte_typespec: , line:6:5, endln:6:9
|vpiName:o
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_hier_path: (b), line:6:14, endln:6:22
Expand Down
3 changes: 3 additions & 0 deletions tests/CastTypespec/CastTypespec.log
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,7 @@ design: (work@tlul_adapter_host)
\_int_typespec: , line:28:5, endln:28:8
|vpiName:a
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_int_var: ([email protected]), line:28:11, endln:28:12
Expand All @@ -2398,6 +2399,7 @@ design: (work@tlul_adapter_host)
\_int_typespec: , line:28:5, endln:28:8
|vpiName:b
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_int_var: ([email protected]), line:28:13, endln:28:14
Expand All @@ -2412,6 +2414,7 @@ design: (work@tlul_adapter_host)
\_int_typespec: , line:28:5, endln:28:8
|vpiName:c
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiParameter:
\_parameter: ([email protected]), line:35:14, endln:35:24
Expand Down
2 changes: 2 additions & 0 deletions tests/ClassFuncTask/ClassFuncTask.log
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ design: (unnamed)
\_int_typespec: , line:13:3, endln:13:6
|vpiName:x
|vpiFullName:pack::C::x
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiParameter:
Expand Down Expand Up @@ -485,6 +486,7 @@ design: (unnamed)
\_int_typespec: , line:13:3, endln:13:6
|vpiName:x
|vpiFullName:pack::C::x
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_bit_typespec: , line:6:3, endln:6:18
Expand Down
4 changes: 4 additions & 0 deletions tests/ClassMethodCall/ClassMethodCall.log
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ design: (work@door_mod)
\_int_typespec: , line:6:5, endln:6:8
|vpiName:state
|vpiFullName:pack::door::state
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiVariables:
Expand All @@ -137,6 +138,7 @@ design: (work@door_mod)
\_int_typespec: , line:7:5, endln:7:8
|vpiName:timer
|vpiFullName:pack::door::timer
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiVariables:
Expand Down Expand Up @@ -817,6 +819,7 @@ design: (work@door_mod)
\_int_typespec: , line:6:5, endln:6:8
|vpiName:state
|vpiFullName:pack::door::state
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_int_typespec: , line:7:5, endln:7:8
Expand All @@ -835,6 +838,7 @@ design: (work@door_mod)
\_int_typespec: , line:7:5, endln:7:8
|vpiName:timer
|vpiFullName:pack::door::timer
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_logic_typespec: , line:8:5, endln:8:10
Expand Down
4 changes: 4 additions & 0 deletions tests/ClassMini/ClassMini.log
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ design: (work@door_mod)
\_int_typespec: , line:4:5, endln:4:8
|vpiName:state
|vpiFullName:pack::door::state
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiVariables:
Expand All @@ -128,6 +129,7 @@ design: (work@door_mod)
\_int_typespec: , line:5:5, endln:5:8
|vpiName:timer
|vpiFullName:pack::door::timer
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
|vpiVariables:
Expand Down Expand Up @@ -562,6 +564,7 @@ design: (work@door_mod)
\_int_typespec: , line:4:5, endln:4:8
|vpiName:state
|vpiFullName:pack::door::state
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_int_typespec: , line:5:5, endln:5:8
Expand All @@ -580,6 +583,7 @@ design: (work@door_mod)
\_int_typespec: , line:5:5, endln:5:8
|vpiName:timer
|vpiFullName:pack::door::timer
|vpiSigned:1
|vpiAutomatic:1
|vpiVisibility:1
\_logic_typespec: , line:6:5, endln:6:10
Expand Down
4 changes: 4 additions & 0 deletions tests/DelayAssign/DelayAssign.log
Original file line number Diff line number Diff line change
Expand Up @@ -2485,6 +2485,7 @@ design: (work@SimDTM)
\_int_typespec: , line:42:3, endln:42:6
|vpiName:__debug_req_bits_addr
|vpiFullName:work@SimDTM.__debug_req_bits_addr
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_int_var: (work@SimDTM.__debug_req_bits_op), line:43:7, endln:43:26
Expand All @@ -2499,6 +2500,7 @@ design: (work@SimDTM)
\_int_typespec: , line:43:3, endln:43:6
|vpiName:__debug_req_bits_op
|vpiFullName:work@SimDTM.__debug_req_bits_op
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_int_var: (work@SimDTM.__debug_req_bits_data), line:44:7, endln:44:28
Expand All @@ -2513,6 +2515,7 @@ design: (work@SimDTM)
\_int_typespec: , line:44:3, endln:44:6
|vpiName:__debug_req_bits_data
|vpiFullName:work@SimDTM.__debug_req_bits_data
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_bit_var: (work@SimDTM.__debug_resp_ready), line:45:7, endln:45:25
Expand Down Expand Up @@ -2541,6 +2544,7 @@ design: (work@SimDTM)
\_int_typespec: , line:46:3, endln:46:6
|vpiName:__exit
|vpiFullName:work@SimDTM.__exit
|vpiSigned:1
|vpiVisibility:1
|vpiDefName:work@SimDTM
|vpiTop:1
Expand Down
2 changes: 2 additions & 0 deletions tests/DollarRoot/DollarRoot.log
Original file line number Diff line number Diff line change
Expand Up @@ -17509,6 +17509,7 @@ design: (work@top)
\_int_typespec: , line:332:4, endln:332:7
|vpiName:pending_read_cycles_slave_0
|vpiFullName:work@test_program.pending_read_cycles_slave_0
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_constant: , line:332:38, endln:332:39
Expand All @@ -17531,6 +17532,7 @@ design: (work@top)
\_int_typespec: , line:475:4, endln:475:7
|vpiName:pending_read_cycles_slave_1
|vpiFullName:work@test_program.pending_read_cycles_slave_1
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_constant: , line:475:38, endln:475:39
Expand Down
7 changes: 7 additions & 0 deletions tests/DynArrayKind/DynArrayKind.log
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ design: (work@top)
\_array_typespec:
|vpiName:dynamic1
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:2
Expand Down Expand Up @@ -348,6 +349,7 @@ design: (work@top)
\_array_typespec:
|vpiName:dynamic2
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:2
Expand Down Expand Up @@ -397,6 +399,7 @@ design: (work@top)
\_array_typespec:
|vpiName:dynamic3
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:2
Expand All @@ -414,6 +417,7 @@ design: (work@top)
\_array_typespec:
|vpiName:dynamic4
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:2
Expand All @@ -431,6 +435,7 @@ design: (work@top)
\_array_typespec:
|vpiName:assoc
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:3
Expand Down Expand Up @@ -460,6 +465,7 @@ design: (work@top)
\_array_typespec:
|vpiName:assoc_string
|vpiFullName:[email protected]_string
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:3
Expand Down Expand Up @@ -489,6 +495,7 @@ design: (work@top)
\_array_typespec:
|vpiName:queue
|vpiFullName:[email protected]
|vpiSigned:1
|vpiRandType:1
|vpiVisibility:1
|vpiArrayType:4
Expand Down
1 change: 1 addition & 0 deletions tests/EnumConstElab/EnumConstElab.log
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ design: (work@top)
\_int_typespec: , line:3:4, endln:3:7
|vpiName:a
|vpiFullName:[email protected]_ctrl_reg_shadowed.staged_reg.a
|vpiSigned:1
|vpiVisibility:1
|vpiExpr:
\_operation: , line:3:12, endln:3:24
Expand Down
2 changes: 2 additions & 0 deletions tests/ForLoop/ForLoop.log
Original file line number Diff line number Diff line change
Expand Up @@ -3091,6 +3091,7 @@ design: (work@t)
\_integer_typespec: , line:3:3, endln:3:10
|vpiName:a
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiVariables:
\_integer_var: ([email protected]), line:3:14, endln:3:15
Expand All @@ -3105,6 +3106,7 @@ design: (work@t)
\_integer_typespec: , line:3:3, endln:3:10
|vpiName:b
|vpiFullName:[email protected]
|vpiSigned:1
|vpiVisibility:1
|vpiDefName:work@t
|vpiTop:1
Expand Down
Loading

0 comments on commit f1e9d4d

Please sign in to comment.