On 24 Okt, 10:03, py <phoenixy...@gmail.com> wrote:
> Let say I have a vector file in the following format
>
> #input1 input2 input3
> 123 * * 456 * * *7
> 111 * * * 0 * *111
> #end
>
> Is there any method or package that would convert the decimal number intostd_logic_vector? Or would it be too much effort and we should just stick with binary/hex?
>
> Thanks,
If you attempt to parse the test vector file (TVF) with a VHDL
code written by you you will need to handle all the possible
irregularities of the test vector file (TVF) yourself.
What I mean is that your TVF *has* syntax, and so you can have
syntax errors...
Discovering those after a long simulation run may hurt.
Instead, try to embed your test vectors into a valid VHDL package
You will need a header part (package xyz is ...) declaring
types (arrays of integers) and then your TVF with correct
syntax, i.e. commas between values etc. Finnaly an tail part
(end package xyz

.
The big pro is that you will catch those syntax errors at compile
time.
Converting the integers to slv's is best done using numeric_std
package (e.g. std_logic_vector(to_unsigned(int,16)) )
-- HTH Pontus