visual diff with numeric field and tolerance (for comparing

F

fogh

Guest
Hi All,

Rather than a full loaded SVS check, I would like to compare 2 netlists where
I expect All subcircuits to have same names and structure, but parameters to be
slightly different.

I am usually using tkdiff for such compares, but I would like now to have
value comparison with a tolerance, in the param=value in the subcircuit calls.

Do you have hints for such a tool ?
 
On Mon, 13 Feb 2006 11:23:51 +0100, fogh
<cad_support@skipthisandunderscores.catena.nl> wrote:

Hi All,

Rather than a full loaded SVS check, I would like to compare 2 netlists where
I expect All subcircuits to have same names and structure, but parameters to be
slightly different.

I am usually using tkdiff for such compares, but I would like now to have
value comparison with a tolerance, in the param=value in the subcircuit calls.

Do you have hints for such a tool ?
I'd have thought a bit of perl which hashes the instances in each subcircuit,
and keeps info about the connections and all the parameters (perhaps in a
sub-hash), and then on the second netlist goes through and compares them.

Ought to be easy enough - if you're making the assumption that all the instance
names match (and net names). If the names don't match, it gets quite a lot
harder...

Regards,

Andrew.
 
If your netlists are available in ordinary ASCII files, the fuzzy number
comparison utilities of "Complite File Comparison Family" recognize
numbers and allow you to apply tolerances to them. Native versions
are available for Windows, OS/2, and DOS.

Demonstration versions are available at

http://world.std.com/~jdveale/index.html

If you have a couple of sample files, I'd be happy to take a look
at them. The keyword and phrase processing facility may allow
for customizing tolerances and so on.

Jim Veale - email: jdveale@world.std.com

fogh <cad_support@skipthisandunderscores.catena.nl> writes:
Rather than a full loaded SVS check, I would like to compare 2 netlists where
I expect All subcircuits to have same names and structure, but parameters to be
slightly different.

I am usually using tkdiff for such compares, but I would like now to have
value comparison with a tolerance, in the param=value in the subcircuit calls.

Do you have hints for such a tool ?
 
If you are on Windows, you can check my Compare It! tool from
http://www.grigsoft.com/. It can be configured to ignore everything
after '=', for example. If you don't need merging, you can also do line
sorting to get better comparison results. It's not free, however
full-featured trial will help you to do one-time task without problems.

Igor Green
http://www.grigsoft.com/
Compare It! + Synchronize It! - files and folders comparison never was
easier!
 
If you are on Windows, you can check my Compare It! tool from
http://www.grigsoft.com/. It can be configured to ignore everything
after '=', for example. If you don't need merging, you can also do line
sorting to get better comparison results. It's not free, however
full-featured trial will help you to do one-time task without problems.

Igor Green
http://www.grigsoft.com/
Compare It! + Synchronize It! - files and folders comparison never was
easier!
 
Andrew Beckett wrote:
On Mon, 13 Feb 2006 11:23:51 +0100, fogh
cad_support@skipthisandunderscores.catena.nl> wrote:


Hi All,

Rather than a full loaded SVS check, I would like to compare 2 netlists where
I expect All subcircuits to have same names and structure, but parameters to be
slightly different.

I am usually using tkdiff for such compares, but I would like now to have
value comparison with a tolerance, in the param=value in the subcircuit calls.

Do you have hints for such a tool ?


I'd have thought a bit of perl which hashes the instances in each subcircuit,
and keeps info about the connections and all the parameters (perhaps in a
sub-hash), and then on the second netlist goes through and compares them.

Ought to be easy enough - if you're making the assumption that all the instance
names match (and net names). If the names don't match, it gets quite a lot
harder...
Andrew,

I am too rusty on perl. In fact names change but the netlist lines can be
compared 1to1 , so I made a quick and dirty merger below.

I wish that forall() would accept also the syntax
forall( (x1 x2) l1 l2
MyPred(x1 x2)
)
Is there already a PCR for that ?



procedure(CmCompareNetlists(nl1 nl2 nlout abstol reltol)
let( (line)
line=0
n1=infile(nl1) n2=infile(nl2)
fpo=outfile(nlout)
while( (l1=gets(s n1)) && (l2=gets(s n2))
line=line++

if( index(l1 "=")
then
if(CmDiffToleranceLineCompare(l1 l2 abstol reltol)
then fprintf(fpo "%s" l2)
else fprintf(fpo "%s" l1)
);fi
else fprintf(fpo "%s" l1)
);fi
);while lines
close(n1) close(n2) close(fpo)
))

procedure(CmDiffToleranceLineCompare(l1 l2 abstol reltol)
let( (l1v l2v el1 el2 l1p l2p)
el1=parseString(l1) el2=parseString(l2)
match=(length(el1)==length(el2))
l1v=foreach(mapcar pair setof(e el1 index(e "="))
aelNumber(cadr(parseString(pair "="))))
l2v=foreach(mapcar pair setof(e el2 index(e "="))
aelNumber(cadr(parseString(pair "="))))
l1p=foreach(mapcar pair setof(e el1 index(e "=")) car(parseString(pair "=")))
l2p=foreach(mapcar pair setof(e el2 index(e "=")) car(parseString(pair "=")))
match=match&&forall(x foreach(mapcar (p1 p2) cdr(l1p) cdr(l2p) p1==p2 ) x) ;;
use cdr to skip the < > left/right indication of diff. If used directly on a
netlist, it skips the instance name.
match=match&& forall(x foreach(mapcar (v1 v2) l1v l2v {
if( v1 && v2
then
absdiff=abs(v1-v2)
reldiff=if( abs(v1+v2)>1f*absdiff
absdiff/abs((v1+v2)/2)
1e+15
)
absdiff <= abstol || reldiff <= reltol
else
el1==el2
);fi
}) x)
);let
);proc
 
On Wed, 15 Feb 2006 19:34:34 +0100, fogh
Andrew,

I am too rusty on perl. In fact names change but the netlist lines can be
compared 1to1 , so I made a quick and dirty merger below.

I wish that forall() would accept also the syntax
forall( (x1 x2) l1 l2
MyPred(x1 x2)
)
Is there already a PCR for that ?
Not as far as I know - although I vaguely recall one of my colleagues filing a
PCR for something like this...

You can easily (!) write one using a macro though:

(defmacro ABforall (loopVar @rest args)
(let (_lists _remainder)
(if (listp loopVar)
(progn
; get the arguments which are the lists. There are as
; many of these as loop variables in the loopVar list
(setq _lists
(foreach maplist (_dummy _list) loopVar args
(setq _remainder _list)
(car _list)
))
; then use a foreach, with a return to break out of it
; early if the condition fails
`(prog ()
(foreach ,loopVar ,@_lists
(unless (progn ,@(cdr _remainder))
(return nil)))
(return t))
)
; if the loop variable is not a list, just use forall.
; cope with a variable length body though - which forall doesn't
`(forall ,loopVar ,(car args) (progn ,@(cdr args)))
)
)
)


Regards,

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top