Error?: A .cmp file for a test with extra or missing pin names is not warned about.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error?: A .cmp file for a test with extra or missing pin names is not warned about.

Michael Gainer
E.g, if my chip has an IN field named "a", but my .cmp file has a column named "in", then the problem reported is "Comparison failure at line 1".  It seems like eval should warn about missing or extra items in the .cmp file rather than silently using a default value, no?

Repro:

---------------.hdl
CHIP Name {
    IN a;
    OUT out;
    PARTS:
    Not(a=a, out=boof);
    Not(a=boof, out=out);
}

-------------- .tst
load Name.hdl,
output-file Name.out,
compare-to Name.cmp,
output-list a%B3.1.3 out%B3.1.3;

set a 0,
eval,
output;

set a 1,
eval,
output;

--------------- .cmp
|   in  |  out  |
|   0   |   0   |
|   1   |   1   |
Reply | Threaded
Open this post in threaded view
|

Re: Error?: A .cmp file for a test with extra or missing pin names is not warned about.

cadet1620
Administrator
The .cmp files are just text comparison.

In this case, the error is being caused by the mismatch between the pin names in the .tst file and the .cmp file. The names in the .hdl file match the names in the .tst file.

It is your job, as the author of Name.tst, to provide a Name.cmp file that is 100% matching to the output generated by a correctly operating Name.hdl.

The easiest way to do this is to comment out the "compare-to" and run the test. Inspect the .out and confirm that it is correct, then copy the .out to .cmp and uncomment the "compare-to".

(100% is not strictly true, the .cmp file can have '*' characters in it, which mean don't care.)

--Mark