Hog Hog2025.1-4
hog.tcl File Reference

Go to the source code of this file.

Functions

 AddFile file fileset
 Add a new file to a fileset in Vivado. More...
 
 AddHogFiles libraries properties filesets
 Add libraries, properties and filesets to the project. More...
 
 ALLOWED_PROPS
 Returns a dictionary for the allowed properties for each file type. More...
 
 BinaryStepName part
 # Returns the step name for the stage that produces the binary file More...
 
 CheckSyntax project_name repo_path ?project_file?
 
 CloseProject
 
 CompareVersions ver1 ver2
 Compare two semantic versions. More...
 
 CheckExtraFiles libraries
 
 CheckLatestHogRelease ?repo_path?
 
 CheckYmlRef repo_path allow_failure
 Checks that "ref" in .gitlab-ci.yml actually matches the hog.yml file in the. More...
 
 CompareLibDicts proj_libs list_libs proj_sets list_sets proj_props list_props ?severity? ?outFile? ?extraFiles?
 Compare the contents of two dictionaries. More...
 
 CompareVHDL file1 file2
 Compare two VHDL files ignoring spaces and comments. More...
 
 Copy i_dirs o_dir
 
 CopyIPbusXMLs proj_dir path dst ?xml_version? ?xml_sha? ?use_ipbus_sw? ?generate?
 Read a XML list file and copy files to destination. More...
 
 DescriptionFromConf conf_file
 Returns the description from the hog.conf file. The description is the comment in the second line stripped of the hashes If the description contains the word test, Test or TEST, then "test" is simply returned. This is used to avoid printing them in ListProjects unless -all is specified. More...
 
 DictGet dictName keyName ?default?
 Returns the value in a Tcl dictionary corresponding to the chosen key. More...
 
 DoxygenVersion target_version
 Checks the Doxygen version installed in this machine. More...
 
 eos command ?attempt?
 Handle eos commands. More...
 
 Execute args
 Handle shell commands. More...
 
 ExecuteRet args
 Handle shell commands. More...
 
 ExtractVersionFromTag tag
 Tags the repository with a new version calculated on the basis of the previous tags. More...
 
 FileCommitted File
 Checks if file was committed into the repository. More...
 
 FindCommonGitChild SHA1 SHA2
 
 findFiles basedir pattern
 
 FindFileType file_name
 
 FindNewestVersion versions
 
 FindVhdlVersion file_name
 Set VHDL version to 2008 for *.vhd files. More...
 
 FormatGeneric generic
 Format a generic to a 32 bit verilog style hex number, e.g. take in ea8394c and return 32'h0ea8394c. More...
 
 GenerateBitstream ?run_folder? ?repo_path? ?njobs?
 
 GenerateQsysSystem qsysFile commandOpts
 Function used to generate a qsys system from a .qsys file. The procedure adds the generated IPs to the project. More...
 
 GenericToSimulatorString prop_dict target
 
 GetConfFiles proj_dir
 
 GetCustomCommands ?directory? ?ret_commands?
 
 GetDateAndTime commit
 
 GetFile file fileset
 Gets a list of files contained in the current fileset that match a file name (passed as parameter) More...
 
 GetFileGenerics filename ?entity?
 Extract the generics from a file. More...
 
 GetGenericsFromConf proj_dir ?sim?
 Gets custom generics from hog|sim.conf. More...
 
 GetSimsetGenericsFromConf proj_dir
 Gets all custom <simset>:generics from sim.conf. More...
 
 GetGroupName proj_dir repo_dir
 
 GetHogDescribe sha ?repo_path?
 
 GetHogFiles args
 Extract files, libraries and properties from the project's list files. More...
 
 GetIDECommand proj_conf
 
 GetIDEFromConf conf_file
 
 GetIDEName
 
 GetIDEVersion
 
 GetLinkedFile link_file
 Returns the real file linked by a soft link. More...
 
 GetMaxThreads proj_dir
 Gets MAX number of Threads property from property.conf file in Top/$proj_name directory. More...
 
 GetModifiedFiles ?repo_path? ?pattern?
 Get a list of all modified the files matching then pattern. More...
 
 GetOptions argv parameters
 
 GetProjectFiles ?project_file?
 
 GetProjectFlavour proj_name
 
 GetProjectVersion proj_dir repo_path ?ext_path? ?sim?
 
 GetRepoVersions proj_dir repo_path ?ext_path? ?sim?
 
 GetSHA ?path?
 Get git SHA of a subset of list file. More...
 
 GetSimulators
 Returns the list of Simulators supported by Vivado. More...
 
 GetTopFile
 Return the path to the active top file. More...
 
 GetTopModule
 Return the name of the active top module. More...
 
 GetVer path ?force_develop?
 Get git version and commit hash of a subset of files. More...
 
 GetVerFromSHA SHA repo_path ?force_develop?
 Get git version and commit hash of a specific commit give the SHA. More...
 
 Git command ?files?
 Handle git commands. More...
 
 GetModuleName filename
 
 GetVerilogGenerics file
 
 GetVhdlGenerics file ?entity?
 
 GitRet command ?files?
 Handle git commands without causing an error if ret is not 0. More...
 
 GitVersion target_version
 Check git version installed in this machine. More...
 
 HandleIP what_to_do xci_file ip_path repo_path ?gen_dir? ?force?
 Copy IP generated files from/to a remote o local directory (possibly EOS) More...
 
 HexVersionToString version
 
 ImportTclLib
 
 InitLauncher script tcl_path parameters usage argv
 
 IsCommitAncestor ancestor commit
 
 IsDiamond
 
 IsLibero
 Returns true if the IDE is MicroSemi Libero. More...
 
 IsInList element list ?regex?
 
 IsISE
 Returns true, if the IDE is ISE/PlanAhead. More...
 
 IsQuartus
 Returns true, if IDE is Quartus. More...
 
 IsRelativePath path
 
 IsSynplify
 Returns true if the Synthesis tool is Synplify. More...
 
 IsTclsh
 Returns true, if we are in tclsh. More...
 
 IsVersal part
 Find out if the given Xilinx part is a Vesal chip. More...
 
 IsVivado
 Returns true, if the IDE is Vivado. More...
 
 IsXilinx
 Return true, if the IDE is Xilinx (Vivado or ISE) More...
 
 IsZynq part
 Find out if the given Xilinx part is a Vesal chip. More...
 
 LaunchImplementation reset do_create run_folder project_name ?repo_path? ?njobs? ?do_bitstream?
 
 LaunchSimulation project_name lib_path ?simsets? ?repo_path?
 
 LaunchSynthesis reset do_create run_folder project_name ?repo_path? ?ext_path? ?njobs?
 
 ListProjects ?repo_path? ?print? ?ret_conf?
 
 Logo ?repo_path?
 
 Md5Sum file_name
 Evaluates the md5 sum of a file. More...
 
 MergeDict dict0 dict1
 Merges two tcl dictionaries of lists. More...
 
 MoveElementToEnd inputList element
 
 Msg level msg ?title?
 The Hog Printout Msg function. More...
 
 MsgAndLog msg ?severity? ?outFile?
 Prints a message with selected severity and optionally write into a log file. More...
 
 OpenProject project_file repo_path
 
 OS
 Return the operative system name. More...
 
 ParseJSON JSON_FILE JSON_KEY
 Parse JSON file. More...
 
 ProjectExists project ?repo_path?
 
 ReadConf file_name
 
 ReadExtraFileList extra_file_name
 Function used to read the list of files generated at creation time by tcl scripts in Project/proj/.hog/extra.files. More...
 
 ReadListFile args
 Read a list file and return a list of three dictionaries. More...
 
 Relative base dst
 Returns the destination path relative to base. More...
 
 RelativeLocal pathName filePath
 Returns the path of filePath relative to pathName. More...
 
 RemoveDuplicates mydict
 Remove duplicates in a dictionary. More...
 
 ResetRepoFiles reset_file
 
 RestoreModifiedFiles ?repo_path? ?pattern?
 Restore with checkout – the files specified in pattern. More...
 
 SearchHogProjects dir
 
 SetGenericsSimulation repo_path proj_dir target
 Sets the generics in all the sim.conf simulation file sets. More...
 
 SetTopProperty top_module fileset
 set the top module as top module in the chosen fileset More...
 
 VIVADO_PATH_PROPERTIES
 Returns a list of Vivado properties that expect a PATH for value. More...
 
 WriteConf file_name config ?comment?
 Write a property configuration file from a dictionary. More...
 
 WriteGenerics mode repo_path design date timee commit version top_hash top_ver hog_hash hog_ver cons_ver cons_hash libs vers hashes ext_names ext_hashes user_ip_repos user_ip_vers user_ip_hashes flavour ?xml_ver? ?xml_hash?
 
 WriteGenericsToBdIPs mode repo_path proj generic_string
 Applies generic values to IPs within block designs. More...
 
 GetGenericFormatFromXciXML generic_name xml_file
 
 GetGenericFormatFromXci generic_name xci_file
 
 WriteGitLabCIYAML proj_name ?ci_conf?
 Returns the gitlab-ci.yml snippet for a CI stage and a defined project. More...
 
 WriteListFiles libs props list_path repo_path ? $ext_path?
 
 WriteSimListFiles libs props simsets list_path repo_path
 
 WriteToFile File msg
 Write into a file, and if the file exists, it will append the string. More...
 
 WriteUtilizationSummary input output project_name run
 

