Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SystemVerilog: Question about array of packed struct

Status
Not open for further replies.

likewise

Newbie level 5
Joined
Jun 22, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,372
Hello all,

Suppose I have the following in SystemVerilog (intended to synthesize).

typedef packed struct begin
logic a;
logic b;
end mytype_t;

mytype_t myarray [1:100];


Is it possible to set field 'a' of all array members with a single assignment?

I understood from studying SV books it is possible to set a single dimension within a multidimensional array, and I would consider a field in a structure to be one dimension of my array.

I would expect something like this:

myarray.a <= 0;
myarray[].a <= 0;
myarray[0:100].a <= 0;

Regards,

Leon.
 

No, you can't select an array of selects. The most concise way to do what you want is

foreach (myarray) myarray.a <= 0;
 
No, you can't select an array of selects. The most concise way to do what you want is
foreach (myarray) myarray.a <= 0;


Thank you for your help, and the proposed solution.

Regards,

Leon.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top