Code
File Location: VisualSim\actor\arch\Diagnostic_Block
o It generates statistic for resource blocks and hardware blocks in the library.
o Analyzes variables present in the script block.
o Identify error in the resource block.
o
List all the virtual connections.
File required for generating Statistics:
Statistic
evaluations
supported in Diagnostic block.
Blocks |
Statistics |
Type |
System Resource |
Time_in_Block Utilization Buffer_Occupancy |
All / Max / Min / Mean / Standard Deviation |
System Resource Extend |
Time_in_Block Utilization Buffer_Occupancy |
All / Max / Min / Mean / Standard Deviation |
Server |
Time_in_Block Utilization Buffer_Occupancy |
All / Max / Min / Mean / Standard Deviation |
Queue |
Time_in_Block Utilization Buffer_Occupancy |
All / Max / Min / Mean / Standard Deviation |
VariableList |
Any variables defined in the Variable list Ex: 1. id_count , type = local, value type = int 2. Res_Util, type = global, value type = array |
All / Max / Min / Mean / Standard Deviation |
Script |
Any variables defined in the script block Ex: 1. local_Thrgpt, value type = double 2. priority_reorder, value type = array |
All / Max / Min / Mean / Standard Deviation |
ArchitectureSetup |
Any statistics that are sent to the Architecture setup Ex: 1. DRAM_Throughput_MBs_Max 2. Bus_1_Input_Buffer_Occupancy_in_Words_Max 3. Processor_2_PROC_Utilization_Pct_Max |
All / Max / Min / Mean / Standard Deviation |
Statistic
evaluations
supported in Diagnostic block.
Time_in_Block
Utilization
Buffer_Occupancy
Script Block Variables - Int, Double &
Array Data Types
Mean, Maximum, Minimum & Standard Deviation values of all
the aforementioned stats
Max, min, mean and standard deviation of the
hardware stats that are sent to architecture setup.
Constraint supported in Diagnostic
block-
Columns Description -
Number
|
Heading
|
Description
|
Example |
1 |
BLOCK (Should be in Upper case) |
The
"BLOCK" parameter value of the module which we want to monitor.
Every components we use in a demo model will be having a unique name.
We need to provide it here. |
Resource Blocks Script Blocks |
2 |
METRICS (Should be in Upper case) |
For
standard resource blocks (like Queue block, Server block, System
resource block, system resource extend block), following list of stats
are only supported: 1. Time_in_Block 2. Utilization 3. Buffer_Occupancy For Script blocks, we can use any variable defined within the script under this column |
Variables - idx,
arr1, arr2, index
Variables - prioArr,
id_arr, id, index, prio
Script
Blocks
|
3 |
CONSTRAINT (Should be in Upper case) |
Following
types are supported: 1. > 2. < 3. >= 4. <= 5. != 6. = |
|
4 |
CONSTRAINT VALUE (Should be in Upper case) |
Specifies
the threshold value to which the comparison is being made by diagnostic
block. Supported values: 1. Integer 2. Double 3. A structure (for array alone) The structure should be of the following format: {id1=value;id2=value;id3.......;default=value} default value must be specified if user is choosing this format. This is because, if an id which is not specified in the value structure comes in, then the default value will be used as the threshold value. id1, id2 etc. used in the above structure can either correspond to an index value in the array (starting from 0 to n-1, where n is the length of the array) or to the corresponding value in the correlated array mentioned in the optional 'REFERENCE VARIABLE' column for the array. |
All
Stats_Name have 'Value' in Integer/Double except arr (for Mean 'Type')
arr has the value
in the structured form.
Here '0' and '2' signifies the indexes of the array.
While '10' and '20' signifies the threshold values for indexes 0 and 2, and the other indexes have the threshold value as the value mentioned against default value. For Correlate structured value : Input File
Output File
So from the above Output file, we can see the value '6.0' correlated to '0x13' present in id_arr variable. According to this we create the Structure value in the Input file with the threshold values. |
5 |
STATISTIC TYPE (Should be in Upper case) |
Specifies
the type of calculation we have to do. Supported values: 1. Max 2. Min 3. Mean 4. All 5. Standard Deviation "All" simply means that we will be monitoring instantaneous value of a variable or a stat (Latency/Buffer Occupancy/ Utilization). |
Results generated :
1. Results -> Resource with Type set to be "All" 2. Results -> Resource with Type set to be "Max", "Min", "Mean" or "Standard Deviation" 3. Results -> Script variables (no array variable) with Type set to be "Max", "Min", "Mean", "Standard Deviation" or "All" 4. Results -> Script variables (including array variables) with Type set to be "Max", "Min", "Mean", "Standard Deviation" or "All" |
6 |
REFERENCE VARIABLE (Should be in Upper case) |
Used
only for an array variable monitoring. Example: Latency array variable only stores the latency value, but to correlate it with id array we need to specify the id array. For an array, if we don't specify the Reference variable, then the array index will be used for correlation. |
Input File
Output File
Matched Constraint column will list out the values which pass the threshold condition (only for array). Format: {<array index (if reference variable column is empty) or reference array corresponding value>_<variable value which we are monitoring> || <>_<> || .......} |
Stats_Name |
Type |
Input File |
Description |
Output File |
Demo |
Time_in_Block |
All | Outputs
the details of all the data packets which have Time_in_Block > 2 |
|||
Time_in_Block | Max/Min/Mean /Standard Deviation |
Outputs a single value - MeanMax/Min/Standard Deviation, for the Time_in_Block of all the data packets and gives a Result - TRUE, if the value satisfies the given constraint ,else FALSE |
Model Input File Output File |
||
Utilization | All | Outputs
the details of all the data packets which have Utilization >= 0 |
Model Input File Output File |
||
Utilization | Max/Min/Mean /Standard Deviation |
Outputs a single value - Mean/Max/Min/Standard Deviation, for the Utilizations of all the data packets and gives a Result - TRUE, if the value satisfies the given constraint ,else FALSE | Model Input File Output File |
||
Buffer_Occupancy | All | Outputs
the details of all the data packets which have Buffer_Occupancy >= 3.05 In this case the Buffer_Occupancy is an array. So we check if any element of the array has a value >= 3.05. If it does, we print the details of that packet. |
Model Input File Output File |
||
Buffer_Occupancy | Max/Min/Mean /Standard Deviation |
Outputs a single value - Mean/Max/Min/Standard Deviation, for the Buffer_Occupancies of all the data packets and gives a Result - TRUE, if the value satisfies the given constraint, else FALSE | Model Input File Output File |
||
Combined ( Time_in_Block, Buffer_Occupancy, Utilization ) |
All | Outputs
the details of all the data packets which have satisfy anyone of the given constraints |
Model Input File Output File |
||
Combined ( Time_in_Block, Buffer_Occupancy, Utilization ) |
Max/Min/Mean /Standard Deviation |
Outputs
a single value for each Stats_Name, for all the
data packets and gives Result - TRUE, if the value satisfies the given constraint else, FALSE |
Model Input File Output File |
MetricsType
|
StatisticsType |
|
Input File |
Description |
Output File |
Script Block |
Demo |
Int / Double | All | Absent | Outputs all the values stored by each VARIABLE (idx and index, in this case) that passes the given constraint, for the entire simulation. So here we get all the values of idx which are >=0 and all the values of index which are >=0 |
S2_Test_Case |
Output
File |
||
Array |
All | Absent | Outputs all the values stored by each METRICS (prioArr, in this case) if any one of the value present in the array passes the given constraint, for the entire simulation. So here we get all the values of prioArr in which any one element of the array is >= 5. We get all the values(of the array) which passes the constraint in the MATCHED CONSTRAINT column with its index or correlated value as explained in the Columns Description Table above. |
Pack_1_lat_09 |
Model Input File |
||
Combined ( Int, Double & Array ) |
Max/Min/Mean /Standard Deviation |
Absent | Outputs
a single value - Mean/Max/Min/Standard Deviation, for the each METRICS for the
entire simulation and gives Result - TRUE if the value satisfies the given constraint, else FALSE |
Array File Non-Array File |
S1_Test_Case S2_Test_Case S1_Test_Case_3 |
Model Input File |
|
Combined ( Int, Double & Array ) |
All | Present | Outputs all the values stored by each METRICS for the entire simulation based on the respective method for Int/Double/Array data types, as explained above. Here we have an additional REFERENCE VARIABLE column for Arrays. It gives the value stored by the corresponding Correlate array at the same time. So when prioArr stored {6.0}, id_arr stored {0x13} etc. |
Array File Non-Array File |
Pack_1_lat_09 Buff_1_ch_2 |
Model Input File |
|
Combined ( Int, Double & Array ) |
Max/Min/Mean /Standard Deviation |
Present | Outputs a single value - Mean/Max/Min/Standard Deviation, for each METRICS for the entire simulation, along with the REFERENCE VARIABLE column and gives, Result - TRUE if the value satisfies the given constraint, else FALSE | Array File Non-Array File |
Pack_1_lat_09 Buff_1_ch_2 |
Model Input File |
|
Array | Max/Min/Mean /Standard Deviation |
Present | Outputs
a single value - Mean/Max/Min/Standard Deviation, for each Metrics for the
entire simulation, along with the Reference Variable
column and gives, Result - TRUE if the value
satisfies the given
constraint else FALSE For the Arrays, you can enter the value in the structured form as explained in the Column Description Table. |
Pack_1_lat_09 Buff_1_ch_2 |
Model |
a. The contents of the CSV file specified are CASE SENSITIVE except the STATISTIC TYPE column.
b. The columns should be entered in the same order as shown above, in
the Input.csv file.
c. The
"STATISTIC TYPE" should
be the 5th column in the input file with any one of the following
values :
i) All - Outputs all the values for the Stats_name which pass the given constraint.
ii) Mean - Outputs a single Average value for all the values stored in Stats_name.
iii) Min - Outputs a single Minimum value for all the values stored in Stats_name.
iv) Max - Outputs a single Maximum value for all the values stored in Stats_name.
v) Standard Deviation - Outputs a single Standard Deviation value for all the values stored in Stats_name.
d. "REFERENCE VARIABLE" is an optional column, should be added after the "STATISTIC TYPE" column.
e. The format shown in the last example for Script Block for comparing array values for the index/correlated value comparison needs to be followed strictly. Any deviation from the given format will lead to errors.
Two
output files are generated by this block-
1) Recommendation
file will contain the warning conditions like –
2)
Result files :
Supported VisualSim blocks for
Diagnostic
are-
Virtual Connection in Diagnostic
Block:
How
to use?
Supported block
Refer Diagnostic example1 , Diagnostic example2 , Diagnostic Script Test Demo Model.
Parameter |
Explanation |
Type |
Example |
Statistic_File | This
is the path to the input file.. |
File
Parameter |
My_Path
+ “/Latency.csv” or none |
writeStatsToFile | "true" to view the generated output on the .txt/.csv file and "false" if no data required. | Boolean | True or False |
activate | Activate/Deactivate
the block |
Boolean | True or False |