Function Documentation

◆ AddFile()

AddFile   file fileset  

Add a new file to a fileset in Vivado.

Parameters
[in]fileThe name of the file to add. NOTE: directories are not supported.
[in]filesetThe fileset name

Definition at line 28 of file hog.tcl.

◆ AddHogFiles()

AddHogFiles   libraries properties filesets  

Add libraries, properties and filesets to the project.

Parameters
[in]librarieshas library name as keys and a list of filenames as values
[in]propertieshas as file names as keys and a list of properties as values
[in]filesetshas fileset name as keys and a list of libraries as values

Definition at line 40 of file hog.tcl.

◆ ALLOWED_PROPS()

ALLOWED_PROPS

Returns a dictionary for the allowed properties for each file type.

Definition at line 546 of file hog.tcl.

◆ BinaryStepName()

BinaryStepName   part  

# Returns the step name for the stage that produces the binary file

Projects using Versal chips have a different step for producing the binary file, we use this function to take that into account

Parameters
[out]1if it's Versal 0 if it's not
[in]partThe FPGA part

Definition at line 572 of file hog.tcl.

◆ CheckExtraFiles()

CheckExtraFiles   libraries  

Definition at line 697 of file hog.tcl.

◆ CheckLatestHogRelease()

CheckLatestHogRelease   ?repo_path?  

