|
|
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?
|
Administrator
|
The comparison between the output and the .cmp file is a text comparison. If line 1 fails, the header lines are different.
--Mark
|
|
"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.”?
|
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
|
|
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.
|
|