TrickyDicky
Advanced Member level 7
how long have you run the simulation for?
and where is your clock generated?
and where is your clock generated?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sir i got the output
---------- Post added at 17:10 ---------- Previous post was at 17:08 ----------
but its reading only first value shd i extend the loop
i`ve given wait for 10 ns; this is showin me some 25 - 30 values but it stored in integer so now i want to place the values in array so i`m altering it by declaring an array. when it comes to assigning integer value to array how do i alter the program
architecture Behavioral of file2 is
type integer1 is array (integer range 1 to 191500) of integer
begin
process
file test : text open read_mode is "C:\Documents and Settings\Chitra\Desktop\decimal.txt";
--file file test: text is in decimal.txt;
variable buff: line;
variable x:integer range 255 downto 0 ; --- x1 can be of any format
begin
while (not endfile(test))loop
readline (test,buff);
read (buff,x);
int<=x ;
for i in 1 to 191500 loop
integer1(i)<=int;
wait for 10 ns;i++;
end loop;
end loop;
end process;
end Behavioral;
how to alter this properly?
architecture Behavioral of fil2 is
type num is array(natural range<>) of integer;
signal s:num(0 to 166499);
begin
process --no clock, because you're not using the clock
variable inbuff:line;
file test : text open read_mode is "C:\Documents and Settings\Chitra\Desktop\decimal.txt";
variable num_word: integer:=0;
variable good_read : boolean;
begin
while (not endfile (test)) loop
readline (test,inbuff);
good_read := true;
while good_read loop
read (inbuff, s(num_word), good_read);
if good_read then
num_word:=num_word+1;
end if;
end loop;
end loop;
end process;
end behavioral;
fine sir if i need to move to next line wat is that i need to do. i tried putting for loop for readline but this didn`t work. i don`t knw wats wrong bcos when
"while not endfile loop" is given it should read all values in text rite???