Hog v9.50.0
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 constraints simlibraries
 
 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...
 
 DictSort dict args
 
 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...
 
 ExtractFilesSection file_data
 Extract the [files] section from a sim list file. 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
 Gets custom generics from hog. More...
 
 GetSimSets project_name repo_path ?simsets? ?ghdl? ?no_conf?
 Gets the simulation sets from the project. 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?
 
 GHDL command
 Runs a GHDL command and returns its output and exit state. More...
 
 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 commands argv ?custom_commands?
 
 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...
 
 ImportGHDL project_name repo_path simset_name simset_dict ?ext_path?
 
 LaunchGHDL project_name repo_path simset_name simset_dict ?ext_path?
 
 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 ?remove_duplicates?
 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...
 
 PrintFileTree data repo_path ?indentation?
 
 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
 
 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?
 
 WriteSimListFile simset libs props simsets list_path repo_path ?force?
 
 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 540 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 567 of file hog.tcl.

◆ CheckExtraFiles()

CheckExtraFiles   libraries constraints simlibraries  

Definition at line 692 of file hog.tcl.

◆ CheckLatestHogRelease()

CheckLatestHogRelease   ?repo_path?  

Definition at line 754 of file hog.tcl.

◆ CheckSyntax()

CheckSyntax   project_name repo_path ?project_file?  

Definition at line 582 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 803 of file hog.tcl.

◆ CloseProject()

CloseProject

Definition at line 624 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 932 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 646 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 1057 of file hog.tcl.

◆ Copy()

Copy   i_dirs o_dir  

Definition at line 1095 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 1118 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 1262 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 1287 of file hog.tcl.

◆ DictSort()

DictSort   dict args  

Sorts a dictionary

Parameters
[in]dictthe dictionary
[in]argsthe arguments to pass to lsort, e.g. -ascii, -dictionary, -decreasing
Returns
a new dictionary with the keys sorted according to the arguments

Definition at line 1300 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 1313 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 1332 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 1364 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 1382 of file hog.tcl.

◆ ExtractFilesSection()

ExtractFilesSection   file_data  

Extract the [files] section from a sim list file.

Parameters
[in]thecontent of the simulation list file to extract the [files] section from
Returns
a list of files in the [files] section, or all lines if no [files] section is found

Definition at line 1399 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 1431 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 1453 of file hog.tcl.

◆ FindCommonGitChild()

FindCommonGitChild   SHA1 SHA2  

Definition at line 1470 of file hog.tcl.

◆ findFiles()

findFiles   basedir pattern  

Definition at line 1493 of file hog.tcl.

◆ FindFileType()

FindFileType   file_name  
Returns
FILE_TYPE the file Type

Definition at line 1525 of file hog.tcl.

◆ FindNewestVersion()

FindNewestVersion   versions  

Definition at line 1594 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 1610 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 1631 of file hog.tcl.

◆ GenerateBitstream()

GenerateBitstream   ?run_folder? ?repo_path? ?njobs?  

Definition at line 1646 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 1676 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 1739 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 1794 of file hog.tcl.

◆ GetCustomCommands()

GetCustomCommands   ?directory? ?ret_commands?  

Definition at line 1813 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 1854 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 1877 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 1899 of file hog.tcl.

◆ GetGenericFormatFromXci()

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

Definition at line 5999 of file hog.tcl.

◆ GetGenericFormatFromXciXML()

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

Definition at line 5968 of file hog.tcl.

◆ GetGenericsFromConf()

GetGenericsFromConf   proj_dir  

Gets custom generics from hog.

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

Definition at line 1915 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 2051 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 2077 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 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 2103 of file hog.tcl.

◆ GetIDECommand()

GetIDECommand   proj_conf  

Definition at line 2173 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 2231 of file hog.tcl.

◆ GetIDEName()

GetIDEName

Definition at line 2252 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 2272 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 2299 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 2336 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 2360 of file hog.tcl.

◆ GetModuleName()

GetModuleName   filename  

Definition at line 3368 of file hog.tcl.

◆ GetOptions()

GetOptions   argv parameters  

Definition at line 2372 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 2419 of file hog.tcl.

◆ GetProjectFlavour()

GetProjectFlavour   proj_name  

Get the Project flavour

Parameters
[in]proj_nameThe project name

Definition at line 2743 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 2768 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 2814 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 3054 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 2027 of file hog.tcl.

◆ GetSimSets()

GetSimSets   project_name repo_path ?simsets? ?ghdl? ?no_conf?  

Gets the simulation sets from the project.

Parameters
[in]project_namethe name of the project
[in]repo_paththe path to the repository
[in]simsetsa list of simulation sets to retrieve (default: all)
[in]ghdlif 1, only GHDL simulation sets are returned (default: 0), otherwise only non-GHDL simulation sets are returned
[in]no_confif 1, the simulation sets are returned without reading the sim.conf file (default: 0)
Returns
a dictionary with the simulation sets, where the keys are the simulation set names and the values are dictionaries with the properties of each simulation set

