Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string type conversion

Status
Not open for further replies.

webb4789

Technical User
Jan 28, 2002
1
GB
Anyone help with this?

In my test bench I want to enter expected bus values in hex and verify them against a STD_LOGIC_VECTOR type with an ASSERT statement.

If the string is of fixed length this isn't hard to do, but the problem arises when I try to write a hex2STD_LOGIC_VECTOR type_conversion routine for a string of arbitrary length. As string is unbound, the normal 'left type attributes have no meaning.
 
'left should work with any size vector (string)

if the input string is any length then your function may need a parameter that tells it what size std_logic_vector to return and what to do if the input string is too long or too short.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top