cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
syouyu2001
Observer
Observer
1,220 Views
Registered: ‎05-27-2009

Dynamic Range in Linear Array

Hi,

 

I did codeing with "reg [dwidth-1:0] data [255:0];" for preparation of input data, and I modified it to linear array as "reg [dwidth*256-1:0] data;" then I need a dynamic range such as data[msb:lsb] with equations of msb and lsb in a task in testbench. But VIvado makes error of that it needs a constant range.

 

How to manipulate dynamic range in the task?

 

SYOUYU

0 Kudos
4 Replies
syouyu2001
Observer
Observer
1,214 Views
Registered: ‎05-27-2009

When the task is replaced with initial begin ~ end, error message describes that bsb and lsb are not declared. This might I do not understand a syntax in a simulation.

0 Kudos
martin.rognerud
Contributor
Contributor
1,174 Views
Registered: ‎10-09-2017

I'm not sure I understand what you asking for but is this what you are looking for?

 

https://stackoverflow.com/questions/18067571/indexing-vectors-and-arrays-with

0 Kudos
syouyu2001
Observer
Observer
1,147 Views
Registered: ‎05-27-2009

Hi martin.rognerud, 

Thank you very much, that is answer.

 

Best,

SYOUYU

0 Kudos
bandi
Moderator
Moderator
1,138 Views
Registered: ‎09-15-2016

Hi @syouyu2001,

 

If your query is addressed then can you please close the thread by marking the post which helped you as accepted solution.

 

Thanks & Regards,
Sravanthi B

 

--------------------------------------------------------------
Please mark the appropriate answer as "Accept as solution" if information provided is helpful.
Give 'Kudos' to a post which you think is useful and reply oriented.
--------------------------------------------------------------

Thanks & Regards,
Sravanthi B
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos