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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor mbroz
Visitor
6,900 Views
Registered: ‎09-20-2015

Help on Depedency in Edit IP Packager

Jump to solution

Hi to all,

I created an IP Core with 4 checkboxes (C1,C2,C3,C4) and I need an hidden parameter (SUM) which should be set automatically when user sets true or false each checkbox so, for example, SUM will be 2 if C2 and C3 are true and C1/C4 are false, or again SUM will be 1 if C4 is true and the others are false, and so on. (the SUM parameter will be used into my vhdl code in a for-generate).

 

So when I created the SUM parameter I wrote a tcl expr like this: expr ( $C1 + $C2 + $C3 + $C4) because I read on a web site that booleans are interpreted like integers (so if C1=true => C1=1).
Howhewer that expr doesn't work, so I wrote a script like this:

expr [ [ expr { $C1 ? {1} : {0} } ] ]

and it works , but if I add with '+' operator the remanent expressions (for C2,C3,C4) then it doesn't work.

 

Another example is this:

set v1 [ expr { $C1 ? {1} : {0} ]
set v2 [ expr { $C2 ? {1} : {0} ]
set v3 [ expr { $C3 ? {1} : {0} ]
set v4 [ expr { $C4 ? {1} : {0} ]

expr ($v1+$v2+$v3+$v4)

and, again, it doesn't work. (maybe because is not allowed to use variables?)

Can someone help me? I spent many hours with other expressions but the problem still remains.

P.s. I'm using Vivado 2015.2 x64 on win7.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor mbroz
Visitor
13,556 Views
Registered: ‎09-20-2015

Re: Help on Depedency in Edit IP Packager

Jump to solution

Hi,

I'm sorry but I found the error and this expr seems work:

expr ( $C1 ? 1 : 0 ) + ( $C2 ? 1 : 0 ) + ( $C3 ? 1 : 0 ) + ( $C4 ? 1 : 0 ) 

 

0 Kudos
1 Reply
Highlighted
Visitor mbroz
Visitor
13,557 Views
Registered: ‎09-20-2015

Re: Help on Depedency in Edit IP Packager

Jump to solution

Hi,

I'm sorry but I found the error and this expr seems work:

expr ( $C1 ? 1 : 0 ) + ( $C2 ? 1 : 0 ) + ( $C3 ? 1 : 0 ) + ( $C4 ? 1 : 0 ) 

 

0 Kudos