Friday, November 21, 2008     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: array access thorugh a variable (non costant expression)
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
borgonov69
Posts: 0
Online: User is Offline
8/30/2007 5:10 AM  
I have this metodology issue.
The access to an array (index of the array) is allowed only to be  a constant expression.
In case of a parametric array (the size of the array is a parameter) in order to mux a sub-part of the vector I use an expression of this type:

i_rdata[(px_max-cmd_exe_cnt_d1*shm_width)*px_width-1:(px_max-cmd_exe_cnt_d1*shm_width-shm_width)*px_width] = rdata_shram;

where cmd_exe_cnt_d1 is a variable and others are constant.

Obviously I get an error about the usage of a non costant expression, following reported.


Compiling SHM component...
file: /IPREUSE/DATABASE/INTERNAL/DIG/INPROGRESS/gborgo/simd_A0_a/config/../generic/rtl/svlog/shm.v
    i_rdata[(px_max-cmd_exe_cnt_d1*shm_width)*px_width-1:(px_max-cmd_exe_cnt_d1*shm_width-shm_width)*px_width] = rdata_shram;
                                 |
ncvlog: *E,NOTPAR (/IPREUSE/DATABASE/INTERNAL/DIG/INPROGRESS/gborgo/simd_A0_a/config/../generic/rtl/svlog/shm.v,377|33): Illegal operand for constant expression Β(IEEE)].
    i_rdata[(px_max-cmd_exe_cnt_d1*shm_width)*px_width-1:(px_max-cmd_exe_cnt_d1*shm_width-shm_width)*px_width] = rdata_shram;


I found a simple work-around using a case structure:

      unique case (cmd_exe_cnt_d1)
        0      : i_rdata[(px_max-0*shm_width)*px_width-1:(px_max-0*shm_width-shm_width)*px_width] = rdata_shram;
        1      : i_rdata[(px_max-1*shm_width)*px_width-1:(px_max-1*shm_width-shm_width)*px_width] = rdata_shram;

....
...
...

        31     : i_rdata[(px_max-1*shm_width)*px_width-31:(px_max-31*shm_width-shm_width)*px_width] = rdata_shram;
        default:  i_rdata = 0;
      endcase   



but in this case I have an implicit limitation on the upper limit of the vector size. In this case 31 elements.

Is there any other mode to address this methodology issue ?

The code must be synthesizable.

Thanks
BR
Giampiero
TAM
Posts: 56
Online: User is Offline
8/30/2007 6:13 AM  
When you use the [a:b] syntax to select a slice of a vector, both expressions need to be compile-time constants. But you can vary the bit range if you specify the left-hand-bit using a variable and keep a fixed width using [a -: width] or [a +: width].

i_rdata[(px_max-cmd_exe_cnt_d1*shm_width)*px_width-1-:px_width] = rdata_shram;
Posting to forums is available to community members only.
Login or Register

Forums > Functional Verification > SystemVerilog > array access thorugh a variable (non costant expression)


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.