Skip to content

Commit

Permalink
hier path binding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Aug 2, 2023
1 parent 6f954fd commit 92b175b
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 328 deletions.
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,25 @@
}
]
},
{
"name": "Rggen",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/dbuild/bin/surelog",
"args": ["-f", "Rggen.sl", "-parse", "-elabuhdm"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/third_party/tests/rggen",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "SimpleClass2",
"type": "cppdbg",
Expand Down
30 changes: 28 additions & 2 deletions src/DesignCompile/NetlistElaboration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,20 @@ bool NetlistElaboration::high_conn_(ModuleInstance* instance) {
sigId = fC->Child(Primary_literal);
}
std::string sigName;
if (fC->Type(sigId) == VObjectType::slStringConst)
sigName = fC->SymName(sigId);
bool modPort = true;
if (hexpr && hexpr->UhdmType() == uhdmhier_path) {
hier_path* hier = (hier_path*)hexpr;
for (auto p : *hier->Path_elems()) {
if (p->UhdmType() != uhdmref_obj) {
modPort = false;
break;
}
}
}
if (modPort) {
if (fC->Type(sigId) == VObjectType::slStringConst)
sigName = fC->SymName(sigId);
}
std::string baseName = sigName;
std::string selectName;
if (NodeId subId = fC->Sibling(sigId)) {
Expand Down Expand Up @@ -2781,6 +2793,20 @@ any* NetlistElaboration::bind_net_(ModuleInstance* instance,
}
}
}
if (netlist->interfaces()) {
for (interface_inst* var : *netlist->interfaces()) {
if (var->VpiName() == name) {
return var;
}
}
for (interface_inst* var : *netlist->interfaces()) {
std::string_view basename =
StringUtils::rtrim_until(var->VpiName(), '[');
if (basename == name) {
return var;
}
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/googletest
12 changes: 6 additions & 6 deletions third_party/tests/CoresSweRVMP/CoresSweRVMP.log
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
CMake that the project does not need compatibility with older versions.


-- Configuring done (0.1s)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: ${SURELOG_DIR}/build/regression/CoresSweRVMP/slpp_all/mp_parser
[100%] Generating preprocessing
Expand Down Expand Up @@ -135,8 +135,8 @@ CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
-- Generating done (0.0s)
-- Build files have been written to: ${SURELOG_DIR}/build/regression/CoresSweRVMP/slpp_all/mp_preprocess
[ 6%] Generating 10_lsu_bus_intf.sv
[ 12%] Generating 11_ifu_bp_ctl.sv
[ 18%] Generating 13_ifu_mem_ctl.sv
[ 12%] Generating 13_ifu_mem_ctl.sv
[ 18%] Generating 11_ifu_bp_ctl.sv
[ 25%] Generating 12_beh_lib.sv
[ 31%] Generating 14_mem_lib.sv
[ 37%] Generating 15_exu.sv
Expand All @@ -146,9 +146,9 @@ CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
[ 62%] Generating 3_rvjtag_tap.sv
[ 68%] Generating 4_dec_tlu_ctl.sv
[ 75%] Generating 5_lsu_bus_buffer.sv
[ 87%] Generating 6_dbg.sv
[ 87%] Generating 8_ifu_aln_ctl.sv
[ 93%] Generating 7_axi4_to_ahb.sv
[ 81%] Generating 6_dbg.sv
[ 87%] Generating 7_axi4_to_ahb.sv
[ 93%] Generating 8_ifu_aln_ctl.sv
[100%] Generating 9_tb_top.sv
[100%] Built target Parse
Surelog parsing status: 0
Expand Down
224 changes: 5 additions & 219 deletions third_party/tests/NyuziProcessor/NyuziProcessor.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion third_party/tests/OVMSwitch/OVMSwitch.log
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ integer_var 75
interface_inst 17
interface_typespec 6
io_decl 3594
logic_net 474
logic_net 473
logic_typespec 356
logic_var 35
method_func_call 3687
Expand Down
26 changes: 3 additions & 23 deletions third_party/tests/Rp32/rp32.log
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ interface_array 2
interface_inst 13
interface_typespec 21
io_decl 235
logic_net 561
logic_net 560
logic_typespec 1528
logic_var 245
modport 22
Expand Down Expand Up @@ -508,7 +508,7 @@ interface_array 2
interface_inst 13
interface_typespec 21
io_decl 428
logic_net 561
logic_net 560
logic_typespec 1528
logic_var 249
modport 22
Expand Down Expand Up @@ -539,32 +539,12 @@ union_typespec 6
union_var 1
unsupported_typespec 15
=== UHDM Object Stats End ===
[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:287:10: Unresolved hierarchical reference "bus_mem[0].rdy".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:278:16: Unresolved hierarchical reference "bus_mem[0].clk".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:279:16: Unresolved hierarchical reference "bus_mem[0].vld".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:279:34: Unresolved hierarchical reference "bus_mem[0].wen".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:280:16: Unresolved hierarchical reference "bus_mem[0].vld".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:280:34: Unresolved hierarchical reference "bus_mem[0].wen".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:281:16: Unresolved hierarchical reference "bus_mem[0].adr[RAW - 1:]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:282:16: Unresolved hierarchical reference "bus_mem[0].ben".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:283:16: Unresolved hierarchical reference "bus_mem[0].wdt".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/Rp32/hdl/rtl/soc/r5p_soc_top.sv:284:16: Unresolved hierarchical reference "bus_mem[0].rdt".

[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/rp32/slpp_all/surelog.uhdm ...

[INF:UH0709] Writing UHDM Html Coverage: ${SURELOG_DIR}/build/regression/rp32/slpp_all/checker/surelog.chk.html ...

[ FATAL] : 0
[ SYNTAX] : 0
[ ERROR] : 10
[ ERROR] : 0
[WARNING] : 20
[ NOTE] : 76
2 changes: 1 addition & 1 deletion third_party/tests/SVSwitch/SVSwitch.log
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ interface_array 1
interface_inst 23
interface_typespec 16
io_decl 51
logic_net 248
logic_net 247
logic_typespec 296
logic_var 49
method_func_call 43
Expand Down
2 changes: 1 addition & 1 deletion third_party/tests/Tnoc/Tnoc.log
Original file line number Diff line number Diff line change
Expand Up @@ -5745,7 +5745,7 @@ interface_array 320
interface_inst 7819
interface_typespec 10963
io_decl 37307
logic_net 563
logic_net 291
logic_typespec 15338
logic_var 16212
method_func_call 37
Expand Down
2 changes: 1 addition & 1 deletion third_party/tests/UVMSwitch/UVMSwitch.log
Original file line number Diff line number Diff line change
Expand Up @@ -6971,7 +6971,7 @@ integer_var 9
interface_inst 17
interface_typespec 6
io_decl 6968
logic_net 499
logic_net 498
logic_typespec 351
logic_var 44
long_int_typespec 99
Expand Down
76 changes: 3 additions & 73 deletions third_party/tests/rggen/Rggen.log
Original file line number Diff line number Diff line change
Expand Up @@ -9094,7 +9094,7 @@ interface_array 6
interface_inst 1172
interface_typespec 1848
io_decl 17294
logic_net 4413
logic_net 4408
logic_typespec 17444
logic_var 7678
modport 2612
Expand Down Expand Up @@ -9164,7 +9164,7 @@ interface_array 6
interface_inst 1916
interface_typespec 1848
io_decl 48082
logic_net 4413
logic_net 4408
logic_typespec 17444
logic_var 34716
modport 3966
Expand All @@ -9188,82 +9188,12 @@ unsupported_typespec 1
var_select 2484
while_stmt 84
=== UHDM Object Stats End ===
[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:514:30: Unresolved hierarchical reference "register_if[3].value[16+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:689:30: Unresolved hierarchical reference "register_if[0].value[0+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:713:30: Unresolved hierarchical reference "register_if[4].value[8+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:806:30: Unresolved hierarchical reference "register_if[3].value[8+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:851:30: Unresolved hierarchical reference "register_if[3].value[16+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:900:30: Unresolved hierarchical reference "register_if[0].value[8+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:925:30: Unresolved hierarchical reference "register_if[1].value[0+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:975:30: Unresolved hierarchical reference "register_if[0].value[8+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1000:30: Unresolved hierarchical reference "register_if[1].value[0+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1076:30: Unresolved hierarchical reference "register_if[0].value[0+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1100:30: Unresolved hierarchical reference "register_if[6].value[4+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1153:30: Unresolved hierarchical reference "register_if[0].value[0+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1177:30: Unresolved hierarchical reference "register_if[6].value[16+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1847:34: Unresolved hierarchical reference "register_if[0].value[0+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1847:62: Unresolved hierarchical reference "register_if[0].value[4+:4]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1847:90: Unresolved hierarchical reference "register_if[0].value[8+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_0.sv:1930:30: Unresolved hierarchical reference "register_if[0].value[8+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:104:15: Unresolved hierarchical reference "register_if[i].valid".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:105:15: Unresolved hierarchical reference "register_if[i].access".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:106:15: Unresolved hierarchical reference "register_if[i].address".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:107:15: Unresolved hierarchical reference "register_if[i].write_data".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:108:15: Unresolved hierarchical reference "register_if[i].strobe".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:142:29: Unresolved hierarchical reference "register_if[i].active".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:143:29: Unresolved hierarchical reference "register_if[i].ready".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:144:30: Unresolved hierarchical reference "register_if[i].status".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_adapter_common.sv:144:53: Unresolved hierarchical reference "register_if[i].read_data".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sv-rtl/rggen_apb_bridge.sv:13:30: Unresolved hierarchical reference "apb_if.ADDRESS_WIDTH".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:159:34: Unresolved hierarchical reference "register_if[0].value[0+:8]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:159:62: Unresolved hierarchical reference "register_if[1].value[0+:8]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:211:34: Unresolved hierarchical reference "register_if[0].value[0+:8]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:211:62: Unresolved hierarchical reference "register_if[1].value[0+:8]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:328:42: Unresolved hierarchical reference "register_if[0].value[0+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:356:42: Unresolved hierarchical reference "register_if[12].value[0+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:356:42: Unresolved hierarchical reference "register_if[12].value[1+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:356:42: Unresolved hierarchical reference "register_if[19].value[0+:1]".

[ERR:UH0725] ${SURELOG_DIR}/third_party/tests/rggen/rggen-sample/block_1.sv:356:42: Unresolved hierarchical reference "register_if[19].value[1+:1]".

[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/Rggen/slpp_all/surelog.uhdm ...

[ FATAL] : 0
[ SYNTAX] : 0
[ ERROR] : 36
[ ERROR] : 1
[WARNING] : 20
[ NOTE] : 18

0 comments on commit 92b175b

Please sign in to comment.