Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: Default?

Reply
Thread Tools

Re: Default?

 
 
Allan Herriman
Guest
Posts: n/a
 
      07-02-2003
On Wed, 2 Jul 2003 07:30:46 +0200, "John T." <> wrote:

>What does it mean when I declare values in the entity, for example:
>
>ENTITY test IS
>PORT(
> dummy_1: IN std_logic := '1';
> dummy_2: IN std_logic := '0';
>
> dummy_3: OUT std_logic := '1';
> dummy_4: OUT std_logic := '1';
> dummy_5: OUT std_logic := '0'
>
>);
>END ENTITY test;
>
>Is this some sort of starting values? Are they only used in simulation
>or......?


1. For the input ports, this is the value that the signal will take
if the port is left open (either by being mapped to 'open' in the port
map, or by being left out of the port map altogether).
This works perfectly well in both simulation and synthesis, as long as
you aren't using tools supplied by Synopsys (in which case the default
value will be 0 regardless of the value you specified).

2. For the output ports, this is the value that the drivers will have
at elaboration time. If there are no drivers within the architecture
(i.e. you haven't made an assignment to the port of the form
dummy_1 <= something; ) this is the value of (the driver of) the
output port forever. Otherwise it is the value the port has until the
first signal assignment to the port runs, typically 1 delta cycle into
the simulation.


I don't usually see default values used for output ports in
synthesisable code. It can be useful to eliminate glitches in
simulation though, e.g. if the architecture is driving (say) '1', and
there's no initial value on the port, the output will be 'U' for 1
delta cycle before changing to '1'. With the initial value, it will
simply be '1'.

Another way of stating that is:
If you don't provide a value, the language provides an implicit
initialiser of 'U', e.g.

dummy_3: OUT std_logic := 'U';


Regards,
Allan.
 
Reply With Quote
 
 
 
 
Thomas Kurth
Guest
Posts: n/a
 
      07-02-2003
Hi Allan,


> 1. For the input ports, this is the value that the signal will take
> if the port is left open (either by being mapped to 'open' in the port
> map, or by being left out of the port map altogether).
> This works perfectly well in both simulation and synthesis, as long as
> you aren't using tools supplied by Synopsys (in which case the default
> value will be 0 regardless of the value you specified).


Really? Which logic element is it in hardware that ties the pin to this
value?

> 2. For the output ports, this is the value that the drivers will have
> at elaboration time. If there are no drivers within the architecture
> (i.e. you haven't made an assignment to the port of the form
> dummy_1 <= something; ) this is the value of (the driver of) the
> output port forever. Otherwise it is the value the port has until the
> first signal assignment to the port runs, typically 1 delta cycle into
> the simulation.


When are these initial values executed? Do I have to use the reset pin
of the device? Or how does it know that there has not yet been an
operation on this pin (in HW)? For simulation I agree, that there might
be some logic which uses these defaults, but in synthesised code?

Greetz,

Thomas

--

No matter if you are going on-piste or off-piste, just hit the slope and
stay healthy!

For mail reply replace "nospam" with "kurth".
 
Reply With Quote
 
 
 
 
Thomas Kurth
Guest
Posts: n/a
 
      07-11-2003
Hi Allan,

thanks for your answer... No It has become clearer to me.

Greetz,

Thomas

--

No matter if you are going on-piste or off-piste, just hit the slope and
stay healthy!

For mail reply replace "nospam" with "kurth".
 
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




Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57