Hog v9.3.0
hog.tcl File Reference

Collection of Tcl functions used in Vivado/Quartus scripts. More...

Go to the source code of this file.

Functions

 ALLOWED_PROPS
 
 GetSimulators
 
 IsLibero
 
 IsSynplify
 
 IsXilinx
 
 IsVivado
 
 IsISE
 
 IsQuartus
 
 IsTclsh
 
 IsVersal part
 Find out if the given Xilinx part is a Vesal chip. More...
 
 IsZynq part
 Find out if the given Xilinx part is a Vesal chip. More...
 
 BinaryStepName part
 # Returns the step name for the stage that produces the binary file More...
 
 Msg level msg ?title?
 
 WriteToFile File msg
 Write a into file, if the file exists, it will append the string. More...
 
 SetProperty property value object
 Sets a property of an object to a given value. More...
 
 GetProperty property object
 Retrieves the value of a property of an object. More...
 
 SetParameter parameter value
 Sets the value of a parameter to a given value. More...
 
 AddTopFile top_module top_file sources
 Adds the file containing the top module to the project. More...
 
 SetTopProperty top_module sources
 set the top module as top module. More...
 
 GetProject proj
 Retrieves the project named proj. More...
 
 GetRun run
 Gets a list of synthesis and implementation runs in the current project that match a run (passed as parameter) More...
 
 GetFile file
 Gets a list of files contained in the current project that match a file name (passed as parameter) More...
 
 CreateFileSet fileset
 Creates a new fileset. More...
 
 GetFileSet fileset
 Retrieves a fileset. More...
 
 AddFile file fileset
 Add a new file to a fileset. More...
 
 GetRepoPath
 gets the full path to the /../../ folder More...
 
 CompareVersions ver1 ver2
 Compare two semantic versions. More...
 
 GitVersion target_version
 Check git version installed in this machine. More...
 
 DoxygenVersion target_version
 Checks doxygen version installed in this machine. More...
 
 FindFileType file_name
 
 FindVhdlVersion file_name
 Set VHDL version to 2008 for *.vhd files. More...
 
 ReadListFile args
 Read a list file and adds the files to Vivado/Quartus, adding the additional information as file type. More...
 
 OS
 Return operative sistem. More...
 
 GetLinkedFile link_file
 Return the real file linked by a soft link. More...
 
 MergeDict dict0 dict1
 Merge two tcl dictionaries of lists. More...
 
 DictGet dictName keyName ?default?
 Gets key from dict and returns default if key not found. More...
 
 GetHashLib lib
 Get git SHA of a vivado library. More...
 
 GetModifiedFiles ?repo_path? ?pattern?
 Get a list of all modified the files matching then pattern. More...
 
 RestoreModifiedFiles ?repo_path? ?pattern?
 Restore with checkout – the files specified in pattern. More...
 
 GetFileList FILE path
 Recursively gets file names from list file. More...
 
 GetSHA ?path?
 Get git SHA of a subset of list file. 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...
 
 GetProjectVersion proj_dir repo_path ?ext_path? ?sim?
 
 GetHogDescribe sha ?repo_path?
 
 GetSubmodule path_file
 
 GetConfFiles proj_dir
 
 GetRepoVersions proj_dir repo_path ?ext_path? ?sim?
 
 HexVersionToString version
 
 ExtractVersionFromTag tag
 Tags the repository with a new version calculated on the basis of the previous tags. More...
 
 CopyIPbusXMLs proj_dir path dst ?xml_version? ?xml_sha? ?generate?
 Read a XML list file and copy files to destination. More...
 
 CompareVHDL file1 file2
 Compare two VHDL files ignoring spaces and comments. More...
 
 Relative base dst
 Returns the dst path relative to base. More...
 
 RelativeLocal pathName filePath
 Returns the path of filePath relative to pathName. More...
 
 MsgAndLog msg ?severity? ?outFile?
 Prints a message with selected severity and optionally write into a log file. More...
 
 GetProjectFiles
 
 GetHogFiles args
 Extract files, libraries and properties from the project's list files. More...
 
 ParseFirstLineHogFiles list_path list_file
 Parse possible commands in the first line of Hog files (e.g. #Vivado, #Simulator, etc) More...
 
 AddHogFiles libraries properties filesets
 Add libraries and properties to Vivado/Quartus project. More...
 
 CheckExtraFiles libraries
 
 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...
 
 GenerateQsysSystem qsysFile commandOpts
 Function used to generate a qsys system from a .qsys file. The procedure adds the generated IPs to the project. More...
 
 ForceUpToDate
 Forces all the Vivado runs to look up to date, useful before write bitstream. More...
 
 HandleIP what_to_do xci_file ip_path repo_path ?gen_dir? ?force?
 Copy IP generated files from/to a remote o local direcotry (possibly EOS) More...
 
 Md5Sum file_name
 Evaluates the md5 sum of a file. More...
 
 CheckYmlRef repo_path allow_failure
 Checks that "ref" in .gitlab-ci.yml actually matches the hog.yml file in the. More...
 
 ParseJSON JSON_FILE JSON_KEY
 Parse JSON file. More...
 
 eos command ?attempt?
 Handle eos commands. More...
 
 Git command ?files?
 Handle git commands. More...
 
 GitRet command ?files?
 Handle git commands without causing an error if ret is not 0. More...
 
 FileCommitted File
 Checks if file was committed into the repository. More...
 
 ExecuteRet args
 Handle shell commands. More...
 
 Execute args
 Handle shell commands. More...
 
 GetMaxThreads proj_dir
 Gets MAX number of Threads property from property.conf file in Top/$proj_name directory. More...
 
 WriteGitLabCIYAML proj_name ?ci_conf?
 Returns the gitlab-ci.yml snippet for a CI stage and a defined project. More...
 
 FindNewestVersion versions
 
 ResetRepoFiles reset_file
 
 SearchHogProjects dir
 
 GetGroupName proj_dir repo_dir
 
 ReadConf file_name
 
 WriteConf file_name config ?comment?
 
 IsRelativePath path
 
 WriteUtilizationSummary input output project_name run
 
 GetDateAndTime commit
 
 GetProjectFlavour proj_name
 
 FormatGeneric generic
 
 GetGenericFromConf proj_dir target ?sim?
 Gets custom generics from hog.conf. More...
 
 SetGenericsSimulation repo_path proj_dir target
 Sets the generics in all the sim.conf simulation file sets. More...
 
 GetTopFile
 Return the path to the active top file. More...
 
 GetTopModule
 Return the name of the active top module. More...
 
 GetVerilogGenerics file
 
 GetVhdlGenerics file ?entity?
 
 GetFileGenerics filename ?entity?
 
 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?
 
 GetIDEVersion
 
 GetIDEFromConf conf_file
 
 Mkdir dir
 
 Copy i_dirs o_dir
 
 RemoveDuplicates mydict
 Remove duplicates in a dictionary. More...
 
 CompareLibDicts proj_libs list_libs proj_sets list_sets proj_props list_props ?severity? ?outFile? ?extraFiles?
 Compare the contents of two dictionaries. More...
 
 WriteSimListFiles libs props simsets list_path repo_path
 
 WriteListFiles libs props list_path repo_path ? $ext_path?
 
 RemoveEmptyKeys d
 
 Logo ?repo_path?
 
 CheckLatestHogRelease ?repo_path?
 
 GetOptions argv parameters usage
 
 InitLauncher script tcl_path parameters usage argv
 
 GetCustomCommands ?directory? ?ret_commands?
 
 ListProjects ?repo_path? ?print? ?ret_conf?
 
 ProjectExists project ?repo_path?
 
 GetIDECommand proj_conf
 
 findFiles basedir pattern
 
 IsInList element list
 
 IsCommitAncestor ancestor commit
 
 FindCommonGitChild SHA1 SHA2
 
 moveElementToEnd inputList element
 

Detailed Description

Collection of Tcl functions used in Vivado/Quartus scripts.

Definition in file hog.tcl.

Function Documentation

◆ AddFile()

AddFile   file fileset  

Add a new file to a fileset.

Parameters
[in]filename of the files to add. NOTE: directories are not supported.
[in]filesetfileset name

Definition at line 421 of file hog.tcl.

◆ AddHogFiles()

AddHogFiles   libraries properties filesets  

Add libraries and properties to Vivado/Quartus 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

Definition at line 2173 of file hog.tcl.

◆ AddTopFile()

AddTopFile   top_module top_file sources  

Adds the file containing the top module to the project.

It automatically recognises whether it is in Vivado or Quartus mode

Parameters
[in]top_modulename of the top module, expected top_<project_name>
[in]top_filename of the file containing the top module
[in]sourceslist of source files

Definition at line 280 of file hog.tcl.

◆ ALLOWED_PROPS()

ALLOWED_PROPS

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

◆ CheckExtraFiles()

CheckExtraFiles   libraries  

Definition at line 2626 of file hog.tcl.

◆ CheckLatestHogRelease()

CheckLatestHogRelease   ?repo_path?  

Definition at line 4354 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 2964 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 4123 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 vormat 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
Return 1 ver1 is greather than ver2, 0 if they are equal, and -1 if ver2 is greater than ver1

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

◆ Copy()

Copy   i_dirs o_dir  

Definition at line 4076 of file hog.tcl.

◆ CopyIPbusXMLs()

CopyIPbusXMLs   proj_dir path dst ?xml_version? ?xml_sha? ?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]generateif set to 1, tells the function to generate the VHDL decode address files rather than check them

