cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ly4096
Newbie
Newbie
2,982 Views
Registered: ‎07-09-2017

Bug report: Vivado2017.1 and 2017.2: Access violation error and fault synthesis of foreach statement

parameter NUM_SENSORS=5;
bit[NUM_SENSORS-1:0] sensors;

typedef struct {
bit invalid;
bit[22:0] sweepOffset=0;
} PerSensorData;

typedef struct {
//bit[1:0] lspStatus;
bit[3:0] syncCode[2];
int unsigned cycleLength;
PerSensorData sensorData[NUM_SENSORS];
} LspData;

LspData result;

bit clearResult=0; always @(posedge clk) begin foreach (sensors[i]) begin if (clearResult) begin result.sensorData[i].sweepOffset<=0; result.sensorData[i].invalid<=1; end end end

The code above generated the following error during synthesis:

ERROR: [Synth 8-280] expression must be constant: assignment pattern index value
Abnormal program termination (EXCEPTION_ACCESS_VIOLATION)

 

The error message did not point out the position in code, so I found the code above manually by commenting out always blocks.

 

If I comment out everything related to 

result.sensorData[i]

the problem will go away. Looks like the synthesizer is unable to resolve index of an array.

 

The code above can pass all procedures in 2016.4 version with no problem.

0 Kudos
4 Replies
anusheel
Moderator
Moderator
2,952 Views
Registered: ‎07-21-2014

@ly4096

 

Can you please share the full test case for us to reproduce the issue?

 

Thanks,
Anusheel
-----------------------------------------------------------------------------------------------
Search for documents/answer records related to your device and tool before posting query on forums.
Search related forums and make sure your query is not repeated.

Please mark the post as an answer "Accept as solution" in case it helps to resolve your query.
Helpful answer -> Give Kudos
-----------------------------------------------------------------------------------------------

0 Kudos
pulim
Xilinx Employee
Xilinx Employee
2,902 Views
Registered: ‎02-16-2014

Hi @ly4096

 

I am able to reproduce the issue at my end.Will be filing a CR on this.

0 Kudos
pulim
Xilinx Employee
Xilinx Employee
2,885 Views
Registered: ‎02-16-2014

Hi @ly4096

 

Filed CR#980258 for this issue.

0 Kudos
ly4096
Newbie
Newbie
2,875 Views
Registered: ‎07-09-2017

Thanks!

 

I've been out for a few days but glad to see this issue being reproduced.

0 Kudos