![]() |
|
|
|||||||
![]() |
VHDL - Second argument of write must have a constant value. |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hello there,
I'm rather new to VHDL and find this piece of code perfectly legitimate: architecture Behavioral of writer is file FP: TEXT open write_mode is "output.txt"; begin process (write) is variable l : line; variable data : std_logic_vector(63 downto 0); begin if (rising_edge(write)) then data := DATA_in; write(l,data); writeline(FP,l); end if; end process; end Behavioral; But my analyzer disagrees, and says: "Second argument of write must have a constant value." What should I do to please my analyzer? -- "Now the storm has passed over me I'm left to drift on a dead calm sea And watch her forever through the cracks in the beams Nailed across the doorways of the bedrooms of my dreams" Nikola Skoric |
|
|
|
|
#2 |
|
Posts: n/a
|
Nikola Skoric <nick-> writes:
> I'm rather new to VHDL and find this piece of code perfectly legitimate: [...] > process (write) is I wouldn't reuse that function name for a signal. Cheers, Colin Colin Marquardt |
|
|
|
#3 |
|
Posts: n/a
|
I'm guessing that you're using textio:
write(L, VALUE, JUSTIFY, FIELD); -- Write one value to "line" L from variable VALUE * Data_type of VALUE can be bit, bit_vector, integer, real, character, string, or time. * JUSTIFY is "left" or "right" to justify within the field * FIELD is the desired field width of the written value You must convert the value from std_logic_vector to bit_vector before write will accept it. ghelbig@lycos.com |
|
|
|
#4 |
|
Posts: n/a
|
In article < .com>,
says... > I'm guessing that you're using textio: > > write(L, VALUE, JUSTIFY, FIELD); -- Write one value to "line" L from > variable VALUE > * Data_type of VALUE can be bit, bit_vector, integer, real, > character, string, or time. > * JUSTIFY is "left" or "right" to justify within the field > * FIELD is the desired field width of the written value > > > You must convert the value from std_logic_vector to bit_vector before > write will accept it. Oh, right. Thanks. Works now. While we're at it, can you recommend me some kind of VHDL reference? For instance, this code I've written dumps a series of bits to the file... and now I'd like to convert that bit_vector to string containing hex digits. Where do I start seraching for such a function? -- "Now the storm has passed over me I'm left to drift on a dead calm sea And watch her forever through the cracks in the beams Nailed across the doorways of the bedrooms of my dreams" Nikola Skoric |
|
|
|
#5 |
|
Posts: n/a
|
Nikola Skoric <nick-> writes:
> and now I'd like to convert that bit_vector to string containing hex > digits. Where do I start seraching for such a function? Check out image_pb.vhd on http://members.aol.com/vhdlcohen/vhdl/Models.html, or the packages on http://bear.ces.cwru.edu/vhdl/ Cheers, Colin Colin Marquardt |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disc is write protected error message | o Gunners o | Hardware | 0 | 03-02-2008 07:36 PM |
| Next Problem: Random HDD Write Errors | Dave Hardenbrook | A+ Certification | 3 | 10-02-2006 05:38 AM |
| DVD Verdict reviews: THE CONSTANT GARDENER, TRANSPORTER 2, and more! | DVD Verdict | DVD Video | 0 | 01-10-2006 09:21 AM |
| Reducing DVD Write speed with Nero 6 on Sony DVD writer | Guido | DVD Video | 0 | 11-18-2004 10:23 PM |
| "Failed To Set Write Parameters!" | Bubba Do Wah Ditty | DVD Video | 0 | 05-19-2004 09:06 PM |