UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

[VHDL] Signals Assignment in Package -> how to?

Accepted Solution Solved
Highlighted
Visitor
Posts: 21
Registered: ‎11-08-2017
Accepted Solution

[VHDL] Signals Assignment in Package -> how to?

[ Edited ]

Hi All,

 

I know it's possible to declare signals in the package. But is it possible to assign the signals inside of the packages?

 

I'd like to write something like following:

package pkg_signals is   
   type plan_t is (A, B);
   signal plan : plan_t;
signal sel : std_logic; end package pkg_signals; package body pkg_signals is plan <= A when sel = '1' else B; end pkg_signals;

Actually the plan_t is enum type... How can I compare enum types?

 

Can I write something like this:

 

signal abc : std_logic;
abc <= '1' when (plan = A) else '0';

 

Thank you!

 

 


Accepted Solutions
Scholar
Posts: 1,849
Registered: ‎07-09-2009

Re: [VHDL] Signals Assignment in Package -> how to?

You seem to be doing some logic in the package 

 

that would normaly be in the architecture of the design,

 

If you do need this logic in a package, 

   then you need to write it as a function or procedure in the package. 

      and call that from your architecture.

 

View solution in original post


All Replies
Visitor
Posts: 21
Registered: ‎11-08-2017

Re: [VHDL] Signals Assignment in Package -> how to?

Is it possible to assign signals inside of the packages? How? Please provide some example. Thanks

Scholar
Posts: 1,849
Registered: ‎07-09-2009

Re: [VHDL] Signals Assignment in Package -> how to?

You seem to be doing some logic in the package 

 

that would normaly be in the architecture of the design,

 

If you do need this logic in a package, 

   then you need to write it as a function or procedure in the package. 

      and call that from your architecture.