Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > "when" assignments in process ?

Reply
Thread Tools

"when" assignments in process ?

 
 
Sylvain Munaut
Guest
Posts: n/a
 
      03-03-2006
Hi,


When outside of a process, to test something I can write

is_equal <= '1' when foo = bar else '0';

but how to do the same in a process ?

for now i must write

if foo=bar then
is_equal <= '1';
else
is_equal <= '0';
end if;


Which is a _lot_ longer ...

It can be shortened with

is_equal <= '0';
if foo=bar then
is_equal <= '1';
end if;

But it's still a lot longer ...



Sylvain
 
Reply With Quote
 
 
 
 
Ben Jones
Guest
Posts: n/a
 
      03-03-2006

"Sylvain Munaut" <com.246tNt@tnt> wrote in message
news:44081dfc$0$1163$(E-Mail Removed)...
> When outside of a process, to test something I can write
> is_equal <= '1' when foo = bar else '0';
> but how to do the same in a process ?


-- In your package of useful functions:

function btsl(x : boolean) return std_logic is
-- btsl == Boolean To Standard Logic
begin if x then return '1'; else return '0'; end if;
end btsl;


-- In your design code:

process(...)
begin

is_equal <= btsl(foo=bar);

end process;

That is fairly short...

-Ben-


 
Reply With Quote
 
 
 
 
Sylvain Munaut
Guest
Posts: n/a
 
      03-03-2006
Indeed thanks !

I don't yet have the "function" reflex in VHDL for that kind of things.


Sylvain

Ben Jones wrote:
> "Sylvain Munaut" <com.246tNt@tnt> wrote in message
> news:44081dfc$0$1163$(E-Mail Removed)...
>
>>When outside of a process, to test something I can write
>>is_equal <= '1' when foo = bar else '0';
>>but how to do the same in a process ?

>
>
> -- In your package of useful functions:
>
> function btsl(x : boolean) return std_logic is
> -- btsl == Boolean To Standard Logic
> begin if x then return '1'; else return '0'; end if;
> end btsl;
>
>
> -- In your design code:
>
> process(...)
> begin
>
> is_equal <= btsl(foo=bar);
>
> end process;
>
> That is fairly short...
>
> -Ben-
>
>

 
Reply With Quote
 
Jim Lewis
Guest
Posts: n/a
 
      03-03-2006
Sylvain,
This is due to be fixed in the next revision of
VHDL. This revision will first be standardized by
Accellera (the group working on the revisions) in
July of 2006.

Please let your vendor know that you want them to
implement this.

Best Regards,
Jim


> Hi,
>
>
> When outside of a process, to test something I can write
>
> is_equal <= '1' when foo = bar else '0';
>
> but how to do the same in a process ?
>
> for now i must write
>
> if foo=bar then
> is_equal <= '1';
> else
> is_equal <= '0';
> end if;
>
>
> Which is a _lot_ longer ...
>
> It can be shortened with
>
> is_equal <= '0';
> if foo=bar then
> is_equal <= '1';
> end if;
>
> But it's still a lot longer ...
>
>
>
> Sylvain



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training (E-Mail Removed)
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
 
Reply With Quote
 
Jim Lewis
Guest
Posts: n/a
 
      03-03-2006
Ben,
This too is due to be fixed in the next revision of
VHDL. This revision will first be standardized by
Accellera (the group working on the revisions) in
July of 2006.

is_equal <= foo ?= bar ;

in addition:

Reg1Sel <= BlkSel and (Addr ?= REG1_ADDR_LOC) ;

Please let your vendor know that you want them to
implement this.

Cheers,
Jim

> -- In your package of useful functions:
>
> function btsl(x : boolean) return std_logic is
> -- btsl == Boolean To Standard Logic
> begin if x then return '1'; else return '0'; end if;
> end btsl;
>
>
> -- In your design code:
>
> process(...)
> begin
>
> is_equal <= btsl(foo=bar);
>
> end process;
>
> That is fairly short...
>
> -Ben-
>
>



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training (E-Mail Removed)
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
 
Reply With Quote
 
Weng Tianxiang
Guest
Posts: n/a
 
      03-08-2006
Hi Jim,
I miss you a lot.

How about the "orif" keyword problem? It has been 5 years since the
problem was raised and you recommented.

Weng

 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      03-08-2006
Weng Tianxiang wrote:

> How about the "orif" keyword problem?


ORIF will only be a *problem* for me if we have
to repeat these discussions:

http://groups.google.com/groups/sear...hdl+%22orif%22

> It has been 5 years since the
> problem was raised and you recommented.


Jim's last comment was July 31, 2005.
Please write yourself a function and
spare me the details.

-- Mike Treseler
 
Reply With Quote
 
Weng Tianxiang
Guest
Posts: n/a
 
      03-09-2006
Jim's response on July 31, 2005 is:
> Here is another point your committee should pay attention to:
> sensitivity list!


> Why don't you propose to change it?


Already did. See the fast track proposals at:
http://www.eda.org/vhdl-200x/vhdl-20...proposals.html

See FT-19.

It has nothing to do with "orif" keyword. Two different topics.

Weng

 
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
Re: Why not mix concurrent and synchronous assignments in the same process? KJ VHDL 4 09-21-2012 01:11 PM
Re: Why not mix concurrent and synchronous assignments in the same process? Andy VHDL 3 09-11-2012 08:07 PM
Using aggregates for assignments Gary Thorpe VHDL 4 06-15-2004 03:33 PM
Concurrent assignments to std_ulogic_vector slice is OK with ModelSim Nicolas Matringe VHDL 9 06-14-2004 10:10 PM
using entity attributes for pin number assignments Neil Zanella VHDL 2 10-26-2003 03:22 AM



Advertisments