Definition at line 737 of file hog.tcl.

◆ CheckSyntax()

CheckSyntax   project_name repo_path ?project_file?  

Definition at line 587 of file hog.tcl.

◆ CheckYmlRef()

CheckYmlRef   repo_path allow_failure  

Checks that "ref" in .gitlab-ci.yml actually matches the hog.yml file in the.

Parameters
[in]repo_pathpath to the repository root
[in]allow_failureif true throws CriticalWarnings instead of Errors

Definition at line 786 of file hog.tcl.

◆ CloseProject()

CloseProject

Definition at line 629 of file hog.tcl.

◆ CompareLibDicts()

CompareLibDicts   proj_libs list_libs proj_sets list_sets proj_props list_props ?severity? ?outFile? ?extraFiles?  

Compare the contents of two dictionaries.

Parameters
[in]proj_libsThe dictionary of libraries in the project
[in]list_libsThe dictionary of libraries in list files
[in]proj_setsThe dictionary of filesets in the project
[in]list_setsThe dictionary of filesets in list files
[in]proj_propsThe dictionary of file properties in the project
[in]list_propsThe dictionary of file pproperties in list files
[in]severityThe severity of the message in case a file is not found (Default: CriticalWarning)
[in]outFileThe output log file, to write the messages (Default "")
[in]extraFilesThe dictionary of extra files generated a creation time (Default "")
Returns
n_diffs The number of differences
extra_files Remaining list of extra files

Definition at line 916 of file hog.tcl.

◆ CompareVersions()

CompareVersions   ver1 ver2  

Compare two semantic versions.

Parameters
[in]ver1a list of 3 numbers M m p
[in]ver2a list of 3 numbers M m p

In case the ver1 or ver2 are in the format vX.Y.Z rather than a list, they will be converted. If one of the tags is an empty string it will be considered as 0.0.0

Returns
Returns 1 ver1 is greater than ver2, 0 if they are equal, and -1 if ver2 is greater than ver1

Definition at line 651 of file hog.tcl.

◆ CompareVHDL()

CompareVHDL   file1 file2  

Compare two VHDL files ignoring spaces and comments.

Parameters
[in]file1the first file
[in]file2the second file

@ return A string with the diff of the files

Definition at line 1041 of file hog.tcl.

◆ Copy()

Copy   i_dirs o_dir  

Definition at line 1079 of file hog.tcl.

◆ CopyIPbusXMLs()

CopyIPbusXMLs   proj_dir path dst ?xml_version? ?xml_sha? ?use_ipbus_sw? ?generate?  

Read a XML list file and copy files to destination.

Additional information is provided with text separated from the file name with one or more spaces

Parameters
[in]proj_dirproject path, path containing the ./list directory containing at least a list file with .ipb extention
[in]paththe path the XML files are referred to in the list file
[in]dstthe path the XML files must be copied to
[in]xml_versionthe M.m.p version to be used to replace the VERSION placeholder in any of the xml files
[in]xml_shathe Git-SHA to be used to replace the GIT_SHA placeholder in any of the xml files
[in]use_ipbus_swif set to 1, use the IPbus sw to generate or check the vhdl files
[in]generateif set to 1, tells the function to generate the VHDL decode address files rather than check them

Definition at line 1102 of file hog.tcl.

◆ DescriptionFromConf()

DescriptionFromConf   conf_file  

Returns the description from the hog.conf file. The description is the comment in the second line stripped of the hashes If the description contains the word test, Test or TEST, then "test" is simply returned. This is used to avoid printing them in ListProjects unless -all is specified.

Parameters
[in]conf_filethe path to the hog.conf file

Definition at line 1246 of file hog.tcl.

◆ DictGet()

DictGet   dictName keyName ?default?  

Returns the value in a Tcl dictionary corresponding to the chosen key.

Parameters
[in]dictNamethe name of the dictionary
[in]keyNamethe name of the key
[in]defaultthe default value to be returned if the key is not found (default "")
Returns
The value in the dictionary corresponding to the provided key

Definition at line 1271 of file hog.tcl.

◆ DoxygenVersion()

DoxygenVersion   target_version  

Checks the Doxygen version installed in this machine.

Parameters
[in]target_versionthe version required by the current project
Returns
Returns 1, if the system Doxygen version is greater or equal to the target

Definition at line 1284 of file hog.tcl.

◆ eos()

eos   command ?attempt?  

Handle eos commands.

It can be used with lassign like this: lassign [eos <eos command> ] ret result

Parameters
[in]commandthe EOS command to be run, e.g. ls, cp, mv, rm
[in]attempt(default 0) how many times the command should be attempted in case of failure
Returns
a list of 2 elements: the return value (0 if no error occurred) and the output of the EOS command

Definition at line 1303 of file hog.tcl.

◆ Execute()

Execute   args  

Handle shell commands.

