Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > sim_file reading

Reply
Thread Tools

sim_file reading

 
 
srinukasam
Guest
Posts: n/a
 
      08-03-2005
hi to all
iam reading a file for simulation data.
the problem iam facing is read values are just reverse to my actual
values..
ex..if i give input 00001 it reads as 10000

i know that its taking bits from left corner ( from file).

but how to solve this..

i think i need to reverse the string that iam reading .but i want to do
without using 2nd variable..is it possible? is there any inbuit function
in lib that just reverse the vector. or is there any other idea..please
send me your reply.

my procedure for reading string

procedure readbitstring (variable patternline: in line; column: inout
positive; variable bitstring: out bit_vector) is
variable k :natural:=0;
begin
while patternline(column)/= ' ' loop
case patternline(column) is
when '1'=> bitstring(k):='1';
when others => bitstring(k):='0';
end case;
column:=column+1;
k:=k+1;
end loop;
column:=column+1;
end procedure;

 
Reply With Quote
 
 
 
 
coshzz@gmail.com
Guest
Posts: n/a
 
      08-04-2005
You need reverse your array index while reading patternline.

procedure readbitstring (
variable patternline: in line;
column: inout positive;
variable bitstring: out bit_vector
) is
variable k :natural:=0;
begin
while patternline(column)/= ' ' loop
case patternline(column) is
when '1'=> bitstring(bitstring'length-k-1):='1'; --
reverse your array index
when others => bitstring(bitstring'length-k-1):='0'; --
reverse your array index
end case;
column:=column+1;
k:=k+1;
end loop;
column:=column+1;
end procedure;

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a file and resuming reading. Karim Ali Python 2 05-25-2007 02:04 PM
UnauthorizedAccessException when reading XML files (no problem when reading other file-types) blabla120@gmx.net ASP .Net 0 09-15-2006 02:08 PM
DVD ROM not reading DVDs but reading CDs sayeed.afzal@gmail.com Computer Information 0 05-22-2006 10:37 AM
ASP.NET Reading problem (reading .xls) Wael Soliman ASP .Net 2 01-03-2005 05:33 PM
reading the DB vs. reading a text file...performance preference? Darrel ASP .Net 3 11-11-2004 02:27 PM



Advertisments