hash_file(): skip also .include lines if skip_path_lines parameter is set

This commit is contained in:
stefan schippers 2024-03-20 10:45:28 +01:00
parent 61b1c0b368
commit 8329720848
2 changed files with 11 additions and 6 deletions

View File

@ -48,12 +48,17 @@ unsigned int hash_file(const char *f, int skip_path_lines)
fd = fopen(f, "r"); /* windows won't return \r in the lines and we chop them out anyway in the code */
if(fd) {
while((line = my_fgets(fd, &n))) {
/* skip lines of type: '** sch_path: ...' or '-- sch_path: ...' or '// sym_path: ...' */
/* skip lines of type: '** sch_path: ...' or '-- sch_path: ...' or '// sym_path: ...'
* skip also .include /path/to/some/file */
if(skip_path_lines && n > 14) {
if(!strncmp(line+2, " sch_path: ", 11) || !strncmp(line+2, " sym_path: ", 11) ) {
my_free(_ALLOC_ID_, &line);
continue;
}
if(!strncmp(line, ".include ", 9) || !strncmp(line, ".INCLUDE ", 9) ) {
my_free(_ALLOC_ID_, &line);
continue;
}
}
for(i = 0; i < n; ++i) {
/* skip CRs so hashes will match on unix / windows */

View File

@ -190,20 +190,20 @@ proc test_xschem_simulation {{f simulate_ff.sch}} {
proc netlist_test {} {
global netlist_dir
foreach {f t h} {
rom8k.sch spice 665784374
rom8k.sch spice 1488716921
greycnt.sch verilog 2899796185
autozero_comp.sch spice 751826850
autozero_comp.sch spice 2741955505
test_generators.sch spice 49312823
inst_sch_select.sch spice 3684652626
inst_sch_select.sch spice 1539700121
test_bus_tap.sch spice 188702715
loading.sch vhdl 2975204502
mos_power_ampli.sch spice 125840804
mos_power_ampli.sch spice 3405708328
hierarchical_tedax.sch tedax 998070173
LCC_instances.sch spice 1888015492
pcb_test1.sch tedax 1925087189
test_doublepin.sch spice 4159808692
simulate_ff.sch spice 574849766
test_symbolgen.sch spice 2593807370
test_symbolgen.sch spice 4216484684
test_mosgen.sch spice 2380524013
} {
xschem set netlist_type $t