Comparison failure at line 1

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

Comparison failure at line 1

gs99
I’m testing my own chip and get “Comparison failure at line 1” after initial Single Step.

The .hdl file starts:
CHIP CtlZ16 {
    IN in[16], z;
    OUT out[16];

    PARTS:
    CtlZ(in=in[0], z=z, out=out[0]);


The .tst file starts:
load CtlZ16.hdl,
output-file CtlZ16.out,
compare-to CtlZ16.cmp,
output-list z%B1.1.1 in%B1.16.1 out%B1.16.1;

set z 0,


When I Single Step, it executes the first command, stopping at line set z 0,
Message appears: Comparison failure at line 1

I continue stepping. Output looks good.
At the end, another message appears: End of script – Comparison failure at line 1.

Can you say why the error message appears?  

Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 1

cadet1620
Administrator
The comparison between the output and the .cmp file is a text comparison. If line 1 fails, the header lines are different.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 1

gs99
"the header lines are different."

HS generates a new .out file each time, based on this test:
>1 Run .tst with output-list z%B1.1.1 in%B1.16.1 out%B1.16.1;
.out file line 1 has: | z |        in        |       out        |

>2 Edit .tst to have output-list z%B3.1.3 in%B1.16.1 out%B1.16.1;

>3 Run again.
.out file line 1 now has: |   z   |        in        |       out        |
Notice the wider margins.

If HS generates the .out file header, what are you referring to when you say:
“the header lines are different.”?


Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 1

cadet1620
Administrator
In your CtlZ16.tst file you have
    compare-to CtlZ16.cmp,

The hardware simulator compares the current output with the CtlZ16.cmp file.  The header line in CtlZ16.cmp is different than the currently generated header line.

Note that you can comment out the compare-to line and the test will run to completion. You can then look at CtlZ16.out to see that your chip did during the test. Once you are sure that your chip is working you can copt the CtlZ16.out file to CtlZ16.cmp and uncomment the compare-to line.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 1

gs99
Yes, that works.

Make xxx.tst file with // compare-to xxx.cmp, (commented out).
Run script xxx.tst, should see “End of script” at end.
If no error messages and .out file is good, .hdl is good.

Extra steps (optional?)
Copy xxx.out to xxx.cmp.
Edit xxx.tst file, remove “//” compare-to xxx.cmp, (uncomment).
Run script xxx.tst, should see “End of script – Comparison ended successfully” at end.