Thursday, January 08, 2009     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: Replication Patterns
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
dfechser
Posts: 11
Online: User is Offline
3/28/2007 3:59 PM  
Look what I got!

    preamble =   '{PREAMBLE_SIZE{40'hDDDDDDDDDD}};
                                |
ncvlog: *E,APTYPE (/lsi/ftc/yampa_design/users/dfechser/experimental/lib/lsi_uvc_lib/lsi_nrz/sv/lsi_nrz_package.sv,81|32): Assignment Pattern - replication patterns unsupported at this time (PREAMBLE_SIZE) [SystemVerilog].


...anyone know when ncverilog will support this (PREAMBLE_SIZE is a variable)?

Dave F.
dwalker@sirenza.com
Posts: 2
Online: User is Offline
3/28/2007 4:06 PM  
I'm assuming that PREAMBLE_SIZE is a parameter. In that case, you could try to add another set of brackets like


parameter PREAMBLE_SIZE=16;
...
preamble = '{{PREAMBLE_SIZE{40'hDDDDDDDDDD}};
....

David Walker
dfechser
Posts: 11
Online: User is Offline
3/29/2007 12:35 PM  
PREAMBLE_SIZE is an input to the "new" function and is used to set the size of the dynamic array.

When I added the extra brackets I get an error that says "Illegal operand for constant expression" which sounds closer than I was before. 

I need to figure out how to tell SV that the function input is a constant, I guess.
dfechser
Posts: 11
Online: User is Offline
3/29/2007 12:41 PM  
Hm, I tried "const ref" and "const ref int" and both give me the same error message:

"Illegal operand for constant expression"

Does anyone have any ideas?

What I have is a transaction with resizeable preamble, data, and flush fields so I want to set them in the new() function and use dynamic arrays to hold the parts.
Jim McGrath
Posts: 6
Online: User is Offline
3/29/2007 12:52 PM  
replication patterns are not currently supported, something like the following works in 5.8. not the most elegant, but the underlying implementation would need to do the same....

module temp;

parameter PREAMBLE_SIZE = 16;
bit preamble[]

initial
begin
preamble=new[PREAMBLE_SIZE]
for (int i=0; i preamble[i]=40'hDDDDDDDDDD;
end

endmodule
dwalker@sirenza.com
Posts: 2
Online: User is Offline
3/29/2007 1:14 PM  
If it's a parameter, why not do

------------------------------------
module temp;

parameter PREAMBLE_SIZE = 16;
bit [PREAMBLE_SIZE*40-1:0] preamble;

initial begin
preamble='{{PREAMBLE_SIZE{40'hDDDDDDDDDD}}};
end

endmodule
------------------------------------
It compiled for me in 5.83. I assume the OP wanted to pass it to a task as a parameter like

------------------------------------
module test;

// the dynamic array must be defined here because it is invalid in a task
bit preamble[]

task xxx(input int PREAMBLE_SIZE);


preamble = new[PREAMBLE_SIZE*40]

preamble = '{PREAMBLE_SIZE{40'hDDDDDDDDDD}};

endtask

initial begin
xxx(13);
xxx(10);
end

endmodule
------------------------------------

When I did this, I got the same error messages as the OP. I tried your for loop trick in the above and it worked OK.

David Walker
Jim McGrath
Posts: 6
Online: User is Offline
3/29/2007 1:25 PM  
yeah, my bad. The issue is with replication initialization which is not currently supported. ~jm
Posting to forums is available to community members only.
Login or Register

Forums > Functional Verification > SystemVerilog > Replication Patterns


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.