Definition at line 1942 of file hog.tcl.

◆ GetSimulators()

GetSimulators

Returns the list of Simulators supported by Vivado.

Definition at line 3108 of file hog.tcl.

◆ GetTopFile()

GetTopFile

Return the path to the active top file.

Definition at line 3114 of file hog.tcl.

◆ GetTopModule()

GetTopModule

Return the name of the active top module.

Definition at line 3134 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 3148 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 3175 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 3410 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 3490 of file hog.tcl.

◆ GHDL()

GHDL   command  

Runs a GHDL command and returns its output and exit state.

Definition at line 3532 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 3354 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 3549 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 3564 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 3583 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 3761 of file hog.tcl.

◆ ImportGHDL()

ImportGHDL   project_name repo_path simset_name simset_dict ?ext_path?  

Definition at line 4133 of file hog.tcl.

◆ ImportTclLib()

ImportTclLib

Definition at line 3769 of file hog.tcl.

◆ InitLauncher()

InitLauncher   script tcl_path parameters commands argv ?custom_commands?  

Definition at line 3790 of file hog.tcl.

◆ IsCommitAncestor()

IsCommitAncestor   ancestor commit  

Definition at line 4006 of file hog.tcl.

◆ IsDiamond()

IsDiamond

Definition at line 4015 of file hog.tcl.

◆ IsInList()

IsInList   element list ?regex?  

Definition at line 4029 of file hog.tcl.

◆ IsISE()

IsISE

Returns true, if the IDE is ISE/PlanAhead.

Definition at line 4042 of file hog.tcl.

◆ IsLibero()

IsLibero

Returns true if the IDE is MicroSemi Libero.

Definition at line 4020 of file hog.tcl.

◆ IsQuartus()

IsQuartus

Returns true, if IDE is Quartus.

Definition at line 4051 of file hog.tcl.

◆ IsRelativePath()

IsRelativePath   path  

Check if a path is absolute or relative

Parameters
[in]thepath to check

Definition at line 4065 of file hog.tcl.

◆ IsSynplify()

IsSynplify

Returns true if the Synthesis tool is Synplify.

Definition at line 4074 of file hog.tcl.

◆ IsTclsh()

IsTclsh

Returns true, if we are in tclsh.

Definition at line 4079 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 4088 of file hog.tcl.

◆ IsVivado()

IsVivado

Returns true, if the IDE is Vivado.

Definition at line 4097 of file hog.tcl.

◆ IsXilinx()

IsXilinx

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

Definition at line 4106 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 4125 of file hog.tcl.

◆ LaunchGHDL()

LaunchGHDL   project_name repo_path simset_name simset_dict ?ext_path?  

Definition at line 4163 of file hog.tcl.

◆ LaunchImplementation()

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

Definition at line 4195 of file hog.tcl.

◆ LaunchSimulation()

LaunchSimulation   project_name lib_path simsets ?repo_path?  

Definition at line 4459 of file hog.tcl.

◆ LaunchSynthesis()

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

Definition at line 4680 of file hog.tcl.

◆ ListProjects()

ListProjects   ?repo_path? ?print? ?ret_conf?  

Definition at line 4820 of file hog.tcl.

◆ Logo()

Logo   ?repo_path?  

Definition at line 4865 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 4909 of file hog.tcl.

◆ MergeDict()

MergeDict   dict0 dict1 ?remove_duplicates?  

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
[in]remove_duplicatesif 1, removes duplicates from the merged dictionary (default 1)
Returns
the merged dictionary

Definition at line 4932 of file hog.tcl.

◆ MoveElementToEnd()

MoveElementToEnd   inputList element  

Definition at line 4953 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 4967 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 5031 of file hog.tcl.

◆ OpenProject()

OpenProject   project_file repo_path  

Definition at line 5050 of file hog.tcl.

◆ OS()

OS

Return the operative system name.

Definition at line 5079 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 5091 of file hog.tcl.

◆ PrintFileTree()

PrintFileTree   data repo_path ?indentation?  

Print a tree-like structure of Hog list file content

Parameters
[in]datathe list of lines read from a list file
[in]repo_paththe path of the repository
[in]indentationa string containing a number of spaces to indent the tree

Definition at line 5118 of file hog.tcl.

◆ ProjectExists()

ProjectExists   project ?repo_path?  

Definition at line 5154 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 5171 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 5206 of file hog.tcl.

◆ ReadListFile()

ReadListFile   args  

Definition at line 5238 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 5474 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 5514 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 5527 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 5548 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 5572 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 5586 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 5619 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 5650 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 5666 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 5677 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 5717 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 5830 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 6042 of file hog.tcl.

◆ WriteListFiles()

WriteListFiles   libs props list_path repo_path ?ext_path?  

Definition at line 6122 of file hog.tcl.

◆ WriteSimListFile()

WriteSimListFile   simset libs props simsets list_path repo_path ?force?  

Definition at line 6160 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 6201 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 6213 of file hog.tcl.