Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Second argument of write must have a constant value.

 
Thread Tools Search this Thread
Old 06-14-2006, 10:35 PM   #1
Default Second argument of write must have a constant value.


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
  Reply With Quote
Old 06-15-2006, 12:48 AM   #2
Colin Marquardt
 
Posts: n/a
Default Re: Second argument of write must have a constant value.
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
  Reply With Quote
Old 06-15-2006, 12:49 AM   #3
ghelbig@lycos.com
 
Posts: n/a
Default Re: Second argument of write must have a constant value.
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
  Reply With Quote
Old 06-15-2006, 08:46 PM   #4
Nikola Skoric
 
Posts: n/a
Default Re: Second argument of write must have a constant value.
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
  Reply With Quote
Old 06-15-2006, 09:25 PM   #5
Colin Marquardt
 
Posts: n/a
Default Re: Second argument of write must have a constant value.
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46