B
Brandon
Guest
I would like my testbench to be able to load data from text i/o into
two 1-d arrays of type real, of any length.
I looked through the text i/o example in "The Designer's Guide to Vhdl"
by Ashenden, but I'm still a little fuzzy.
I generated the data in exponential format in Matlab into a text file:
-3.295898437500E-003 4.272460937500E-003
.... ...
I would declare the two procedure output arrays in my signal list of my
test-bed. I then plan on looping through each value in the arrays every
clock cycle:
-- test bench architecture types,signals
type ARRAYOFREAL_T is array (natural range <> of real;
signal real_stuff: ARRAYOFREAL_T(LENGTH-1 downto 0);
signal imag_stuff: ARRAYOFREAL_T(LENGTH-1 downto 0)
-- define the procedure as follows, but not sure how to write
-- coe_fn is the filename string
-- re, im are the arrays of real I want to contain the loaded values
procedure is load_coe_from file(coe_fn: in string;
re: out ARRAYOFREAL_T; im: out ARRAYOFREAL_T) is
....
begin
....
end procedure load_coe;
Any thoughts? Thanks.
two 1-d arrays of type real, of any length.
I looked through the text i/o example in "The Designer's Guide to Vhdl"
by Ashenden, but I'm still a little fuzzy.
I generated the data in exponential format in Matlab into a text file:
-3.295898437500E-003 4.272460937500E-003
.... ...
I would declare the two procedure output arrays in my signal list of my
test-bed. I then plan on looping through each value in the arrays every
clock cycle:
-- test bench architecture types,signals
type ARRAYOFREAL_T is array (natural range <> of real;
signal real_stuff: ARRAYOFREAL_T(LENGTH-1 downto 0);
signal imag_stuff: ARRAYOFREAL_T(LENGTH-1 downto 0)
-- define the procedure as follows, but not sure how to write
-- coe_fn is the filename string
-- re, im are the arrays of real I want to contain the loaded values
procedure is load_coe_from file(coe_fn: in string;
re: out ARRAYOFREAL_T; im: out ARRAYOFREAL_T) is
....
begin
....
end procedure load_coe;
Any thoughts? Thanks.