It can be used with lassign like this: lassign [Execute <command> ] ret result

Parameters
[in]argsthe shell command
Returns
the output of the command

Definition at line 1335 of file hog.tcl.

◆ ExecuteRet()

ExecuteRet   args  

Handle shell commands.

It can be used with lassign like this: lassign [ExecuteRet <command> ] ret result

Parameters
[in]argsthe shell command
Returns
a list of 2 elements: the return value (0 if no error occurred) and the output of the command

Definition at line 1353 of file hog.tcl.

◆ ExtractVersionFromTag()

ExtractVersionFromTag   tag  

Tags the repository with a new version calculated on the basis of the previous tags.

Parameters
[in]taga tag in the Hog format: v$M.$m.$p or bv$M.$m.$p-$n
Returns
a list containing: Major minor patch v.

Definition at line 1372 of file hog.tcl.

◆ FileCommitted()

FileCommitted   File  

Checks if file was committed into the repository.

Parameters
[in]Filefile name
Returns
1 if file was committed and 0 if file was not committed

Definition at line 1394 of file hog.tcl.

◆ FindCommonGitChild()

FindCommonGitChild   SHA1 SHA2  

Definition at line 1411 of file hog.tcl.

◆ findFiles()

findFiles   basedir pattern  

Definition at line 1434 of file hog.tcl.

◆ FindFileType()

FindFileType   file_name  
Returns
FILE_TYPE the file Type

Definition at line 1466 of file hog.tcl.

◆ FindNewestVersion()

FindNewestVersion   versions  

Definition at line 1535 of file hog.tcl.

◆ FindVhdlVersion()

FindVhdlVersion   file_name  

Set VHDL version to 2008 for *.vhd files.

Parameters
[in]file_namethe name of the HDL file
Returns
"-hdl_version VHDL_2008" if the file is a *.vhd files else ""

Definition at line 1551 of file hog.tcl.

◆ FormatGeneric()

FormatGeneric   generic  

Format a generic to a 32 bit verilog style hex number, e.g. take in ea8394c and return 32'h0ea8394c.

Parameters
[in]unformattedgeneric

Definition at line 1572 of file hog.tcl.

◆ GenerateBitstream()

GenerateBitstream   ?run_folder? ?repo_path? ?njobs?  

Definition at line 1587 of file hog.tcl.

◆ GenerateQsysSystem()

GenerateQsysSystem   qsysFile commandOpts  

Function used to generate a qsys system from a .qsys file. The procedure adds the generated IPs to the project.

Parameters
[in]qsysFilethe Intel Platform Designed file (.qsys), containing the system to be generated
[in]commandOptsthe command options to be used during system generation as they are in qsys-generate options

Definition at line 1617 of file hog.tcl.

◆ GenericToSimulatorString()

GenericToSimulatorString   prop_dict target  

Format generics from conf file to string that simulators accepts

Parameters
[in]dictcontaining generics from conf file
[in]targetsoftware target(vivado, questa) defines the output format of the string

Definition at line 1680 of file hog.tcl.

◆ GetConfFiles()

GetConfFiles   proj_dir  

Get the configuration files to create a Hog project

Parameters
[in]proj_dirThe project directory containing the conf file or the the tcl file
Returns
[in] a list containing the full path of the hog.conf, sim.conf, pre-creation.tcl, post-creation.tcl and proj.tcl files

Definition at line 1735 of file hog.tcl.

◆ GetCustomCommands()

GetCustomCommands   ?directory? ?ret_commands?  

Definition at line 1754 of file hog.tcl.

◆ GetDateAndTime()

GetDateAndTime   commit  

Get the Date and time of a commit (or current time if Git < 2.9.3)

Parameters
[in]commitThe commit

Definition at line 1795 of file hog.tcl.

◆ GetFile()

GetFile   file fileset  

Gets a list of files contained in the current fileset that match a file name (passed as parameter)

The file name is matched against the input parameter.

Parameters
[in]filename (or part of it)
[in]filesetname
Returns
a list of files matching the parameter in the chosen fileset

Definition at line 1818 of file hog.tcl.

◆ GetFileGenerics()

GetFileGenerics   filename ?entity?  

Extract the generics from a file.

Parameters
[in]filenameThe file from which to extract the generics
[in]entityThe entity in the file from which to extract the generics (default "")

Definition at line 1840 of file hog.tcl.

◆ GetGenericFormatFromXci()

GetGenericFormatFromXci   generic_name xci_file  
Parameters
[in]xci_fileThe path to the XCI file

Definition at line 5592 of file hog.tcl.

◆ GetGenericFormatFromXciXML()

GetGenericFormatFromXciXML   generic_name xml_file  
Parameters
[in]xml_fileThe path to the XML XCI file

Definition at line 5561 of file hog.tcl.

◆ GetGenericsFromConf()

GetGenericsFromConf   proj_dir ?sim?  

Gets custom generics from hog|sim.conf.

Parameters
[in]proj_dirthe top folder of the project
Returns
dict with generics

Definition at line 1856 of file hog.tcl.

◆ GetGroupName()

GetGroupName   proj_dir repo_dir  

Returns the group name from the project directory

Parameters
[in]proj_dirproject directory
[in]repo_dirrepository directory
Returns
the group name without initial and final slashes