Definition at line 1668 of file hog.tcl.

◆ CreateFileSet()

CreateFileSet   fileset  

Creates a new fileset.

A file set is a list of files with a specific function within the project.

Parameters
[in]fileset
Returns
The create_fileset command returns the name of the newly created fileset

Definition at line 397 of file hog.tcl.

◆ DictGet()

DictGet   dictName keyName ?default?  

Gets key from dict and returns default if key not found.

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
Returns
the dictionary key value

Definition at line 900 of file hog.tcl.

◆ DoxygenVersion()

DoxygenVersion   target_version  

Checks doxygen version installed in this machine.

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

Definition at line 507 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 3113 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 3222 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 3202 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 1642 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 3181 of file hog.tcl.

◆ FindCommonGitChild()

FindCommonGitChild   SHA1 SHA2  

Definition at line 4702 of file hog.tcl.

◆ findFiles()

findFiles   basedir pattern  

Definition at line 4655 of file hog.tcl.

◆ FindFileType()

FindFileType   file_name  
Returns
FILE_TYPE the file Type

Definition at line 522 of file hog.tcl.

◆ FindNewestVersion()

FindNewestVersion   versions  

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

◆ ForceUpToDate()

ForceUpToDate

Forces all the Vivado runs to look up to date, useful before write bitstream.

