%% Display Percentage Resource Consumption

% Create ProcessorConfig object
hPC = dlhdl.ProcessorConfig();
% Call estimateResources API
hPC.estimateResources();
% The estimator table has been updated to display the total available 
% resources on the device and also the percentage resource consumption for only Xilinx devices.

%% Get Resource estimates for New Device Families

% Register a new device family for Altera/Xilinx vendors by creating a file named
% dlhdl_device_registration(see attached dlhdl_device_registration.m file)
% and adding it to MATLAB search path.
% Note that LUT estimates wouldn't be available for device familes other
% than Zynq, zynq UltraScale+ and Arria10.

% Create a default ProcessorConfig object
hPC = dlhdl.ProcessorConfig();
% Update the ProcessorConfig object to get resource estimates of new device
hPC.SynthesisToolChipFamily = 'Kintex Ultrascale+';
hPC.SynthesisToolDeviceName = 'xcku11p-ffva1156-1-e';
% Call estimateResources API to get the resource estimates of the new
% device family.
hPC.estimateResources();

%% Get Resource estimates including Reference Design resource consumption

% Create ProcessorConfig object
hPC = dlhdl.ProcessorConfig();
% Call estimateResources API
hPC.estimateResources('IncludeReferenceDesign', true);
% The estimator table would now include a new row for Reference Design
% resource estimates.

% The above flow can be used when existing reference designs are being
% used. In case the user wants to use a custom reference design, he needs
% to update the reference design plugin_rd file to include the below
% properties and corresponding resource consumption data. 
% Refer to this doc for custom reference design registration workflow :
% https://www.mathworks.com/help/hdlcoder/ug/register-a-custom-reference-design.html.
% An example of the reference design registration file can be found here :
% support_package_installation_folder\toolbox\dnnfpga\supportpackages\intel\boards\+DLArria10SoC\+qsys_cnn_libiio_3m_170

% % hRD = hdlcoder.ReferenceDesign;
% hRD.ResourcesUsed.LogicElements = 22100;
% hRD.ResourcesUsed.DSP = 0;
% hRD.ResourcesUsed.RAM = 6046000;



