Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Initialising a signal

Reply
Thread Tools

Initialising a signal

 
 
jan
Guest
Posts: n/a
 
      12-16-2003
Hello all,

Is there a difference between:

architecture b of e is
signal mysig: std_logic := '0';
begin
...
end architecture b;

AND,

architecture b of e is
signal mysig: std_logic;
begin
mysig <= '0';
...
end architecture b;
?

Thanks in advance.

--
Jacques Viviers

 
Reply With Quote
 
 
 
 
valentin tihomirov
Guest
Posts: n/a
 
      12-16-2003
> architecture b of e is
> signal mysig: std_logic := '0';
> begin
> ...
> end architecture b;

simulation shows you constant '0', systesys will result in undefined output

> architecture b of e is
> signal mysig: std_logic;
> begin
> mysig <= '0';
> ...
> end architecture b;

both syth and sim give you '0'.


 
Reply With Quote
 
 
 
 
jan
Guest
Posts: n/a
 
      12-16-2003
valentin tihomirov wrote:
>>architecture b of e is
>> signal mysig: std_logic := '0';
>>begin
>> ...
>>end architecture b;

>
> simulation shows you constant '0', systesys will result in undefined output
>
>>architecture b of e is
>> signal mysig: std_logic;
>>begin
>> mysig <= '0';
>> ...
>>end architecture b;

>
> both syth and sim give you '0'.
>
>

Thanks, I have been porting some Verilog, and had lots of
wire mywire = 1'b0;
but Verilog doesn't have a seperate declaration area...
I have translated this like the second example above.
I am glad to see it is the better choice.

--
JV

 
Reply With Quote
 
David Jones
Guest
Posts: n/a
 
      12-23-2003
In article <brn55b$b4j$(E-Mail Removed)>,
jan <(E-Mail Removed)> wrote:
>Hello all,
>
>Is there a difference between:
>
>architecture b of e is
> signal mysig: std_logic := '0';
>begin
> ...
>end architecture b;
>
>AND,
>
>architecture b of e is
> signal mysig: std_logic;
>begin
> mysig <= '0';
> ...
>end architecture b;


Yup.

At time zero, mysig in the first architecture will have value '0'.
For the second, it will have 'U' for a delta delay, at which point
the assignment to '0' will take effect.

For ASIC synthesis, the initialization to '0' might get kicked out
in the first architecture, while you are tying to ground in the
second.

FPGAs that feature initialization without reset will tolerate the
initial value in the first case. Still not recommended, though.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with initialising a signed signal Zheyu.Gao@googlemail.com VHDL 9 01-22-2009 07:13 PM
Re: How to make an internal signal embedded deep in hierarchy to a gloal output signal Weng Tianxiang VHDL 2 01-30-2007 12:58 PM
Aside from delta cycles and/or resolution functions, how can the effective value of a signal differ from a driving signal of its? Colin Paul Gloster VHDL 0 01-11-2007 01:31 PM
threading.Thread vs. signal.signal Jack Orenstein Python 0 09-17-2005 11:24 PM
Async-signal safe functions in signal handlers (unix) Michael Pronath Python 1 01-03-2005 01:10 PM



Advertisments