Definition at line 2751 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 3625 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 2692 of file hog.tcl.

◆ GetConfFiles()

GetConfFiles   proj_dir  

Get the configuration files to create a vivado/quartus 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 1365 of file hog.tcl.

◆ GetCustomCommands()

GetCustomCommands   ?directory? ?ret_commands?  

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

◆ GetFile()

GetFile   file  

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

The file name is matched against the input parameter. IF no parameter if passed returns a list of all files in the project

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

Definition at line 371 of file hog.tcl.

◆ GetFileGenerics()

GetFileGenerics   filename ?entity?  

Definition at line 3894 of file hog.tcl.

◆ GetFileList()

GetFileList   FILE path  

Recursively gets file names from list file.

If the list file contains files with extension .src .sim .con, it will recursively open them

Parameters
[in]FILElist file to open
[in]paththe path the files are referred to in the list file
Returns
a list of the files contained in the list file

Definition at line 965 of file hog.tcl.

◆ GetFileSet()

GetFileSet   fileset  

Retrieves a fileset.

Gets a list of filesets in the current project that match a specified search pattern. The default command gets a list of all filesets in the project.

Parameters
[in]filesetthe name to be checked
Returns
a list of filesets in the current project that match the specified search pattern.

Definition at line 411 of file hog.tcl.

◆ GetGenericFromConf()

GetGenericFromConf   proj_dir target ?sim?  

Gets custom generics from hog.conf.

