vector unnamed nets are set as net%d_[%d..0] instead of net%d[%d:0] so they are compatible with spice and Vacask

This commit is contained in:
stefan schippers 2025-08-03 00:15:57 +02:00
parent 46fdeb2fd4
commit 6bf4fd4da6
2 changed files with 5 additions and 5 deletions

View File

@ -4022,7 +4022,7 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int
if(*multip <= 1) if(*multip <= 1)
my_snprintf(unconn, S(unconn), "__UNCONNECTED_PIN__%d", xctx->netlist_unconn_cnt++); my_snprintf(unconn, S(unconn), "__UNCONNECTED_PIN__%d", xctx->netlist_unconn_cnt++);
else else
my_snprintf(unconn, S(unconn), "__UNCONNECTED_PIN__%d[%d:0]", xctx->netlist_unconn_cnt++, *multip - 1); my_snprintf(unconn, S(unconn), "__UNCONNECTED_PIN__%d_[%d..0]", xctx->netlist_unconn_cnt++, *multip - 1);
return expandlabel(unconn, &tmp); return expandlabel(unconn, &tmp);
} }
else { /* xctx->inst[i].node[j] not NULL */ else { /* xctx->inst[i].node[j] not NULL */
@ -4035,12 +4035,12 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int
xctx->inst[i].node[j], atoi(xctx->inst[i].node[j]), *multip); xctx->inst[i].node[j], atoi(xctx->inst[i].node[j]), *multip);
if(hash_prefix_unnamed_net) { if(hash_prefix_unnamed_net) {
if(*multip>1) /* unnamed is a bus */ if(*multip>1) /* unnamed is a bus */
my_snprintf(str_node, S(str_node), "%s[%d:0]", (xctx->inst[i].node[j]), *multip-1); my_snprintf(str_node, S(str_node), "%s_[%d..0]", (xctx->inst[i].node[j]), *multip-1);
else else
my_snprintf(str_node, S(str_node), "%s", (xctx->inst[i].node[j]) ); my_snprintf(str_node, S(str_node), "%s", (xctx->inst[i].node[j]) );
} else { } else {
if(*multip>1) /* unnamed is a bus */ if(*multip>1) /* unnamed is a bus */
my_snprintf(str_node, S(str_node), "%s[%d:0]", (xctx->inst[i].node[j])+1, *multip-1); my_snprintf(str_node, S(str_node), "%s_[%d..0]", (xctx->inst[i].node[j])+1, *multip-1);
else else
my_snprintf(str_node, S(str_node), "%s", (xctx->inst[i].node[j])+1 ); my_snprintf(str_node, S(str_node), "%s", (xctx->inst[i].node[j])+1 );
} }

View File

@ -190,7 +190,7 @@ proc test_xschem_simulation {{f simulate_ff.sch}} {
proc netlist_test {} { proc netlist_test {} {
global netlist_dir global netlist_dir
foreach {f t h} { foreach {f t h} {
rom8k.sch spice 4198475513 rom8k.sch spice 1420163769
greycnt.sch verilog 1945914565 greycnt.sch verilog 1945914565
autozero_comp.sch spice 1472671699 autozero_comp.sch spice 1472671699
test_generators.sch spice 49312823 test_generators.sch spice 49312823
@ -201,7 +201,7 @@ proc netlist_test {} {
hierarchical_tedax.sch tedax 998070173 hierarchical_tedax.sch tedax 998070173
LCC_instances.sch spice 2839381760 LCC_instances.sch spice 2839381760
pcb_test1.sch tedax 1925087189 pcb_test1.sch tedax 1925087189
test_doublepin.sch spice 1218682794 test_doublepin.sch spice 4289512068
simulate_ff.sch spice 574849766 simulate_ff.sch spice 574849766
test_symbolgen.sch spice 4216484684 test_symbolgen.sch spice 4216484684
test_mosgen.sch spice 2380524013 test_mosgen.sch spice 2380524013