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

Reply

VHDL - sens?

 
Thread Tools Search this Thread
Old 12-09-2003, 07:37 PM   #1
Default sens?


architecture behv of counter is

signal Pre_Q: unsigned( 3 downto 0 );

begin

-- behavior describe the counter

process(clock, clear)
begin
if clear = '1' then
Pre_Q <= "0000";
elsif (clock='1' and clock'event) then
Pre_Q <= Pre_Q + 1;
end if;
end process;

-- concurrent assignment statement
QA <= Pre_Q(3);
QB <= Pre_Q(2);
QC <= Pre_Q(1);
QD <= Pre_Q(0);

end behv;


-----------
In this case: QB <= Pre_Q(2); sensitive to "Pre_Q" or only "Pre_Q(2)"?

Thanks
Attila


Attila Csosz
  Reply With Quote
Old 12-09-2003, 09:41 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: sens?
Attila Csosz wrote:
> architecture behv of counter is

.. . .
> end behv;


> In this case: QB <= Pre_Q(2); sensitive to "Pre_Q" or only "Pre_Q(2)"?


In simulation, your process will rerun
every time Pre_Q changes.

Consider synching things up as below to speed
up your simulation.

-- Mike Treseler ---------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity counter is

port (
clock : in std_ulogic;
clear : in std_ulogic;
QA : out std_ulogic;
QB : out std_ulogic;
QC : out std_ulogic;
QD : out std_ulogic
);
end entity counter;

architecture behv of counter is
begin
-- behavior describe the counter
process(clock, clear)
is
variable Pre_Q_v : unsigned(3 downto 0);
begin
if clear = '1' then
Pre_Q_v := "0000";
elsif (clock = '1' and clock'event) then
-- synchronous output assignments
QA <= Pre_Q_v(3);
QB <= Pre_Q_v(2);
QC <= Pre_Q_v(1);
QD <= Pre_Q_v(0);
-- inc counter
Pre_Q_v := Pre_Q_v + 1;
end if;
end process;
end behv;



Mike Treseler
  Reply With Quote
Old 12-09-2003, 10:38 PM   #3
Attila Csosz
 
Posts: n/a
Default Re: sens?
Mike Treseler wrote:
> Attila Csosz wrote:
>
>> architecture behv of counter is

>
> . . .
>
>> end behv;

>
>
>> In this case: QB <= Pre_Q(2); sensitive to "Pre_Q" or only "Pre_Q(2)"?

>
>


Thanks, i will correct it. But anyway which? Because im working on an
vhdl compiler/interpreter.

Attila


Attila Csosz
  Reply With Quote
Old 12-09-2003, 11:06 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: sens?
Attila Csosz wrote:

>>> In this case: QB <= Pre_Q(2); sensitive to "Pre_Q" or only "Pre_Q(2)"?


> Thanks, i will correct it. But anyway which? Because im working on an
> vhdl compiler/interpreter.


The process

QB <= Pre_Q(2);

Is exactly the same as the process

process(Pre_Q)
begin
QB <= Pre_Q_v(2);
end process;

-- Mike Treseler



Mike Treseler
  Reply With Quote
Old 12-10-2003, 06:16 AM   #5
Eyck Jentzsch
 
Posts: n/a
Default Re: sens?
Mike Treseler wrote:
> Attila Csosz wrote:
>
>>>> In this case: QB <= Pre_Q(2); sensitive to "Pre_Q" or only "Pre_Q(2)"?

>
>
>> Thanks, i will correct it. But anyway which? Because im working on an
>> vhdl compiler/interpreter.

>
>
> The process
>
> QB <= Pre_Q(2);
>
> Is exactly the same as the process
>
> process(Pre_Q)
> begin
> QB <= Pre_Q_v(2);
> end process;
>
> -- Mike Treseler
>


I think you are wrong, the process should be:

process(Pre_Q(2))
begin
QB <= Pre_Q(2);
end process;

because there is no such thing like an array signal in VHDL, it's always
an array of signals. But most modern compilers treat it in that way if
possible (e.g. no slices etc.) to gain a performance improvement.

-Eyck



Eyck Jentzsch
  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




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