Definition at line 1906 of file hog.tcl.

◆ GetHogDescribe()

GetHogDescribe   sha ?repo_path?  

Get custom Hog describe of a specific SHA

Parameters
[in]shathe git sha of the commit you want to calculate the describe of
[in]repo_paththe main path of the repository
Returns
the Hog describe of the sha or the current one if the sha is 0

Definition at line 1932 of file hog.tcl.

◆ GetHogFiles()

GetHogFiles   args  

Extract files, libraries and properties from the project's list files.

Parameters
[in]argsThe arguments are <list_path> <repository path>[options]
  • list_path path to the list file directory Options:
  • -list_files <List files> the file wildcard, if not specified all Hog list files will be looked for
  • -sha_mode forwarded to ReadListFile, see there for info
  • -ext_path <external path> path for external libraries forwarded to ReadListFile
Returns
a list of 3 dictionaries: libraries and properties
  • libraries has library name as keys and a list of filenames as values
  • properties has as file names as keys and a list of properties as values
  • filesets has the fileset name as keys and the correspondent list of libraries as values (significant only for simulations)

Definition at line 1958 of file hog.tcl.

◆ GetIDECommand()

GetIDECommand   proj_conf  

Definition at line 2020 of file hog.tcl.

◆ GetIDEFromConf()

GetIDEFromConf   conf_file  

Get the IDE (Vivado,Quartus,PlanAhead,Libero) version from the conf file she-bang

Parameters
[in]conf_fileThe hog.conf file

Definition at line 2073 of file hog.tcl.

◆ GetIDEName()

GetIDEName

Definition at line 2094 of file hog.tcl.

◆ GetIDEVersion()

GetIDEVersion

Returns the version of the IDE (Vivado,Quartus,PlanAhead,Libero) in use

Returns
the version in string format, e.g. 2020.2

Definition at line 2114 of file hog.tcl.

◆ GetLinkedFile()

GetLinkedFile   link_file  

Returns the real file linked by a soft link.

If the provided file is not a soft link, it will give a Warning and return an empty string. If the link is broken, will give a warning but still return the linked file

Parameters
[in]link_fileThe soft link file

Definition at line 2141 of file hog.tcl.

◆ GetMaxThreads()

GetMaxThreads   proj_dir  

Gets MAX number of Threads property from property.conf file in Top/$proj_name directory.

If property is not set returns default = 1

Parameters
[in]proj_dirthe top folder of the project
Returns
1 if property is not set else the value of MaxThreads

Definition at line 2178 of file hog.tcl.

◆ GetModifiedFiles()

GetModifiedFiles   ?repo_path? ?pattern?  

Get a list of all modified the files matching then pattern.

Parameters
[in]repo_paththe path of the git repository
[in]patternthe pattern with wildcards that files should match
Returns
a list of all modified files matching the pattern

Definition at line 2202 of file hog.tcl.

◆ GetModuleName()

GetModuleName   filename  

Definition at line 3209 of file hog.tcl.

◆ GetOptions()

GetOptions   argv parameters  

Definition at line 2214 of file hog.tcl.

◆ GetProjectFiles()

GetProjectFiles   ?project_file?  

@ brief Returns a list of 7 dictionaries: libraries, properties, constraints, and filesets for sources and simulations

The returned dictionaries are libraries, properties, simlibraries, constraints, srcsets, simsets, consets

  • libraries and simlibraries have the library name as keys and a list of filenames as values
  • properties has as file names as keys and a list of properties as values
  • constraints is a dictionary with a single key (sources.con) and a list of constraint files as value
  • srcsets is a dictionary with a fileset name as a key (e.g. sources_1) and a list of libraries as value
  • simsets is a dictionary with a simset name as a key (e.g. sim_1) and a list of libraries as value
  • consets is a dictionary with a constraints file sets name as a key (e.g. constr_1) and a list of constraint "libraries" (sources.con)

Files, libraries and properties are extracted from the current project

Parameters
[in]project_fileThe project file (for Libero and Diamond)
Returns
A list of 7 dictionaries: libraries, properties, constraints, and filesets for sources and simulations

Definition at line 2261 of file hog.tcl.

◆ GetProjectFlavour()

GetProjectFlavour   proj_name  

Get the Project flavour

Parameters
[in]proj_nameThe project name

Definition at line 2584 of file hog.tcl.

◆ GetProjectVersion()

GetProjectVersion   proj_dir repo_path ?ext_path? ?sim?  

Get the project version

Parameters
[in]proj_dirThe top folder of the project of which all the version must be calculated
[in]repo_pathThe top folder of the repository
[in]ext_pathpath for external libraries
[in]simif enabled, check the version also for the simulation files
Returns
returns the project version

Definition at line 2609 of file hog.tcl.

◆ GetRepoVersions()

GetRepoVersions   proj_dir repo_path ?ext_path? ?sim?  

Get the versions for all libraries, submodules, etc. for a given project

Parameters
[in]proj_dirThe project directory containing the conf file or the the tcl file
[in]repo_pathtop path of the repository
[in]ext_pathpath for external libraries
[in]simif enabled, check the version also for the simulation files
Returns
a list containing all the versions: global, top (hog.conf, pre and post tcl scripts, etc.), constraints, libraries, submodules, external, ipbus xml, user ip repos

