Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > String to std_l...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 6055 of 6417
Post > Topic >>

String to std_logic_vector

by Shannon <sgomes@[EMAIL PROTECTED] > May 30, 2008 at 09:16 AM

I've been searching here but all the hits were for converting SLV to
string for testbenches.

I'm looking to convert a string to an array of 8bit SLVs.  The idea is
I have a revision string of fixed length- something like:

ver <= "005-0805300908x2"'

and I have an array of registers declared as such:

SUBTYPE hwid_type is STD_LOGIC_VECTOR(7 DOWNTO 0);
TYPE reg_type IS ARRAY (0 TO NUM_REGS-1) OF hwid_type;
SIGNAL	regs : reg_type;

What I'm looking for is a loop shown here in psuedo code:

for i in 1 to 16 loop
    regs(i) <= to_slv(ver(mid$(i,1)))
end loop

Note this is for synthesis so I don't know if any of this is even
legal.  I am trying to create a version register that the
microprocessor can read.  An ascii string is prefered - let's pretend
for a moment it is a requirement.  This is also a learning exercise
for me to deal with strings in VHDL.

Any ideas?

Shannon
 




 11 Posts in Topic:
String to std_logic_vector
Shannon <sgomes@[EMAIL  2008-05-30 09:16:54 
Re: String to std_logic_vector
KJ <kkjennings@[EMAIL   2008-05-30 09:47:43 
Re: String to std_logic_vector
Shannon <sgomes@[EMAIL  2008-05-30 10:03:12 
Re: String to std_logic_vector
Mike Treseler <mike_tr  2008-05-30 10:24:50 
Re: String to std_logic_vector
KJ <kkjennings@[EMAIL   2008-05-30 10:31:50 
Re: String to std_logic_vector
Shannon <sgomes@[EMAIL  2008-05-30 11:09:46 
Re: String to std_logic_vector
Mike Treseler <mike_tr  2008-05-30 11:40:44 
Re: String to std_logic_vector
Shannon <sgomes@[EMAIL  2008-05-30 12:59:27 
Re: String to std_logic_vector
"KJ" <kkjenn  2008-05-30 16:55:55 
Re: String to std_logic_vector
"KJ" <kkjenn  2008-05-30 17:06:25 
Re: String to std_logic_vector
Shannon <sgomes@[EMAIL  2008-05-30 15:49:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 14:07:31 CST 2008.