Xilinx: Case Statements

L

lingwitt

Guest
Xilinx has the ridiculous peculiarity of requiring sized cases in a
case statement.

I allow users of my module to set parameters that are used to
calculate other local parameters, and those local parameters are then
used in several case statements as the cases.

How am I supposed to meet XST requirements?

Will requiring that all parameter definitions be sized do the trick?
I think not, since one of my calculations is:

localparam LOCAL = PARAM - 1;

Is Xilinx also too stupid to use the size given when PARAM is set?
Any help would be appreciated.

PS
How can anybody put up with Xilinx? In my experience, their software
has been utter trash.
 
On Mar 11, 9:39 pm, "lingwitt" <lingw...@gmail.com> wrote:
How am I supposed to meet XST requirements?
Is the solution simply to use "if-else" statements or any other
construct?
 
lingwitt wrote:
Xilinx has the ridiculous peculiarity of requiring sized cases in a
case statement.

I allow users of my module to set parameters that are used to
calculate other local parameters, and those local parameters are then
used in several case statements as the cases.

How am I supposed to meet XST requirements?

Will requiring that all parameter definitions be sized do the trick?
I think not, since one of my calculations is:

localparam LOCAL = PARAM - 1;

Is Xilinx also too stupid to use the size given when PARAM is set?
Any help would be appreciated.

PS
How can anybody put up with Xilinx? In my experience, their software
has been utter trash.
Dimension everything:

localparam [3:0] LOCAL = PARAM - 1;
 
On Mar 12, 1:05 am, John_H <newsgr...@johnhandwork.com> wrote:
lingwitt wrote:
Xilinx has the ridiculous peculiarity of requiring sized cases in a
case statement.

I allow users of my module to set parameters that are used to
calculate other local parameters, and those local parameters are then
used in several case statements as the cases.

How am I supposed to meet XST requirements?

Dimension everything:

localparam [3:0] LOCAL = PARAM - 1;
Excellent!

Thank you very much.

I had no idea that parameters could be dimensioned in this way.
Most language guides are by example rather than rule,
so I hadn't come across this before.

Thanks again!
 
On Mar 12, 1:40 am, "lingwitt" <lingw...@gmail.com> wrote:
On Mar 12, 1:05 am, John_H <newsgr...@johnhandwork.com> wrote:

lingwitt wrote:
Xilinx has the ridiculous peculiarity of requiring sized cases in a
case statement.

I allow users of my module to set parameters that are used to
calculate other local parameters, and those local parameters are then
used in several case statements as the cases.

How am I supposed to meet XST requirements?

Dimension everything:

localparam [3:0] LOCAL = PARAM - 1;

Excellent!

Thank you very much.

I had no idea that parameters could be dimensioned in this way.
Most language guides are by example rather than rule,
so I hadn't come across this before.

Thanks again!
Well of course!

There it is right there! Right in the BNF grammar specification!

;-)
 
On Mar 12, 1:57 am, "lingwitt" <lingw...@gmail.com> wrote:
I had no idea that parameters could be dimensioned in this way.
Most language guides are by example rather than rule,
so I hadn't come across this before.

Thanks again!

Well of course!

There it is right there! Right in the BNF grammar specification!

;-)
It would seem that this wasn't possible until Verilog-2001.

Perhaps this is what the XST documentation means when it
cryptically boasts about supporting "N sized parameters".
 

Welcome to EDABoard.com

Sponsor

Back
Top