Parameters
[in]proj_dirthe top folder of the project
[in]targetsoftware target(vivado, questa) defines the output format of the string
Returns
string with generics

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

◆ GetHashLib()

GetHashLib   lib  

Get git SHA of a vivado library.

If the special string "ALL" is used, returns the global hash

Parameters
[in]libthe name of the library whose latest commit hash will be returned
Returns
the git SHA of the specified library

Definition at line 916 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 1312 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 filset name as keys and the correspondent list of libraries as values (significant only for simulations)

Definition at line 2081 of file hog.tcl.

◆ GetIDECommand()

GetIDECommand   proj_conf  

Definition at line 4605 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 4036 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 4016 of file hog.tcl.

◆ GetLinkedFile()

GetLinkedFile   link_file  

Return the real file linked by a soft link.

If the provided file is not a soft link, 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 837 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 3241 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 matchin the pattern

Definition at line 935 of file hog.tcl.

◆ GetOptions()

GetOptions   argv parameters usage  

Definition at line 4399 of file hog.tcl.

◆ GetProject()

GetProject   proj  

Retrieves the project named proj.

It automatically recognises whether it is in Vivado or Quartus mode

Parameters
[in]projthe project name
Returns
the project $proj

Definition at line 323 of file hog.tcl.

◆ GetProjectFiles()

GetProjectFiles

@ brief Returns a list of 2 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

Files, libraries and properties are extracted from the current Vivado project

Returns
a list of two elements. The first element is a dictionary containing all libraries. The second elements is a discretionary containing all properties

Definition at line 1909 of file hog.tcl.

◆ GetProjectFlavour()

GetProjectFlavour   proj_name  

Get the Project flavour

Parameters
[in]proj_nameThe project name

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

◆ GetProperty()

GetProperty   property object  

Retrieves the value of a property of an object.

It automatically recognises whether it is in Vivado or Quartus mode

Parameters
[in]propertythe name of the property to be retrieved
[in]objectthe object from which to retrieve the property
Returns
the value of object.property

Definition at line 247 of file hog.tcl.

◆ GetRepoPath()

GetRepoPath

gets the full path to the /../../ folder

Returns
"[file normalize [file dirname [info script]]]/../../"

Definition at line 429 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 scrpts, etc.), constraints, libraries, submodules, external, ipbus xml, user ip repos

Definition at line 1387 of file hog.tcl.

◆ GetRun()

GetRun   run  

Gets a list of synthesis and implementation runs in the current project that match a run (passed as parameter)

The run name is matched against the input parameter

Parameters
[in]runthe run identifier
Returns
a list of synthesis and implementation runs matching the parameter

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

◆ GetSimulators()

GetSimulators

Definition at line 47 of file hog.tcl.

◆ GetSubmodule()

GetSubmodule   path_file  

Get submodule of a specific file. Returns an empty string if the file is not in a submodule

Parameters
[in]path_filepath of the file that whose paternity must be checked
Returns
The path of the submodule. Returns an empty string if not in a submodule.

Definition at line 1332 of file hog.tcl.

◆ GetTopFile()

GetTopFile

Return the path to the active top file.

Definition at line 3743 of file hog.tcl.

◆ GetTopModule()

GetTopModule

Return the name of the active top module.

Definition at line 3763 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 1059 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 1086 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 3774 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

Definition at line 3851 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 3145 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 3163 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
Return 1 if the system git version is greater or equal to the target

Definition at line 491 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 direcotry (possibly EOS)

Parameters
[in]what_to_docan be "push", if you want to copy the local IP synth result to the remote direcyory 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 2770 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 1629 of file hog.tcl.

◆ InitLauncher()

InitLauncher   script tcl_path parameters usage argv  

Definition at line 4431 of file hog.tcl.

◆ IsCommitAncestor()

IsCommitAncestor   ancestor commit  

Definition at line 4693 of file hog.tcl.

◆ IsInList()

IsInList   element list  

Definition at line 4684 of file hog.tcl.

◆ IsISE()

IsISE

Get whether the IDE is ISE (planAhead)

Definition at line 78 of file hog.tcl.

