• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. array of parameters issue (IUS61)

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 64
  • Views 15201
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

array of parameters issue (IUS61)

archive
archive over 17 years ago

1) I found the following issue about the initialization of an array of parameters:


package simd_pack;

  parameter    ports_num                           = 4;       // ports number 
  parameter    [ports_num-1:0]px_num      = '{ports_num-1:8,default:4};    // pixel num x port

endpackage : simd_pack

when I print the values of the array I got:

INFO: px_num 0
INFO: px_num 0
INFO: px_num 0
INFO: px_num 0


Is it  an issue of the IUS 06.11-s004 version ?

2) If I use the following definition:

integer    px_num[ports_num-1:0]      = '{ports_num-1:8,default:4};    // pixel num x port

then  it works

INFO: px_num           4
INFO: px_num           4
INFO: px_num           4
INFO: px_num           8

but in this case I cannot pass the array element as parameter to a module, because I got the following
error:

    swf_bfm #(.port_id(i),.pxn(px_num[i]))  u_swf_bfm (
                                      |
ncelab: *E,NOTPAR (../tbench/tb_swf.v,157|38): Illegal operand for constant expression [4(IEEE)].

3) If I define the array as unpacked array, I got the known IUS limitation:

parameter    px_num [ports_num-1:0]     = '{ports_num-1:8,default:4};    // pixel num x port


parameter    px_num [ports_num-1:0]     = '{ports_num-1:8,default:4};    // pixel num x port
                    |
ncvlog: *E,SVARPA (/IPREUSE/DATABASE/INTERNAL/DIG/INPROGRESS/gborgo/simd_A0_a/generic/rtl/svlog/simd_pack.v,21|20): Unpacked array and string parameters are currently not supported.
parameter    px_num [ports_num-1:0]     = '{ports_num-1:8,default:4};    // pixel num x port

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How can I solve the following issue ?
I'd need  to define an array of constants and to pass a single element of the array as parameter
of a module.


Thanks
BR
Giampiero
 






Originally posted in cdnusers.org by borgonov69
  • Cancel
Parents
  • archive
    archive over 17 years ago

    Just as a follow-up.

    The declaration "parameter [ports_num-1:0] px_num;" isn't either a packed or unpacked array of parameters. It is a single parameter "px_num" whose width in bits is being set to "ports_num". That is certainly how Verilog 2001 interprets it and I would expect that SystemVerilog remains backward compatible.

    I don't know how the initializer "'{ports_num-1:8,default:4};" would be interpreted in that context. I imagine that it assigns each bit in the single parameter "px_num" to the given value. Since each initializer has its low order bit = 0, all "ports_num" bits of the single parameter were set to 1'b0.


    Originally posted in cdnusers.org by TAM
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • archive
    archive over 17 years ago

    Just as a follow-up.

    The declaration "parameter [ports_num-1:0] px_num;" isn't either a packed or unpacked array of parameters. It is a single parameter "px_num" whose width in bits is being set to "ports_num". That is certainly how Verilog 2001 interprets it and I would expect that SystemVerilog remains backward compatible.

    I don't know how the initializer "'{ports_num-1:8,default:4};" would be interpreted in that context. I imagine that it assigns each bit in the single parameter "px_num" to the given value. Since each initializer has its low order bit = 0, all "ports_num" bits of the single parameter were set to 1'b0.


    Originally posted in cdnusers.org by TAM
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information