What is the standard way to scroll through the lower dimension of a multidimensional array? With a larger fixed dimension.
In the following example:
automatic int i = 2; foreach (my_req[i][j]) begin // <-- WARNING $display("i:%0d,j:%0d", i, j); end
I see a warning:
** Warning: testbench.sv(16): (vlog-LRM-2897) Using non-standard foreach loop variable list syntax.
Full sample EDA Playground code: http://www.edaplayground.com/x/nh
You can do it:
$display("Loop through i=2"); begin automatic int i = 2; foreach (my_req[,j]) begin // notice the "," before j $display("i:%0d,j:%0d", i, j); end end
Working code on the EDA playground: http://www.edaplayground.com/x/2Qn
, , , . , - foreach (array[i][j]), i , foreach(array[i,j]), , .
foreach (array[i][j])
i
foreach(array[i,j])
foreach (my_req[,j])
Source: https://habr.com/ru/post/1536967/More articles:How to set RichEditBox text binding in code - c #How to go to a specific section with a link using full page.js? - javascriptWinRt: binding RTF string to RichEditBox - c #How to override default messages for Flask-Security? - pythonA program that tells the user whether one number is uniformly divisible by another - cPolygon Area - javaHow to measure Java unit test code for each developer? - javaemacs 24.3.1 chose python version - missing variable? - pythonWhere can I find Postgresql training files - postgresqlAndroid: I need a circular camera view. How to reach it? - javaAll Articles