◆ IsLibero()

IsLibero

Get whether the IDE is MicroSemi Libero

Definition at line 53 of file hog.tcl.

◆ IsQuartus()

IsQuartus

Get whether the IDE is Quartus

Definition at line 87 of file hog.tcl.

◆ IsRelativePath()

IsRelativePath   path  

Check if a path is absolute or relative

Parameters
[in]thepath to check

Definition at line 3508 of file hog.tcl.

◆ IsSynplify()

IsSynplify

Definition at line 58 of file hog.tcl.

◆ IsTclsh()

IsTclsh

Get whether we are in tclsh

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

◆ IsVivado()

IsVivado

Get whether the IDE is vivado

Definition at line 69 of file hog.tcl.

◆ IsXilinx()

IsXilinx

Get whether the IDE is Xilinx (Vivado or ISE)

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

◆ ListProjects()

ListProjects   ?repo_path? ?print? ?ret_conf?  

Definition at line 4566 of file hog.tcl.

◆ Logo()

Logo   ?repo_path?  

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

◆ MergeDict()

MergeDict   dict0 dict1  

Merge 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 876 of file hog.tcl.

◆ Mkdir()

Mkdir   dir  

Definition at line 4061 of file hog.tcl.

◆ moveElementToEnd()

moveElementToEnd   inputList element  

Definition at line 4721 of file hog.tcl.

◆ Msg()

Msg   level msg ?title?  

Hog message printout function

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

◆ OS()

OS

Return operative sistem.

Definition at line 826 of file hog.tcl.

◆ ParseFirstLineHogFiles()

ParseFirstLineHogFiles   list_path list_file  

Parse possible commands in the first line of Hog files (e.g. #Vivado, #Simulator, etc)

Parameters
[in]list_pathpath to the list file directory
[in]list_filethe list file name
Returns
a string with the first-line command
  • 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

Definition at line 2150 of file hog.tcl.

◆ ParseJSON()

ParseJSON   JSON_FILE JSON_KEY  

Parse JSON file.

Returns
-1 in case of failure, JSON KEY VALUE in case of success

Definition at line 3082 of file hog.tcl.

◆ ProjectExists()

ProjectExists   project ?repo_path?  

Definition at line 4593 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 3439 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 2668 of file hog.tcl.

◆ ReadListFile()

ReadListFile   args  

Read a list file and adds the files to Vivado/Quartus, adding the additional information as file type.

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 fileset name as keys and the list of associated libraries as values.

Definition at line 622 of file hog.tcl.

◆ Relative()

Relative   base dst  

Returns the dst 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 1839 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 1879 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 4093 of file hog.tcl.

◆ RemoveEmptyKeys()

RemoveEmptyKeys   d  

Definition at line 4313 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 3355 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 948 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 3380 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) defines the output format of the string

Definition at line 3715 of file hog.tcl.

◆ SetParameter()

SetParameter   parameter value  

Sets the value of a parameter to a given value.

This function is a wrapper for set_param $parameter $value

Parameters
[out]parameterthe parameter whose value must be set
[in]valuethe value of the parameter

Definition at line 269 of file hog.tcl.

◆ SetProperty()

SetProperty   property value object  

Sets a property of an object to a given value.

It automatically recognises whether it is in Vivado or Quartus mode

Parameters
[out]property
[in]value
[out]object

Definition at line 222 of file hog.tcl.

◆ SetTopProperty()

SetTopProperty   top_module sources  

set the top module as top module.

It automatically recognises whether it is in Vivado or Quartus mode

Parameters
[out]top_modulename of the top module
[in]sourceslist of all source files in the project

Definition at line 301 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 3473 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 3913 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 3264 of file hog.tcl.

◆ WriteListFiles()

WriteListFiles   libs props list_path repo_path ?$ext_path?  

Definition at line 4283 of file hog.tcl.

◆ WriteSimListFiles()

WriteSimListFiles   libs props simsets list_path repo_path  

Definition at line 4248 of file hog.tcl.

◆ WriteToFile()

WriteToFile   File msg  

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

Parameters
[out]FileThe log file onto which write the message
[in]msgThe message text

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