Definition at line 2655 of file hog.tcl.

◆ GetSHA()

GetSHA   ?path?  

Get git SHA of a subset of list file.

Parameters
[in]paththe file/path or list of files/path the git SHA should be evaluated from. If is not set, use the current path
Returns
the value of the desired SHA

Definition at line 2895 of file hog.tcl.

◆ GetSimsetGenericsFromConf()

GetSimsetGenericsFromConf   proj_dir  

Gets all custom <simset>:generics from sim.conf.

Parameters
[in]proj_dirthe top folder of the project
Returns
nested dict with all <simset>:generics

Definition at line 1882 of file hog.tcl.

◆ GetSimulators()

GetSimulators

Returns the list of Simulators supported by Vivado.

Definition at line 2949 of file hog.tcl.

◆ GetTopFile()

GetTopFile

Return the path to the active top file.

Definition at line 2955 of file hog.tcl.

◆ GetTopModule()

GetTopModule

Return the name of the active top module.

Definition at line 2975 of file hog.tcl.

◆ GetVer()

GetVer   path ?force_develop?  

Get git version and commit hash of a subset of files.

Parameters
[in]pathlist file or path containing the subset of files whose latest commit hash will be returned
Returns
a list: the git SHA, the version in hex format

Definition at line 2989 of file hog.tcl.

◆ GetVerFromSHA()

GetVerFromSHA   SHA repo_path ?force_develop?  

Get git version and commit hash of a specific commit give the SHA.

Parameters
[in]SHAthe git SHA of the commit
[in]repo_paththe path of the repository, this is used to open the Top/repo.conf file
[in]force_developForce a tag for the develop branch (increase m)
Returns
a list: the git SHA, the version in hex format

Definition at line 3016 of file hog.tcl.

◆ GetVerilogGenerics()

GetVerilogGenerics   file  

Get a dictionary of verilog generics with their types for a given file

Parameters
[in]fileFile to read Generics from

Definition at line 3251 of file hog.tcl.

◆ GetVhdlGenerics()

GetVhdlGenerics   file ?entity?  

Get a dictionary of VHDL generics with their types for a given file

Parameters
[in]fileFile to read Generics from
[in]entityThe entity from which extracting the generics

Definition at line 3331 of file hog.tcl.

◆ Git()

Git   command ?files?  

Handle git commands.

Parameters
[in]commandthe git command to be run including refs (branch, tags, sha, etc.), except files.
[in]filesfiles given to git as argument. They will always be separated with – to avoid weird accidents
Returns
the output of the git command

Definition at line 3195 of file hog.tcl.

◆ GitRet()

GitRet   command ?files?  

Handle git commands without causing an error if ret is not 0.

It can be used with lassign like this: lassign [GitRet <git command> <possibly files> ] ret result

Parameters
[in]commandthe git command to be run including refs (branch, tags, sha, etc.), except files.
[in]filesfiles given to git as argument. They will always be separated with – to avoid weird accidents Sometimes you need to remove the –. To do that just set files to " "
Returns
a list of 2 elements: the return value (0 if no error occurred) and the output of the git command

Definition at line 3381 of file hog.tcl.

◆ GitVersion()

GitVersion   target_version  

Check git version installed in this machine.

Parameters
[in]target_versionthe version required by the current project
Returns
Returns 1, if the system git version is greater or equal to the target

Definition at line 3398 of file hog.tcl.

◆ HandleIP()

HandleIP   what_to_do xci_file ip_path repo_path ?gen_dir? ?force?  

Copy IP generated files from/to a remote o local directory (possibly EOS)

Parameters
[in]what_to_docan be "push", if you want to copy the local IP synth result to the remote directory or "pull" if you want to copy the files from thre remote directory to your local repository
[in]xci_filethe .xci file of the IP you want to handle
[in]ip_paththe path of the directory you want the IP to be saved (possibly EOS)
[in]repo_paththe main path of your repository
[in]gen_dirthe directory where generated files are placed, by default the files are placed in the same folder as the .xci
[in]forceif not set to 0, will copy the IP to the remote directory even if it is already present

Definition at line 3417 of file hog.tcl.

◆ HexVersionToString()

HexVersionToString   version  

Convert hex version to M.m.p string

Parameters
[in]versionthe version (in 32-bit hexadecimal format 0xMMmmpppp) to be converted
Returns
a string containing the version in M.m.p format

Definition at line 3595 of file hog.tcl.

◆ ImportTclLib()

ImportTclLib

Definition at line 3603 of file hog.tcl.

◆ InitLauncher()

InitLauncher   script tcl_path parameters usage argv  

Definition at line 3622 of file hog.tcl.

◆ IsCommitAncestor()

IsCommitAncestor   ancestor commit  

Definition at line 3742 of file hog.tcl.

◆ IsDiamond()

IsDiamond

Definition at line 3751 of file hog.tcl.

◆ IsInList()

IsInList   element list ?regex?  

Definition at line 3765 of file hog.tcl.

◆ IsISE()

IsISE

Returns true, if the IDE is ISE/PlanAhead.

Definition at line 3778 of file hog.tcl.

◆ IsLibero()

IsLibero

Returns true if the IDE is MicroSemi Libero.

