Package: TextUtilPkg
- File: TextUtilPkg.vhd
Functions
- print (text : string) return ()
- print (active : boolean;
text : string) return ()
Description
prints the message when active
useful for debug switches
- chr (sl : std_logic) return character
Description
converts std_logic into a character
- str (sl : std_logic) return string
Description
converts std_logic into a string (1 to 1)
- str (slv : std_logic_vector) return string
Description
converts std_logic_vector into a string (binary base)
- str (b : boolean) return string
Description
converts boolean into a string
- chr (int : integer) return character
Description
converts an integer into a single character
(can also be used for hex conversion and other bases)
- int (c : character) return integer
Description
Converts a character into an integer
- str (int : integer;
base : integer) return string
Description
converts integer into string using specified base
- int (s : string;
base : integer) return integer
Description
converts a string with specified base into an integer
- str (int : integer) return string
Description
converts integer to string, using base 10
- str (tim : time) return string
Description
converts a time to a string
- hstr (slv : std_logic_vector) return string
Description
convert std_logic_vector into a string in hex format
- toUpper (c : character) return character
Description
functions to manipulate strings
convert a character to upper case
- toLower (c : character) return character
Description
convert a character to lower case
- toUpper (s : string) return string
Description
convert a string to upper case
- toLower (s : string) return string
Description
convert a string to lower case
- isWhitespace (c : character) return boolean
Description
checks if whitespace (JFF)
- strip (s : string) return string
Description
remove leading whitespace (JFF)
- firstString (s : string) return string
Description
return first nonwhitespace substring (JFF)
- chomp (variable s : inout string;
variable shead : out string) return ()
Description
finds the first non-whitespace substring in a string and (JFF)
returns both the substring and the original with the substring removed
- toSl (c : character) return std_logic
Description
functions to convert strings into other formats
converts a character into std_logic
- toSlv (s : string) return std_logic_vector
Description
converts a string into std_logic_vector
- strRead (file in_file : text;
res_string : out string) return ()
Description
file I/O
read variable length string from input file
- print (file out_file : text;
new_string : in string) return ()
Description
print string to a file and start new line
- print (file out_file : text;
char : in character) return ()
Description
print character to a file and start new line