Commit 467b2b51 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

Formatted (some) comments for doxygen

Logging to textbox in fiji download GUI
Added demo test configuration file
parent 65caa9dd
......@@ -44,14 +44,14 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
PROJECT_BRIEF =
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
......@@ -110,7 +110,17 @@ REPEAT_BRIEF = YES
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
......@@ -144,7 +154,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
STRIP_FROM_PATH = .
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
......@@ -226,7 +236,7 @@ ALIASES =
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
......@@ -270,7 +280,8 @@ OPTIMIZE_OUTPUT_VHDL = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
EXTENSION_MAPPING = pm=c++ \
pl=c++
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
......@@ -404,7 +415,7 @@ EXTRACT_ALL = NO
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
EXTRACT_PRIVATE = YES
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
......@@ -563,7 +574,7 @@ SORT_GROUP_NAMES = NO
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
......@@ -743,7 +754,9 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = . FIJI
INPUT = . \
FIJI \
Tk
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......@@ -763,13 +776,14 @@ INPUT_ENCODING = UTF-8
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.pm *.pl
FILE_PATTERNS = *.pm \
*.pl
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = yes
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
......@@ -825,7 +839,7 @@ EXAMPLE_PATTERNS =
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = NO
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
......@@ -1352,7 +1366,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
......
......@@ -17,7 +17,7 @@
# Various constants used in the FIJI packages.
#-------------------------------------------------------------------------------
## @file
## @file FIJI.pm
## @class FIJI
#
......@@ -28,30 +28,36 @@ use Cwd;
use strict;
use warnings;
# Architecture from http://www.perlmonks.org/?node_id=1072731
use constant DEFAULT_TIMER_VALUE => 1000000;
#** @var public %designmap Hash containing all FIJI::Settings
#
# Architecture from http://www.perlmonks.org/?node_id=1072731
#
# Fields:
# - ini_name = key name in FIJI Settings file
# - unit = (optional) physical unit
# - type = (optional) enables type-specific conversions and tests:
# natural: values must be oct, hex, binary strings looking like a real number.
# hexadecimal: values must be hexadecimal numbers.
# boolean: will be convert to a truth value by Perl semantics
# net: name of a net from the input netlist
# - values = (optional) used to restrict valid values. Can be...
# - an array reference listing all valid values (emulates an enum)
# - a code reference to a function that gets the new and old values and
# returns true if the new value is allowed, or false otherwise.
# - phases_opt = (optional) list of phases (subset of "setup", "instrument", "download")
# where no value must be present in input (e.g. ID is only necessary while downloading).
# - depends_on = (optional) specifies the key of another constant.
#
# - ini_name key name in FIJI Settings file
# - unit (optional) physical unit
# - type (optional) enables type-specific conversions and tests:
# - natural: values must be oct, hex, binary strings looking like a real number.
# - hexadecimal: values must be hexadecimal numbers.
# - boolean: will be convert to a truth value by Perl semantics
# - net: name of a net from the input netlist
# - values (optional) used to restrict valid values. Can be...
# - an array reference listing all valid values (emulates an enum)
# - a code reference to a function that gets the new and old values and
# returns true if the new value is allowed, or false otherwise.
# - phases_opt (optional) list of phases (subset of "setup", "instrument", "download")
# where no value must be present in input (e.g. ID is only necessary while downloading).
# - depends_on (optional) specifies the key of another constant.
# The respective constant is only relevant (and thuse required as input)
# if the value of the referenced constant is true.
# - group = (optional) specifies how to group this value in output. Value will not be displayed if undef
# - noedit = (optional) display value, but don't allow to alter
# - default = (optional) default value if not given in file and not determinable otherwise
# - help = (optional) short help text, e.g. to be displayed via Tk:Balloon
# - forbidden_by = (optional) specifies the key of another constant
# - group (optional) specifies how to group this value in output. Value will not be displayed if undef
# - order (optional) specifies how to sort this value in output group
# - noedit (optional) display value, but don't allow to alter
# - default (optional) default value if not given in file and not determinable otherwise
# - help (optional) short help text, e.g. to be displayed via Tk:Balloon
# - forbidden_by (optional) specifies the key of another constant
# The respective constant may not be enabled if the value
# of the referenced constant is true
my %designmap;
......@@ -445,6 +451,7 @@ BEGIN {
use constant \%designmap;
use constant DESIGNMAP => \%designmap;
my %displaygroups;
BEGIN {
......@@ -627,6 +634,7 @@ BEGIN {
MIN_DURATION_T1 => {
description => "Minimum Duration T1",
ini_name => "MIN_DURATION_T1",
default => DEFAULT_TIMER_VALUE,
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
type => "min_duration",
......@@ -636,6 +644,7 @@ BEGIN {
MIN_DURATION_T2 => {
description => "Minimum Duration T2",
ini_name => "MIN_DURATION_T2",
default => DEFAULT_TIMER_VALUE,
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
type => "min_duration",
......@@ -645,6 +654,7 @@ BEGIN {
MAX_DURATION_T1 => {
description => "Maximum Duration T1",
ini_name => "MAX_DURATION_T1",
default => DEFAULT_TIMER_VALUE,
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
type => "max_duration",
......@@ -654,15 +664,17 @@ BEGIN {
MAX_DURATION_T2 => {
description => "Maximum Duration T2",
ini_name => "MAX_DURATION_T2",
default => DEFAULT_TIMER_VALUE,
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
type => "max_duration",
matching => "MIN_DURATION_T1",
matching => "MIN_DURATION_T2",
order => 50,
},
PROB_STUCK_AT_0 => {
description => "Probability of stuck-at-0 fault",
ini_name => "PROB_STUCK_AT_0",
default => 0,
type => 'prob',
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
......@@ -672,6 +684,7 @@ BEGIN {
PROB_STUCK_AT_1 => {
description => "Probability of stuck-at-1 fault",
ini_name => "PROB_STUCK_AT_1",
default => 0,
type => 'prob',
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
......@@ -681,6 +694,7 @@ BEGIN {
PROB_DELAY => {
description => "Probability of delay fault",
ini_name => "PROB_DELAY",
default => 0,
type => 'prob',
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
......@@ -690,6 +704,7 @@ BEGIN {
PROB_SEU => {
description => "Probability of single event upset",
ini_name => "PROB_SEU",
default => 0,
type => 'prob',
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
......@@ -699,6 +714,7 @@ BEGIN {
PROB_STUCK_OPEN => {
description => "Probability of stuck-open fault",
ini_name => "PROB_STUCK_OPEN",
default => 0,
type => 'prob',
phases_opt => [qw(manual auto)],
gui_modes => [qw (random)],
......@@ -798,7 +814,7 @@ sub ini2constkey {
use base 'Exporter';
our @EXPORT = ( keys(%designmap), keys(%fiumap), keys(%testpatmap), keys(%testconstmap), keys(%fiuenum), keys(%displaygroups), keys(%testguimodes) );
our @EXPORT_OK = ( keys(%designmap), 'DESIGNMAP', keys(%fiumap), 'FIUMAP', keys(%testpatmap), 'TESTPATMAP', keys(%testconstmap), 'TESTCONSTMAP', keys(%fiuenum), 'FIUENUM', 'REVERSE_FIU_ENUM', 'DISPLAYGROUPS', keys(%displaygroups), 'TESTGUIMODES', keys(%testguimodes), 'HOST_TO_FIC_LATENCY' );
our @EXPORT_OK = ( keys(%designmap), 'DESIGNMAP', keys(%fiumap), 'FIUMAP', keys(%testpatmap), 'TESTPATMAP', keys(%testconstmap), 'TESTCONSTMAP', keys(%fiuenum), 'FIUENUM', 'REVERSE_FIU_ENUM', 'DISPLAYGROUPS', keys(%displaygroups), 'TESTGUIMODES', keys(%testguimodes), 'HOST_TO_FIC_LATENCY', 'DEFAULT_TIMER_VALUE' );
## @var @EXPORT_TAGS Export Tags
#
......
......@@ -42,7 +42,7 @@ use Time::HiRes "usleep";
use Data::Dumper;
use FIJI::AnySerialPort;
## @method init ($portname, $baudrate)
## @method public init ($portname, $baudrate)
# @brief Initiate the given serial port and this abstraction.
#
# \param portname The path to the device file of the port.
......@@ -112,7 +112,7 @@ sub init {
return $r;
}
## @function sanitize_config (%$config_ref)
## @function public sanitize_config (%$config_ref)
# @brief Do a sanity check on the FIJI configuration hash.
#
# \param config_ref a reference to a hash containing a FIJI configuration consisting of
......@@ -187,7 +187,7 @@ sub sanitize_config {
return 0;
}
## @method send_config (%$config_ref, $timeout, $block_till_ready, $wait_for_ready)
## @method public send_config (%$config_ref, $timeout, $block_till_ready, $wait_for_ready)
# @brief Sends a complete configuration to the FI controller.
#
# \param config_ref a reference to a hash representing a FIJI configuration (see \ref sanitize_config).
......@@ -379,7 +379,7 @@ sub send_config {
return { msg_type => $msg_type, fault_detect => \%fd, error => \%err };
}
## @function _send_bitstream ($port, $$str_ref, $timeout)
## @function public _send_bitstream ($port, $$str_ref, $timeout)
# @brief Sends a bitstream via a serial port
#
# \param port An initialized AnySerialPort port object
......@@ -431,7 +431,7 @@ sub _send_bitstream {
return $wrn;
}
## @function _rcv_bitstream ($port, $todo, $timeout, @$out_ref)
## @function public _rcv_bitstream ($port, $todo, $timeout, @$out_ref)
# @brief Receives a bitstream via a serial port
#
# \param port An initialized AnySerialPort port object
......@@ -487,7 +487,7 @@ sub _rcv_bitstream {
return 0;
}
## @function _parse_return_message ($message_byte, %$error_ref)
## @function public _parse_return_message ($message_byte, %$error_ref)
#
# \returns The type of the return message, or undef in the case of errors.
# Possible types are: 'CONF_DONE', 'UNDERRUN', 'READY'
......
......@@ -17,6 +17,14 @@
# FIJI Downloader class
#-------------------------------------------------------------------------------
## @file
## @class
# @brief FIJI Downloader class
#
# contains functionality to download tests via serial
#
package FIJI::Downloader;
use strict;
......@@ -32,28 +40,46 @@ use Clone 'clone';
use threads;
use threads::shared;
## @function public new ($testname,$existing_tests,$cfgname,$existing_cfg)
#
# @param testsname (optional) Name of a FIJI::Tests configuration file
# @param existing_tests (optional) Reference to an existing FIJI::Tests object
# @param cfgname (optional) Name of a FIJI::Settings configuration file
# @param existing_cfg (optional) Reference to an existing FIJI::Settings object
#
# Either $testsname or $existing_tests must be present
# Either $cfgname or $existing_cfg must be present
sub new(;$$) {
my $logger = get_logger("");
my ( $class, $testsname, $existing_tests, $cfgname, $existing_cfg ) = @_;
my $self = {};
my $rv = "Constructor has no means of obtaining a FIJI::Tests/Settings object" . bless $self, $class;
my $rvt = "Constructor has no means of obtaining a FIJI::Tests object" . bless $self, $class;
my $rvs = "Constructor has no means of obtaining a FIJI::Settings object" . bless $self, $class;
if ( defined $existing_cfg ) {
$rv = $self->existing_settings($existing_cfg);
$rvt = $self->existing_settings($existing_cfg);
} elsif ( defined $cfgname ) {
$rv = $self->settings_from_file($cfgname);
$rvt = $self->settings_from_file($cfgname);
}
if ( defined $existing_tests ) {
$rv = $self->existing_tests($existing_tests);
$rvs = $self->existing_tests($existing_tests);
} elsif ( defined $testsname ) {
$rv = $self->tests_from_file( $self->{'fiji_settings'}->{'design'}->{'CFGS_PER_MSG'}, $self->{'fiji_settings'}->{'design'}->{'FIU_NUM'}, $testsname );
$rvs = $self->tests_from_file( $self->{'fiji_settings'}->{'design'}->{'CFGS_PER_MSG'}, $self->{'fiji_settings'}->{'design'}->{'FIU_NUM'}, $testsname );
}
$logger->error($rv) if ( !ref $rv );
$logger->error($rvt) if ( !ref $rvt );
$logger->error($rvs) if ( !ref $rvs );
return $self;
}
## @method public settings_from_file ($cfgname)
# @brief read settings from a given file
# @param cfgname the file to read from
# @returns STRING if an error ocurred
# @returns FIJI::Settings object if sucessful
sub settings_from_file {
my $rv;
my ( $self, $cfgname ) = @_;
......@@ -76,6 +102,13 @@ sub existing_settings {
}
}
## @method public tests_from_file ($cfgname)
# @brief read tests from a given file
# @param cfgname the file to read from
# @param msgs_per_cfg the number of faults per FIU
# @param fiu_num the number of FIUs
# @returns STRING if an error ocurred
# @returns FIJI::Tests object if sucessful
sub tests_from_file {
my $rv;
my ( $self, $msgs_per_cfg, $fiu_num, $cfgname ) = @_;
......@@ -98,9 +131,10 @@ sub existing_tests {
}
}
## Wrapper for port->send_config
## @method private _test_fiu_uart ( $port, $payload_ref, $t1_duration, $t2_duration, $trigger_en, $trigger_ext, $reset, $fiji_consts )
# @brief Wrapper for port->send_config
# Generates a configuration hash from discrete parameters
#
# @returns the return value from FIJI::Connection->send_config
sub _test_fi_uart {
my $logger = get_logger("");
my ( $port, $payload_ref, $t1_duration, $t2_duration, $trigger_en, $trigger_ext, $reset, $fiji_consts ) = @_;
......@@ -128,9 +162,14 @@ sub _test_fi_uart {
return $port->send_config( \%config, $timeout, 0, 1 );
}
## Download tests contained in the .cfg file
# Params
# portname Optional serial port to use
## @method public download_auto ($testref, $portname, &$intermediate_cb)
# @brief Download tests contained in the .cfg file
# @param testref (optional) reference where this function shall put the
# executed tests
# @param portname (optional) serial port to use
# @param intermediate_cb (optional) reference to a function to call after each test
# @returns STRING if an error occurred
# @returns HASH containing the last received message if successfully sent
sub download_auto ($) {
my $msg;
my $logger = get_logger("");
......@@ -210,20 +249,15 @@ sub download_auto ($) {
return $recv_msg;
}
## Download randomly generated tests
# Params
# cfg Configuration hash
# cfg->{'min_duration'}[0..n] Minimum duration constraints for patterns
# cfg->{'max_duration'}[0..n] Maximum duration constraints for patterns
# cfg->{'probabilities'}[FIJI::FIUENUM->{'NONE'}] Probability of fault-free case
# cfg->{'probabilities'}[FIJI::FIUENUM->{'STUCK_AT_0'}] Probability of stuck-at-0 error
# cfg->{'probabilities'}[FIJI::FIUENUM->{'STUCK_AT_1'}] Probability of stuck-at-1 error
# cfg->{'probabilities'}[FIJI::FIUENUM->{'DELAY'}] Probability of delay error
# cfg->{'probabilities'}[FIJI::FIUENUM->{'SEU'}] Probability of seu error
# cfg->{'probabilities'}[FIJI::FIUENUM->{'STUCK_OPEN'}] Probability of stuck-open error
# testref Reference where download_random() places the modified FIJI::Tests object
# after the test execution
# portname Optional serial port to use
## @method public download_auto ($testref, $portname, &$intermediate_cb)
# @brief Download randomly generated tests
# @param testref (optional) reference where this function shall put the
# executed tests
# @param portname (optional) serial port to use
# @param intermediate_cb (optional) reference to a function to call after each test
# @returns STRING if an error occurred
# @returns HASH containing the last received message if successfully sent
sub download_random ($$$;$) {
my $logger = get_logger("");
my ( $self, $testref, $portname, $intermediate_cb ) = @_;
......@@ -273,8 +307,9 @@ sub download_random ($$$;$) {
return $recv_msg;
}
## Download manually defined tests prompted from <STDIN>
# portname Optional serial port to use
## @method download_manual
# @brief Download manually defined tests prompted from <STDIN>
# @param portname (optional) the serial port to use
sub download_manual ($;$) {
my $msg;
my $logger = get_logger("");
......@@ -317,9 +352,8 @@ sub download_manual ($;$) {
return $msg;
}
## Prompt tests from <STDIN>
# Params
#
## @method _get_test_from_stdin ()
# @briefPrompt tests from <STDIN>
sub _get_test_from_stdin {
my $logger = get_logger("");
my ($self) = @_;
......@@ -407,6 +441,12 @@ sub _get_test_from_stdin {
return $test;
}
## @method public download_test ($test, $portname)
# @brief Download a single test defined by a test hash
# @param test the hash describing the test
# @param portname the name of the serial port to use
# @returns STRING if an error ocurred
# @returns HASH returned by _test_fi_uart() containing the decoded return message
sub download_test ($$) {
my $logger = get_logger("");
my ( $self, $test, $portname ) = @_;
......@@ -430,16 +470,16 @@ sub update_rnd($) {
}
}
## Download a single test defined by a test hash
# Params
# test The hash defining the test
# test->{'TIMER_VALUE_1'}
# test->{'TIMER_VALUE_2'}
# test->{"FIU_[0..FIU_NUM]_FAULT_[0..CFGS_PER_MSG]"}
# test->{'RESET_DUT_AFTER_CONFIG'}
# test->{'TRIGGER'}
# port serial port to use
sub _download_test ($$) {
## @method private _download_test ($test, $port)
# @brief Download a single test defined by a test hash
# @param test The hash defining the test
# - test->{'TIMER_VALUE_1'}
# - test->{'TIMER_VALUE_2'}
# - test->{"FIU_[0..FIU_NUM]_FAULT_[0..CFGS_PER_MSG]"}
# - test->{'RESET_DUT_AFTER_CONFIG'}
# - test->{'TRIGGER'}
# @param port (optional) serial port to use
sub _download_test {
my $logger = get_logger("");
my ( $self, $test, $port ) = @_;
......@@ -485,11 +525,12 @@ sub _download_test ($$) {
return $recv_msg;
}
## Check the hash returned by _test_fi_uart() against HALT_ON_xxx-conditions
# Params
# recv_msg The hash returned by _test_fi_uart() containing the decoded
# return message
# Returns 1 if execution shall be halted and 0 otherwise
## @method private _check_halt ($recv_msg)
# @brief Check the hash returned by _test_fi_uart() against HALT_ON_xxx-conditions
# @param recv_msg The hash returned by _test_fi_uart() containing the decoded
# return message
# @returns 1 if execution shall be halted
# @returns 0 otherwise
sub _check_halt ($) {
my $halt = 0;
my $logger = get_logger("");
......
This diff is collapsed.
......@@ -40,7 +40,7 @@ use FIJI qw(:all);
my @base_resources;
## @function new ($phase, $fiji_ini_file, $existing_settings)
## @function public new ($phase, $fiji_ini_file, $existing_settings)
# Create a new settings instance.
#
# \param $phase Tool flow phase the settings need to be compatible with.
......@@ -108,12 +108,12 @@ sub _export_value {
}
}
## @method save ($fiji_ini_file)
## @method public save ($fiji_ini_file)
# @brief Store contained FIJI Settings to file.
#
# @ATTENTION Will happily overwrite existing files!
#
# \param fiji_ini_file The file name to write the FIJI Settings to.
# @param fiji_ini_file The file name to write the FIJI Settings to.
sub save ($) {
my $logger = get_logger("");
my ( $self, $fiji_ini_file ) = @_;
......@@ -185,19 +185,19 @@ sub save ($) {
return undef;
}
## @function read_settingsfile ($phase, $fiji_ini_file)
## @function public read_settingsfile ($phase, $fiji_ini_file)
# @brief Load the FIJI Settings file containing design and FIU constants.
#
# \param phase Tool flow phase the settings stored in the given file
# @param phase Tool flow phase the settings stored in the given file
# need to be compatible with.
# \param fiji_ini_file The name of an .ini file with FIJI Settings:
# @param fiji_ini_file The name of an .ini file with FIJI Settings:
# - a 'consts' block containing the constants specified by
# \ref _sanitize_design.
# - at least one FIU block named "FIU<number>" where "<number>"
# is a strictly increasing integer starting with 0 containing
# the constants for the respective FIU, see \ref _sanitize_fiu
#
# \returns a reference to the hash containing the read constants.
# @returns a reference to the hash containing the read constants.
sub read_settingsfile ($$$) {
my $logger = get_logger("");
my ( $phase, $fiji_ini_file, $existing_settings ) = @_;
......@@ -316,7 +316,7 @@ sub read_settingsfile ($$$) {
return $fiji_settings_ref;
}
## @method set_fiu_defaults (%$fiu_ref)
## @method public set_fiu_defaults (%$fiu_ref)
# @brief Overwrite existing fields (if defined) with defaults defined in FIJI.pm.
#
sub set_fiu_defaults ($) {
......@@ -500,7 +500,7 @@ sub _rename_import {
#
# \returns A new hash with all constants required in the FIU settings
# in sanitized form, or undef on errors.
sub _sanitize_fiu ($;$) {
sub _sanitize_fiu {
my $logger = get_logger("");
my ( $fiu_ref, $phase ) = @_;
if ( ref($fiu_ref) ne 'HASH' ) {
......@@ -518,13 +518,13 @@ sub _sanitize_fiu ($;$) {
return $fiu_ref;
}
sub _disabled_via_dependency ($$$) {
sub _disabled_via_dependency {
my ( $map_ref, $consts_ref, $k ) = @_;
my $dependency = $map_ref->{$k}->{'depends_on'};
return defined($dependency) && !$consts_ref->{$dependency};
}
sub _validate_hashmap ($$;$) {
sub _validate_hashmap {
my $logger = get_logger("");
my ( $map_ref, $consts_ref, $phase ) = @_;
my @map_keys = keys( %{$map_ref} );
......@@ -645,8 +645,20 @@ sub _log2 {
return ( $val > 0 ) ? ( log($val) / log(2) ) : 0;
}
## Determined by experiment & fitted by scipy.optimize.curve_fit
## @function private _est_resources ($FREQUENCY, $BAUD, $TIMER_WIDTH, $RESET_CYCLES, $LFSR_WIDTH, $FIU_NUM, $algo)
# @brief estimates the number of Registers and LUTs to implement FIJI logic with the given settings
#
# The function ant its parameters were determined by experiment & fitted by scipy.optimize.curve_fit
#
# @param FREQUENCY the clock frequency the FIJI logic will run at in Hz
# @param BAUD the baud rate for DUT <-> FIJI communication
# @param TIMER_WIDTH the width of the injection timer (durations) in Bytes
# @param RESET_CYCLE the number of cycles to apply a FIJI-to-DUT reset
# @param LFSR_WIDTH width of the LFSR used for stuck-open emulation
# @param algo the algorithm to use, can be eiterh "logarithmic" or "polynomial"
#
# @returns ($registers, $lutsum)
sub _est_resources {
my $logger = get_logger("");
my ( $FREQUENCY, $BAUD, $TIMER_WIDTH, $RESET_CYCLES, $LFSR_WIDTH, $FIU_NUM, $algo ) = @_;
......@@ -685,21 +697,6 @@ sub _est_resources {