Definition at line 3756 of file hog.tcl.

◆ IsQuartus()

IsQuartus

Returns true, if IDE is Quartus.

Definition at line 3787 of file hog.tcl.

◆ IsRelativePath()

IsRelativePath   path  

Check if a path is absolute or relative

Parameters
[in]thepath to check

Definition at line 3795 of file hog.tcl.

◆ IsSynplify()

IsSynplify

Returns true if the Synthesis tool is Synplify.

Definition at line 3804 of file hog.tcl.

◆ IsTclsh()

IsTclsh

Returns true, if we are in tclsh.

Definition at line 3809 of file hog.tcl.

◆ IsVersal()

IsVersal   part  

Find out if the given Xilinx part is a Vesal chip.

Parameters
[out]1if it's Versal 0 if it's not
[in]partThe FPGA part

Definition at line 3818 of file hog.tcl.

◆ IsVivado()

IsVivado

Returns true, if the IDE is Vivado.

Definition at line 3827 of file hog.tcl.

◆ IsXilinx()

IsXilinx

Return true, if the IDE is Xilinx (Vivado or ISE)

Definition at line 3836 of file hog.tcl.

◆ IsZynq()

IsZynq   part  

Find out if the given Xilinx part is a Vesal chip.

Parameters
[out]1if it's Zynq 0 if it's not
[in]partThe FPGA part

Definition at line 3845 of file hog.tcl.

◆ LaunchImplementation()

LaunchImplementation   reset do_create run_folder project_name ?repo_path? ?njobs? ?do_bitstream?  

Definition at line 3861 of file hog.tcl.

◆ LaunchSimulation()

LaunchSimulation   project_name lib_path ?simsets? ?repo_path?  

Definition at line 4116 of file hog.tcl.

◆ LaunchSynthesis()

LaunchSynthesis   reset do_create run_folder project_name ?repo_path? ?ext_path? ?njobs?  

Definition at line 4357 of file hog.tcl.

◆ ListProjects()

ListProjects   ?repo_path? ?print? ?ret_conf?  

Definition at line 4489 of file hog.tcl.

◆ Logo()

Logo   ?repo_path?  

Definition at line 4534 of file hog.tcl.

◆ Md5Sum()

Md5Sum   file_name  

Evaluates the md5 sum of a file.

Parameters
[in]file_namethe name of the file of which you want to evaluate the md5 checksum

Definition at line 4565 of file hog.tcl.

◆ MergeDict()

MergeDict   dict0 dict1  

Merges two tcl dictionaries of lists.

If the dictionaries contain same keys, the list at the common key is a merging of the two

Parameters
[in]dict0the name of the first dictionary
[in]dict1the name of the second dictionary
Returns
the merged dictionary

Definition at line 4587 of file hog.tcl.

◆ MoveElementToEnd()

MoveElementToEnd   inputList element  

Definition at line 4607 of file hog.tcl.

◆ Msg()

Msg   level msg ?title?  

The Hog Printout Msg function.

Parameters
[in]levelThe severity level (status, info, warning, critical, error, debug)
[in]msgThe message to print
[in]titleThe title string to be included in the header of the message [Hog:$title] (default "")

Definition at line 4621 of file hog.tcl.

◆ MsgAndLog()

MsgAndLog   msg ?severity? ?outFile?  

Prints a message with selected severity and optionally write into a log file.

Parameters
[in]msgThe message to print
[in]severityThe severity of the message
[in]outFileThe path of the output logfile

Definition at line 4685 of file hog.tcl.

◆ OpenProject()

OpenProject   project_file repo_path  

Definition at line 4698 of file hog.tcl.

◆ OS()

OS

Return the operative system name.

Definition at line 4727 of file hog.tcl.

◆ ParseJSON()

ParseJSON   JSON_FILE JSON_KEY  

Parse JSON file.

Parameters
[in]JSON_FILEThe JSON File to parse
[in]JSON_KEYThe key to extract from the JSON file
Returns
-1 in case of failure, JSON KEY VALUE in case of success

Definition at line 4739 of file hog.tcl.

◆ ProjectExists()

ProjectExists   project ?repo_path?  

Definition at line 4766 of file hog.tcl.

◆ ReadConf()

ReadConf   file_name  

Read a property configuration file and returns a dictionary

Parameters
[in]file_namethe configuration file
Returns
The dictionary

Definition at line 4783 of file hog.tcl.

◆ ReadExtraFileList()

ReadExtraFileList   extra_file_name  

Function used to read the list of files generated at creation time by tcl scripts in Project/proj/.hog/extra.files.

Parameters
[in]extra_file_namethe path to the extra.files file
Returns
a dictionary with the full name of the files as key and a SHA as value

Definition at line 4815 of file hog.tcl.

◆ ReadListFile()

ReadListFile   args  

Read a list file and return a list of three dictionaries.

Additional information is provided with text separated from the file name with one or more spaces

Parameters
[in]argsThe arguments are <list_file> <path> [options]
  • list_file file containing vhdl list with optional properties
  • path path the vhdl file are referred to in the list file Options:
  • -lib <library> name of the library files will be added to, if not given will be extracted from the file name
  • -sha_mode if not set to 0, the list files will be added as well and the IPs will be added to the file rather than to the special ip library. The SHA mode should be used when you use the lists to calculate the git SHA, rather than to add the files to the project.
