Integers which are more than 32 bit

B

bipper

Guest
Hello everyone..

I have a top module which has an output in std_logic_vector format of 81 bits. In the test bench code I want to write this output vector
(of size 81 bits) into a text file in integer format. But due to the 32 bit size limit of integers its not working. Any round ways to achieve this?

Thanks..
 
bipper wrote:

Hello everyone..

I have a top module which has an output in std_logic_vector format of 81
bits. In the test bench code I want to write this output vector (of size
81 bits) into a text file in integer format. But due to the 32 bit size
limit of integers its not working. Any round ways to achieve this?

If I where to write these vectors into a text file, being lazy, I would
choose to write them hexadecimally. That is quite easy by looping over the
vector in steps of four (after making the length dividable by four) and
spewing out the nibbles.

If you really want to write out in integer format, you could convert the
binary string into BDC (binary coded decimal) and then print the nibbles,
which are now the decimal digits.

For the binary to BCD conversion, look at the double dabble algorithm:
https://en.wikipedia.org/wiki/Double_dabble

--
Paul Uiterlinden
www.aimvalley.nl
 
On 19/03/14 08:49, bipper wrote:
Hello everyone..

I have a top module which has an output in std_logic_vector format of 81 bits. In the test bench code I want to write this output vector
(of size 81 bits) into a text file in integer format. But due to the 32 bit size limit of integers its not working. Any round ways to achieve this?

Thanks..

You could write in hex using hwrite (from std_logic_textio). Then
surround with the appropriate integer base specifier, e.g.

write(L, string'("16#"));
hwrite(s, L);
write(L, string'("#"));
writeline(F, L);

regards
Alan

--
Alan Fitch
 

Welcome to EDABoard.com

Sponsor

Back
Top