pyucis icon indicating copy to clipboard operation
pyucis copied to clipboard

Merge multiple of cov file

Open sklee0913 opened this issue 1 year ago • 2 comments

Hi,

Gad to use this one for my project. I have many thousands of coverage files ( 20k files), with multiple covergroups and thousands coverpoints. It seems that the merge function got trouble when merging and I had to separate merge-list-file to merge them one by one, when merging them at the same time: huge RAM usage happened and killed the section by memory leak.

pyucis merge $(cat merge.lists) -o merge.xml

I believe that I can support to fix this issue or optimize it, but how can I help you?

sklee0913 avatar Oct 12 '24 05:10 sklee0913

i am not python dev. so, how can i start modify & debug this software. Thanks. I will try to dev and share

sklee0913 avatar Oct 12 '24 05:10 sklee0913

Hi dev,

Same person (sklee) , I propose the method like this. the ideal is mergeing each of read input, not read all and merge later.

modified at def merge(args): function

out_if = output_desc.fmt_if()
out_db : UCIS = out_if.create()
db_if : FormatIfDb = input_desc.fmt_if()
merger = DbMerger()

for input in args.db:
    print("read and merge: ", input)
    out_db_ref : UCIS = out_if.create()
    db_l : List[UCIS] = []
    try:
        db = db_if.read(input)
        db_l.append(db)
        db_l.append(out_db)
    except Exception as e:
        raise Exception("Failed to read input file %s: %s" % (
            input,
            str(e)
        ))

    try:
        merger.merge(out_db_ref, db_l)
    except Exception as e:
        raise Exception("Merge operation failed: %s" % str(e))

    out_db = out_db_ref
    db.close()

out_db.write(args.out)

hapv3 avatar Oct 17 '24 07:10 hapv3