Returns
a list of 3 dictionaries: "libraries" has library name as keys and a list of filenames as values, "properties" has as file names as keys and a list of properties as values, "filesets" has the fileset' names as keys and the list of associated libraries as values.

Definition at line 4845 of file hog.tcl.

◆ Relative()

Relative   base dst  

Returns the destination path relative to base.

Parameters
[in]basethe path with respect to witch the dst path is calculated
[in]dstthe path to be calculated with respect to base

Definition at line 5053 of file hog.tcl.

◆ RelativeLocal()

RelativeLocal   pathName filePath  

Returns the path of filePath relative to pathName.

Parameters
[in]pathNamethe path with respect to which the returned path is calculated
[in]filePaththe path of filePath

Definition at line 5093 of file hog.tcl.

◆ RemoveDuplicates()

RemoveDuplicates   mydict  

Remove duplicates in a dictionary.

Parameters
[in]mydictthe input dictionary
Returns
the dictionary stripped of duplicates

Definition at line 5106 of file hog.tcl.

◆ ResetRepoFiles()

ResetRepoFiles   reset_file  

Reset files in the repository

Parameters
[in]reset_filea file containing a list of files separated by new lines or spaces (Hog-CI creates such a file in Projects/hog_reset_files)
Returns
Nothing

Definition at line 5127 of file hog.tcl.

◆ RestoreModifiedFiles()

RestoreModifiedFiles   ?repo_path? ?pattern?  

Restore with checkout – the files specified in pattern.

Parameters
[in]repo_paththe path of the git repository
[in]patternthe pattern with wildcards that files should match

Definition at line 5151 of file hog.tcl.

◆ SearchHogProjects()

SearchHogProjects   dir  

Search the Hog projects inside a directory

Parameters
[in]dirThe directory to search
Returns
The list of projects

Definition at line 5165 of file hog.tcl.

◆ SetGenericsSimulation()

SetGenericsSimulation   repo_path proj_dir target  

Sets the generics in all the sim.conf simulation file sets.

Parameters
[in]repo_paththe top folder of the projectThe path to the main git repository
[in]proj_dirthe top folder of the project
[in]targetsoftware target(vivado, questa)

Definition at line 5198 of file hog.tcl.

◆ SetTopProperty()

SetTopProperty   top_module fileset  

set the top module as top module in the chosen fileset

It automatically recognises the IDE

Parameters
[out]top_moduleName of the top module
[in]filesetThe name of the fileset

Definition at line 5245 of file hog.tcl.

◆ VIVADO_PATH_PROPERTIES()

VIVADO_PATH_PROPERTIES

Returns a list of Vivado properties that expect a PATH for value.

Definition at line 5261 of file hog.tcl.

◆ WriteConf()

WriteConf   file_name config ?comment?  

Write a property configuration file from a dictionary.

Parameters
[in]file_namethe configuration file
[in]configthe configuration dictionary
[in]commentcomment to add at the beginning of configuration file

Definition at line 5272 of file hog.tcl.

◆ WriteGenerics()

WriteGenerics   mode repo_path design date timee commit version top_hash top_ver hog_hash hog_ver cons_ver cons_hash libs vers hashes ext_names ext_hashes user_ip_repos user_ip_vers user_ip_hashes flavour ?xml_ver? ?xml_hash?  

Set the generics property

Parameters
[in]modeif it's "create", the function will assume the project is being created
[in]repo_pathThe path to the main git repository
[in]designThe name of the design

Definition at line 5310 of file hog.tcl.

◆ WriteGenericsToBdIPs()

WriteGenericsToBdIPs   mode repo_path proj generic_string  

Applies generic values to IPs within block designs.

Parameters
[in]modecreate: to write the generics at creation time. synth to write at synthesis time
[in]repo_pathThe main path of the git repository
[in]projThe project name
[in]generic_stringthe string containing the generics to be applied

Definition at line 5423 of file hog.tcl.

◆ WriteGitLabCIYAML()

WriteGitLabCIYAML   proj_name ?ci_conf?  

Returns the gitlab-ci.yml snippet for a CI stage and a defined project.

Parameters
[in]proj_nameThe project name
[in]ci_confsDictionary with CI configurations

Definition at line 5635 of file hog.tcl.

◆ WriteListFiles()

WriteListFiles   libs props list_path repo_path ?$ext_path?  

Definition at line 5715 of file hog.tcl.

◆ WriteSimListFiles()

WriteSimListFiles   libs props simsets list_path repo_path  

Definition at line 5751 of file hog.tcl.

◆ WriteToFile()

WriteToFile   File msg  

Write into a file, and if the file exists, it will append the string.

Parameters
[out]FileThe log file to write into the message
[in]msgThe message text

Definition at line 5783 of file hog.tcl.

◆ WriteUtilizationSummary()

WriteUtilizationSummary   input output project_name run  

Write the resource utilization table into a a file (Vivado only)

Parameters
[in]inputthe input .rpt report file from Vivado
[in]outputthe output file
[in]project_namethe name of the project
[in]runsynthesis or implementation

Definition at line 5795 of file hog.tcl.