[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[f-cpu] stimulib : C version seems to work



hi,

tonight i hacked a small C utility that manages test vectors.

it works with plain HEX files and uses the stdio.h capabilities
(fscanf and fprintf). It should also work in VHDL with the
TEXTIO package, but it's not coded yet.

i think i have reached a compromise between compactness,
speed (it's small, so i coded it quickly and it should
reuse the libc) and compatibility. By avoiding most features
(not even comments) it fits in a few hundreds of lines
(overall) and it works. I am playing currently with the
ROP2 unit (which i have to cleanup again for the XXXth time)
and i'll finish the test vectors when the VHDL version will
be ready.

Here is how it works (general workflow) :
 - there is a vector generator (in C) that outputs a HEX file.
 - the testbenches (C or VHDL) include the DUT (Design
   Under Test) and borrow some functions and stuffs from
   stimulib to import the vectors from the HEX file.
 - The inputs are fed by the testbench/wrapper to the DUT
   and the results are compared (still inside the testbench)
   with the provided expected results.

The good side is that the original vectors can be generated
in any langage. If there is no pipeline stage, one can even
merge vectors or modify them with a text editor (to inject errors).
The vectors can be reasonably big (thousands of cycles).

The bad side is that when there is an error, it's harder
to track (no comments -> no debug info in the hex files).
Though i could have implemented this, it is not the most
required feature (all we want is it to work, no ?).

i'll upload another snapshot whenever i finished the VHDL side.

WHYGEE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/