This is a very long list.
What I would like to do is put it in a loop but the the problem is how do I substitute the loop variable into assign FRED_0_CH etc?
Ye rohitk, that is exactly what I want to do. Somebody has suggested to me that the answer MAY lie in using $sformatf. So that code fragment won’t work will it?
The code Rohit shows will not work. The left hand side of the expression needs to be a static identifier at compile time. So the only sort of changes you can make would be with pre-processor compiler directives that get evaluated before compile. Unfortunately the SV pre-processor doesn’t have a looping mechanism
If the FRED_X_CH signals truly need to be their own independent signals as not an array themselves as Anudeep suggests, they will need to be written out separately
I tried to use a similar macro inside a generate statement, but since generate statements are processed at elaboration time (i.e after macro processing), the logic didn’t work. Is there a way to get the generate statement unrolled before macro processing or something on those lines?
In reply to Srini @ CVCblr.com:
I tried to use a similar macro inside a generate statement, but since generate statements are processed at elaboration time (i.e after macro processing), the logic didn’t work. Is there a way to get the generate statement unrolled before macro processing or something on those lines?
Sharat,
That would require language extension like what I’ve suggested at the end of my previous post.