├── .gitignore ├── CONTRIBUTORS.md ├── OsvvmLogo.png ├── images ├── AlertReport.png ├── BuildReport.png ├── CoverageReport.png ├── DemoAlertReport.png ├── DemoBuildStatus.png ├── BuildReportWithCov.png ├── DemoCoverageReport.png ├── DemoSimTranscript.png ├── DemoTestCaseLinks.png ├── DemoVHDLTranscript.png ├── DemoScoreboardReport.png ├── DemoTestSuiteSummary.png ├── DemoBuildSummaryReport.png ├── DemoTestCaseSummaries.png ├── DemoTestCaseDetailedReport.png ├── TestReport_OsvvmTranscript.png ├── TestCase_SimulationTranscript.png └── BuildReport_SimulationTranscript.png ├── requirements_header.html ├── simulation_header.html ├── AUTHORS.md ├── Siemens.do ├── StartActiveVSimSA.tcl ├── tee.tcl ├── StartVCS.tcl ├── StartXcelium.tcl ├── StartGHDL.tcl ├── StartNVC.tcl ├── StartReports.tcl ├── StartDSim.tcl ├── StartXSIM.tcl ├── StartQuesta.tcl ├── StartVisualizer.tcl ├── StartUpYamlLoadReports.tcl ├── RequirementsMerge.tcl ├── ReportScoreboard2Html.tcl ├── VendorScripts_Reports.tcl ├── CssOsvvmStyle.css ├── VendorScripts_CompileList.tcl ├── StartUpYamlMockReports.tcl ├── tools └── notepad++-OSVVM.pro.xml ├── StartUp.tcl ├── VendorScripts_Vivado.tcl ├── OsvvmScriptsSimulateSupport.tcl ├── ReportIndex2Html.tcl ├── VendorScripts_DSim.tcl ├── Requirements2Csv.tcl ├── ReportSimulate2Html.tcl ├── ReportSupport.tcl ├── VendorScripts_VSimSA.tcl ├── VendorScripts_Xsim.tcl ├── OsvvmSettingsRequired.tcl ├── ReportCov2Html.tcl ├── StartUpShared.tcl ├── ReportBuildDict2Junit.tcl ├── OsvvmSettingsDefault.tcl ├── LICENSE.md ├── Log2Osvvm.tcl └── VendorScripts_ASim.tcl /.gitignore: -------------------------------------------------------------------------------- 1 | LocalScriptDefaults.tcl 2 | OsvvmSettingsLocal.tcl -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | This file is deprecated. 2 | See [AUTHORS](AUTHORS.md). 3 | -------------------------------------------------------------------------------- /OsvvmLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/OsvvmLogo.png -------------------------------------------------------------------------------- /images/AlertReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/AlertReport.png -------------------------------------------------------------------------------- /images/BuildReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/BuildReport.png -------------------------------------------------------------------------------- /images/CoverageReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/CoverageReport.png -------------------------------------------------------------------------------- /images/DemoAlertReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoAlertReport.png -------------------------------------------------------------------------------- /images/DemoBuildStatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoBuildStatus.png -------------------------------------------------------------------------------- /images/BuildReportWithCov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/BuildReportWithCov.png -------------------------------------------------------------------------------- /images/DemoCoverageReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoCoverageReport.png -------------------------------------------------------------------------------- /images/DemoSimTranscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoSimTranscript.png -------------------------------------------------------------------------------- /images/DemoTestCaseLinks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoTestCaseLinks.png -------------------------------------------------------------------------------- /images/DemoVHDLTranscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoVHDLTranscript.png -------------------------------------------------------------------------------- /images/DemoScoreboardReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoScoreboardReport.png -------------------------------------------------------------------------------- /images/DemoTestSuiteSummary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoTestSuiteSummary.png -------------------------------------------------------------------------------- /images/DemoBuildSummaryReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoBuildSummaryReport.png -------------------------------------------------------------------------------- /images/DemoTestCaseSummaries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoTestCaseSummaries.png -------------------------------------------------------------------------------- /images/DemoTestCaseDetailedReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/DemoTestCaseDetailedReport.png -------------------------------------------------------------------------------- /images/TestReport_OsvvmTranscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/TestReport_OsvvmTranscript.png -------------------------------------------------------------------------------- /images/TestCase_SimulationTranscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/TestCase_SimulationTranscript.png -------------------------------------------------------------------------------- /images/BuildReport_SimulationTranscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSVVM/OSVVM-Scripts/HEAD/images/BuildReport_SimulationTranscript.png -------------------------------------------------------------------------------- /requirements_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 43 | 44 | -------------------------------------------------------------------------------- /simulation_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 43 | 44 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | ## OSVVM Project Authors - The people and/or organizations who own the copyrights 2 | 3 | #### [SynthWorks](https://SynthWorks.com) 4 | * Represented by Jim Lewis 5 | * Technical/Project lead 6 | * Maintainer / Contributor 7 | * email: jim (at) synthworks.com 8 | 9 | #### [Patrick Lehmann](https://opensource.ieee.org/patrick.lehmann) 10 | * Maintainer / Contributor 11 | 12 | ## OSVVM Project Contributors - The people who contribute to OSVVM 13 | 14 | #### [Jim Lewis](https://opensource.ieee.org/jim) 15 | * Technical/Project lead 16 | * Maintainer / Contributor 17 | * email: jim (at) synthworks.com 18 | 19 | #### [Patrick Lehmann](https://opensource.ieee.org/patrick.lehmann) 20 | * Maintainer / Contributor 21 | 22 | ### [Full contributors list](https://opensource.ieee.org/OSVVM/VerificationIP/-/graphs/master) 23 | 24 | 25 | ## Participating 26 | The OSVVM project welcomes your participation with either 27 | issue reports or pull requests. 28 | For details on [how to participate see](https://github.com/OSVVM/OsvvmLibraries/blob/main/CONTRIBUTING.md) 29 | 30 | 31 | #### Copyright and License 32 | Copyright (C) 2020 - 2024 by [OSVVM Authors](AUTHORS.md) 33 | 34 | This file is part of OSVVM. 35 | 36 | Licensed under Apache License, Version 2.0 (the "License") 37 | You may not use this file except in compliance with the License. 38 | You may obtain a copy of the License at 39 | 40 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 41 | 42 | Unless required by applicable law or agreed to in writing, software 43 | distributed under the License is distributed on an "AS IS" BASIS, 44 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45 | See the License for the specific language governing permissions and 46 | limitations under the License. 47 | 48 | -------------------------------------------------------------------------------- /Siemens.do: -------------------------------------------------------------------------------- 1 | # File Name: Mentor.do 2 | # Purpose: Scripts for running simulations 3 | # Revision: STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Vendor settings for Mentor that is run by default by 11 | # the OSVVM simulate script 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 11/2018 Alpha Project descriptors in .files and .dirs files 23 | # 2/2019 Beta Project descriptors in .pro which execute 24 | # as TCL scripts in conjunction with the library 25 | # procedures 26 | # 1/2020 2020.01 Updated Licenses to Apache 27 | # 28 | # 29 | # This file is part of OSVVM. 30 | # 31 | # Copyright (c) 2018 - 2020 by SynthWorks Design Inc. 32 | # 33 | # Licensed under the Apache License, Version 2.0 (the "License"); 34 | # you may not use this file except in compliance with the License. 35 | # You may obtain a copy of the License at 36 | # 37 | # https://www.apache.org/licenses/LICENSE-2.0 38 | # 39 | # Unless required by applicable law or agreed to in writing, software 40 | # distributed under the License is distributed on an "AS IS" BASIS, 41 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42 | # See the License for the specific language governing permissions and 43 | # limitations under the License. 44 | # 45 | 46 | set StdArithNoWarnings 1 47 | set NumericStdNoWarnings 1 48 | -------------------------------------------------------------------------------- /StartActiveVSimSA.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartUp.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # StartUp for ActiveVSimSA 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 22 | # 01/2022 2022.01 Initial 23 | # 24 | # 25 | # This file is part of OSVVM. 26 | # 27 | # Copyright (c) 2021 - 2022 by SynthWorks Design Inc. 28 | # 29 | # Licensed under the Apache License, Version 2.0 (the "License"); 30 | # you may not use this file except in compliance with the License. 31 | # You may obtain a copy of the License at 32 | # 33 | # https://www.apache.org/licenses/LICENSE-2.0 34 | # 35 | # Unless required by applicable law or agreed to in writing, software 36 | # distributed under the License is distributed on an "AS IS" BASIS, 37 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 | # See the License for the specific language governing permissions and 39 | # limitations under the License. 40 | # 41 | 42 | 43 | namespace eval ::osvvm { 44 | # variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 45 | variable OsvvmScriptDirectory [file dirname [string trim $argv0 ?{}?]] 46 | 47 | variable OsvvmInitialized "false" 48 | variable ScriptBaseName "VSimSA" 49 | } 50 | 51 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 52 | 53 | set ::osvvm::OsvvmInitialized "true" 54 | 55 | puts -nonewline "" ; # suppress printing of true from above line 56 | -------------------------------------------------------------------------------- /tee.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # File Name: tee.tcl 3 | # 4 | # Description: 5 | # An easy to use version of tee for TCL 6 | # 7 | # Copyright (c) 2022 by Schelte Bron 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # https://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | namespace eval tee { 23 | variable methods {initialize finalize write} 24 | namespace ensemble create -subcommands {replace append channel} \ 25 | -unknown [namespace current]::default 26 | namespace ensemble create -command transchan -parameters fd \ 27 | -subcommands $methods 28 | } 29 | 30 | proc tee::default {command subcommand args} { 31 | return [list $command replace $subcommand] 32 | } 33 | 34 | proc tee::channel {chan fd} { 35 | chan push $chan [list [namespace which transchan] $fd] 36 | return $fd 37 | } 38 | 39 | proc tee::replace {chan file} { 40 | return [channel $chan [open $file w]] 41 | } 42 | 43 | proc tee::append {chan file} { 44 | return [channel $chan [open $file a]] 45 | } 46 | 47 | proc tee::initialize {fd handle mode} { 48 | variable methods 49 | return $methods 50 | } 51 | 52 | proc tee::finalize {fd handle} { 53 | close $fd 54 | } 55 | 56 | proc tee::write {fd handle buffer} { 57 | # puts -nonewline $fd $buffer 58 | # Remove Null and change crcrlf to crlf 59 | puts -nonewline $fd [regsub -all \r\n [regsub -all \x00 $buffer ""] \n] 60 | # return [regsub -all {<[^>]*>} $buffer ""] ;# this works for ModelSim batch but not GHDL 61 | return $buffer 62 | } 63 | -------------------------------------------------------------------------------- /StartVCS.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartVCS.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 25 | # 9/2021 2021.09 Created from StartUp.tcl 26 | # 27 | # 28 | # This file is part of OSVVM. 29 | # 30 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 31 | # 32 | # Licensed under the Apache License, Version 2.0 (the "License"); 33 | # you may not use this file except in compliance with the License. 34 | # You may obtain a copy of the License at 35 | # 36 | # https://www.apache.org/licenses/LICENSE-2.0 37 | # 38 | # Unless required by applicable law or agreed to in writing, software 39 | # distributed under the License is distributed on an "AS IS" BASIS, 40 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41 | # See the License for the specific language governing permissions and 42 | # limitations under the License. 43 | # 44 | 45 | 46 | namespace eval ::osvvm { 47 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 48 | 49 | variable OsvvmInitialized "false" 50 | variable ScriptBaseName "VCS" 51 | } 52 | 53 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 54 | 55 | set ::osvvm::OsvvmInitialized "true" 56 | 57 | puts -nonewline "" ; # suppress printing of true from above line 58 | -------------------------------------------------------------------------------- /StartXcelium.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartXcelium.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 25 | # 9/2021 2021.09 Created from StartUp.tcl 26 | # 27 | # 28 | # This file is part of OSVVM. 29 | # 30 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 31 | # 32 | # Licensed under the Apache License, Version 2.0 (the "License"); 33 | # you may not use this file except in compliance with the License. 34 | # You may obtain a copy of the License at 35 | # 36 | # https://www.apache.org/licenses/LICENSE-2.0 37 | # 38 | # Unless required by applicable law or agreed to in writing, software 39 | # distributed under the License is distributed on an "AS IS" BASIS, 40 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41 | # See the License for the specific language governing permissions and 42 | # limitations under the License. 43 | # 44 | 45 | 46 | namespace eval ::osvvm { 47 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 48 | 49 | variable OsvvmInitialized "false" 50 | variable ScriptBaseName "Xcelium" 51 | } 52 | 53 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 54 | 55 | set ::osvvm::OsvvmInitialized "true" 56 | 57 | puts -nonewline "" ; # suppress printing of true from above line 58 | -------------------------------------------------------------------------------- /StartGHDL.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartGHDL.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 12/2022 Created from StartQuesta.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | namespace eval ::osvvm { 46 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 47 | 48 | variable OsvvmInitialized "false" 49 | variable ScriptBaseName "GHDL" 50 | } 51 | 52 | # set this outside the OSVVM scope 53 | variable ToolName "GHDL" 54 | 55 | 56 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 57 | 58 | set ::osvvm::OsvvmInitialized "true" 59 | 60 | puts -nonewline "" ; # suppress printing of true from above line 61 | -------------------------------------------------------------------------------- /StartNVC.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartNVC.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 10/2022 Created from StartQuesta.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | namespace eval ::osvvm { 46 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 47 | 48 | variable OsvvmInitialized "false" 49 | variable ScriptBaseName "NVC" 50 | } 51 | 52 | # set this outside the OSVVM scope 53 | variable ToolName "NVC" 54 | 55 | 56 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 57 | 58 | set ::osvvm::OsvvmInitialized "true" 59 | 60 | puts -nonewline "" ; # suppress printing of true from above line 61 | -------------------------------------------------------------------------------- /StartReports.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartReports.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 12/2022 Created from StartQuesta.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2022 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | namespace eval ::osvvm { 46 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 47 | 48 | variable OsvvmInitialized "false" 49 | variable ScriptBaseName "Reports" 50 | } 51 | 52 | # set this outside the OSVVM scope 53 | variable ToolName "Reports" 54 | 55 | 56 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 57 | 58 | set ::osvvm::OsvvmInitialized "true" 59 | 60 | puts -nonewline "" ; # suppress printing of true from above line 61 | -------------------------------------------------------------------------------- /StartDSim.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartDSim.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 25 | # 9/2021 2021.09 Created from StartUp.tcl 26 | # 27 | # 28 | # This file is part of OSVVM. 29 | # 30 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 31 | # 32 | # Licensed under the Apache License, Version 2.0 (the "License"); 33 | # you may not use this file except in compliance with the License. 34 | # You may obtain a copy of the License at 35 | # 36 | # https://www.apache.org/licenses/LICENSE-2.0 37 | # 38 | # Unless required by applicable law or agreed to in writing, software 39 | # distributed under the License is distributed on an "AS IS" BASIS, 40 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41 | # See the License for the specific language governing permissions and 42 | # limitations under the License. 43 | # 44 | 45 | 46 | namespace eval ::osvvm { 47 | # Initial OsvvmScriptDirectory setup - revised by ActiveHDL VSimSA 48 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 49 | 50 | variable OsvvmInitialized "false" 51 | variable ScriptBaseName "DSim" 52 | } 53 | 54 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 55 | 56 | set ::osvvm::OsvvmInitialized "true" 57 | 58 | puts -nonewline "" ; # suppress printing of true from above line 59 | -------------------------------------------------------------------------------- /StartXSIM.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartXSim.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 25 | # 9/2021 2021.09 Created from StartUp.tcl 26 | # 27 | # 28 | # This file is part of OSVVM. 29 | # 30 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 31 | # 32 | # Licensed under the Apache License, Version 2.0 (the "License"); 33 | # you may not use this file except in compliance with the License. 34 | # You may obtain a copy of the License at 35 | # 36 | # https://www.apache.org/licenses/LICENSE-2.0 37 | # 38 | # Unless required by applicable law or agreed to in writing, software 39 | # distributed under the License is distributed on an "AS IS" BASIS, 40 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41 | # See the License for the specific language governing permissions and 42 | # limitations under the License. 43 | # 44 | 45 | 46 | namespace eval ::osvvm { 47 | # Initial OsvvmScriptDirectory setup - revised by ActiveHDL VSimSA 48 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 49 | 50 | variable OsvvmInitialized "false" 51 | variable ScriptBaseName "Xsim" 52 | } 53 | 54 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 55 | 56 | set ::osvvm::OsvvmInitialized "true" 57 | 58 | puts -nonewline "" ; # suppress printing of true from above line 59 | -------------------------------------------------------------------------------- /StartQuesta.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartXcelium.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 05/2022 2022.05 Updated based on StartUpShared.tcl 25 | # 9/2021 2021.09 Created from StartUp.tcl 26 | # 27 | # 28 | # This file is part of OSVVM. 29 | # 30 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 31 | # 32 | # Licensed under the Apache License, Version 2.0 (the "License"); 33 | # you may not use this file except in compliance with the License. 34 | # You may obtain a copy of the License at 35 | # 36 | # https://www.apache.org/licenses/LICENSE-2.0 37 | # 38 | # Unless required by applicable law or agreed to in writing, software 39 | # distributed under the License is distributed on an "AS IS" BASIS, 40 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41 | # See the License for the specific language governing permissions and 42 | # limitations under the License. 43 | # 44 | 45 | 46 | namespace eval ::osvvm { 47 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 48 | 49 | variable OsvvmInitialized "false" 50 | variable ScriptBaseName "Siemens" 51 | } 52 | 53 | # set this outside the OSVVM scope 54 | variable ToolName "QuestaSim" 55 | 56 | 57 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 58 | 59 | set ::osvvm::OsvvmInitialized "true" 60 | 61 | puts -nonewline "" ; # suppress printing of true from above line 62 | -------------------------------------------------------------------------------- /StartVisualizer.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartXcelium.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 11/2024 2024.11 Created from StartQuesta.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2024 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | namespace eval ::osvvm { 46 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 47 | 48 | variable OsvvmInitialized "false" 49 | # variable ScriptBaseName "Visualizer" 50 | variable ScriptBaseName "Questa" 51 | } 52 | 53 | # set this outside the OSVVM scope 54 | #variable ToolName "Visualizer" 55 | variable ToolName "Questa" 56 | 57 | 58 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 59 | 60 | set ::osvvm::OsvvmInitialized "true" 61 | 62 | puts -nonewline "" ; # suppress printing of true from above line 63 | -------------------------------------------------------------------------------- /StartUpYamlLoadReports.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartUpYamlLoadReports.tcl 2 | # Purpose: Utilities to convert OSVVM YAML files to HTML and JUnit XML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Load YAML reporting utilities - sources multiple files 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 05/2024 2024.05 Updated name. Added ReportSupport. Updated for refactoring. 22 | # 02/2022 2022.02 Added Scoreboard reports 23 | # 10/2021 Initial Initial Revision 24 | # 25 | # 26 | # This file is part of OSVVM. 27 | # 28 | # Copyright (c) 2021 - 2024 by SynthWorks Design Inc. 29 | # 30 | # Licensed under the Apache License, Version 2.0 (the "License"); 31 | # you may not use this file except in compliance with the License. 32 | # You may obtain a copy of the License at 33 | # 34 | # https://www.apache.org/licenses/LICENSE-2.0 35 | # 36 | # Unless required by applicable law or agreed to in writing, software 37 | # distributed under the License is distributed on an "AS IS" BASIS, 38 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39 | # See the License for the specific language governing permissions and 40 | # limitations under the License. 41 | # 42 | 43 | namespace eval ::osvvm { 44 | 45 | package require yaml 46 | 47 | variable GotYaml 1 48 | source ${::osvvm::OsvvmScriptDirectory}/ReportSimulate2Html.tcl 49 | source ${::osvvm::OsvvmScriptDirectory}/ReportAlert2Html.tcl 50 | source ${::osvvm::OsvvmScriptDirectory}/ReportCov2Html.tcl 51 | source ${::osvvm::OsvvmScriptDirectory}/ReportScoreboard2Html.tcl 52 | source ${::osvvm::OsvvmScriptDirectory}/ReportSupport.tcl 53 | 54 | source ${::osvvm::OsvvmScriptDirectory}/ReportBuildYaml2Dict.tcl 55 | source ${::osvvm::OsvvmScriptDirectory}/ReportBuildDict2Html.tcl 56 | source ${::osvvm::OsvvmScriptDirectory}/ReportBuildDict2Junit.tcl 57 | source ${::osvvm::OsvvmScriptDirectory}/ReportIndex2Html.tcl 58 | 59 | # source ${::osvvm::OsvvmScriptDirectory}/Report2Html.tcl 60 | # source ${::osvvm::OsvvmScriptDirectory}/Report2Junit.tcl 61 | 62 | source ${::osvvm::OsvvmScriptDirectory}/RequirementsMerge.tcl 63 | source ${::osvvm::OsvvmScriptDirectory}/Requirements2Html.tcl 64 | source ${::osvvm::OsvvmScriptDirectory}/Requirements2Csv.tcl 65 | 66 | namespace export Simulate2Html Cov2Html Alert2Html Scoreboard2Html MergeRequirements Requirements2Html Requirements2Csv 67 | namespace export CreateBuildReports ReportBuildYaml2Dict ReportBuildDict2Html ReportBuildDict2Junit Report2Html Report2Junit Index2Html 68 | # end namespace ::osvvm 69 | } 70 | -------------------------------------------------------------------------------- /RequirementsMerge.tcl: -------------------------------------------------------------------------------- 1 | # File Name: MergeRequirements.tcl 2 | # Purpose: Merge OSVVM YAML requirements 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Visible externally: MergeRequirements 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 07/2023 2023.07 Initial Revision 22 | # 23 | # 24 | # This file is part of OSVVM. 25 | # 26 | # Copyright (c) 2023 by SynthWorks Design Inc. 27 | # 28 | # Licensed under the Apache License, Version 2.0 (the "License"); 29 | # you may not use this file except in compliance with the License. 30 | # You may obtain a copy of the License at 31 | # 32 | # https://www.apache.org/licenses/LICENSE-2.0 33 | # 34 | # Unless required by applicable law or agreed to in writing, software 35 | # distributed under the License is distributed on an "AS IS" BASIS, 36 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37 | # See the License for the specific language governing permissions and 38 | # limitations under the License. 39 | # 40 | 41 | package require yaml 42 | 43 | proc MergeRequirements {SourceDirectory ResultsFileName} { 44 | variable ResultsFile 45 | 46 | set ReqFiles [glob -nocomplain [file join ${SourceDirectory} *_req.yml]] 47 | if {$ReqFiles ne ""} { 48 | set ResultsFile [open $ResultsFileName w] 49 | set ErrorCode [catch {LocalMergeRequirements $ReqFiles} errmsg] 50 | close $ResultsFile 51 | if {$ErrorCode} { 52 | CallbackOnError_AnyReport "MergeRequirements" "SourceDirectory: $SourceDirectory, ResultsFileName: $ResultsFileName" $errmsg 53 | } 54 | } 55 | } 56 | 57 | proc LocalMergeRequirements {ReqFiles} { 58 | variable ResultsFile 59 | 60 | set ReqDict "" 61 | foreach ReqFile ${ReqFiles} { 62 | set ReqDict [concat $ReqDict [::yaml::yaml2dict -file ${ReqFile}]] 63 | } 64 | 65 | # Sort based on test name - must sort here so can combine TestCases 66 | set SortedReqDict [lsort -index 1 $ReqDict] 67 | 68 | set PreviousReq "" 69 | foreach item $SortedReqDict { 70 | set CurrentReq [dict get $item Requirement] 71 | if {$CurrentReq ne $PreviousReq} { 72 | puts $ResultsFile "- Requirement: $CurrentReq" 73 | puts $ResultsFile " TestCases:" 74 | } 75 | set PreviousReq $CurrentReq 76 | set TestCases [dict get $item TestCases] 77 | foreach TestCase $TestCases { 78 | puts $ResultsFile " - TestName: [dict get $TestCase TestName]" 79 | puts $ResultsFile " Status: [dict get $TestCase Status]" 80 | set Results [dict get $TestCase Results] 81 | puts $ResultsFile " Results: {\ 82 | Goal: [dict get $Results Goal],\ 83 | Passed: [dict get $Results Passed],\ 84 | Errors: [dict get $Results Errors],\ 85 | Checked: [dict get $Results Checked],\ 86 | AlertCount: [WriteYamlAlertCount [dict get $Results AlertCount]],\ 87 | DisabledAlertCount: [WriteYamlAlertCount [dict get $Results DisabledAlertCount]]}" 88 | } 89 | } 90 | } 91 | 92 | proc WriteYamlAlertCount {AlertCount} { 93 | return "{Failure: [dict get $AlertCount Failure], \ 94 | Error: [dict get $AlertCount Error], \ 95 | Warning: [dict get $AlertCount Warning]}" 96 | } 97 | -------------------------------------------------------------------------------- /ReportScoreboard2Html.tcl: -------------------------------------------------------------------------------- 1 | # File Name: Scoreboard2Html.tcl 2 | # Purpose: Convert OSVVM YAML Scoreboard information to HTML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Convert OSVVM YAML Scoreboard information to HTML 11 | # Visible externally: Scoreboard2Html 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 05/2024 2024.05 Minor updates during Simulate2Html refactoring 23 | # 04/2024 2024.04 Updated report formatting 24 | # 02/2022 2022.02 Initial Revision 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2022 - 2024 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | package require yaml 45 | 46 | proc Scoreboard2Html {TestCaseName TestSuiteName SbYamlFile SbName} { 47 | variable ResultsFile 48 | 49 | OpenSimulationReportFile [file join $::osvvm::Report2TestCaseHtml] 50 | 51 | set ErrorCode [catch {LocalScoreboard2Html $TestCaseName $TestSuiteName $SbYamlFile $SbName} errmsg] 52 | 53 | close $ResultsFile 54 | 55 | if {$ErrorCode} { 56 | CallbackOnError_Scoreboard2Html $TestSuiteName $TestCaseName $errmsg 57 | } 58 | } 59 | 60 | proc LocalScoreboard2Html {TestCaseName TestSuiteName SbYamlFile SbName} { 61 | variable ResultsFile 62 | 63 | puts $ResultsFile "
" 64 | puts $ResultsFile "
" 65 | puts $ResultsFile "

$TestCaseName Scoreboard Report for ${SbName}

" 66 | puts $ResultsFile "
" 67 | puts $ResultsFile " " 68 | 69 | set TestDict [::yaml::yaml2dict -file ${SbYamlFile}] 70 | set VersionNum [dict get $TestDict Version] 71 | 72 | set ScoreboardDictArray [dict get $TestDict Scoreboards] 73 | ScoreboardHeader2Html $ScoreboardDictArray 74 | ScoreboardBody2Html $ScoreboardDictArray 75 | 76 | puts $ResultsFile "
" 77 | puts $ResultsFile "
" 78 | puts $ResultsFile "
" 79 | } 80 | 81 | proc ScoreboardHeader2Html {ScoreboardDictArray} { 82 | variable ResultsFile 83 | 84 | set FirstScoreboardDict [lindex $ScoreboardDictArray 0] 85 | puts $ResultsFile " " 86 | puts $ResultsFile " " 87 | foreach key [dict keys $FirstScoreboardDict] { 88 | puts $ResultsFile " ${key}" 89 | } 90 | puts $ResultsFile " " 91 | puts $ResultsFile " " 92 | } 93 | 94 | proc ScoreboardBody2Html {ScoreboardDictArray} { 95 | variable ResultsFile 96 | 97 | puts $ResultsFile " " 98 | foreach ScoreboardDict $ScoreboardDictArray { 99 | puts $ResultsFile " " 100 | dict for {key val} ${ScoreboardDict} { 101 | puts $ResultsFile " ${val}" 102 | } 103 | puts $ResultsFile " " 104 | } 105 | puts $ResultsFile " " 106 | } 107 | -------------------------------------------------------------------------------- /VendorScripts_Reports.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_Reports.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # VendorScript stub for report generation 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 5/2024 2024.05 Added ToolVersion variable 22 | # 12/2022 2022.12 Updated variable naming 23 | # 2/2022 2022.02 Added template of procedures needed for coverage support 24 | # 9/2021 2021.09 Created from VendorScripts_xxx.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2022 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | # ------------------------------------------------- 46 | # Tool Settings 47 | # 48 | variable ToolType "simulator" 49 | variable ToolVendor "Reports" 50 | variable ToolName "Reports" 51 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 52 | variable ToolVersion "Reports" 53 | variable ToolNameVersion "Reports" 54 | # puts $ToolNameVersion 55 | 56 | 57 | # ------------------------------------------------- 58 | # StartTranscript / StopTranscxript 59 | # 60 | 61 | 62 | # ------------------------------------------------- 63 | # IsVendorCommand 64 | # 65 | proc IsVendorCommand {LineOfText} { 66 | 67 | return "false" 68 | } 69 | 70 | # ------------------------------------------------- 71 | # SetCoverageAnalyzeOptions 72 | # SetCoverageCoverageOptions 73 | # 74 | proc vendor_SetCoverageAnalyzeDefaults {} { 75 | variable CoverageAnalyzeOptions 76 | # set defaults here 77 | } 78 | 79 | proc vendor_SetCoverageSimulateDefaults {} { 80 | variable CoverageSimulateOptions 81 | # set defaults here 82 | } 83 | 84 | 85 | # ------------------------------------------------- 86 | # Library 87 | # 88 | proc vendor_library {LibraryName PathToLib} { 89 | } 90 | 91 | proc vendor_LinkLibrary {LibraryName PathToLib} {} 92 | proc vendor_UnlinkLibrary {LibraryName PathToLib} {} 93 | 94 | # ------------------------------------------------- 95 | # analyze 96 | # 97 | proc vendor_analyze_vhdl {LibraryName FileName args} { 98 | } 99 | 100 | proc vendor_analyze_verilog {LibraryName FileName args} { 101 | } 102 | 103 | # ------------------------------------------------- 104 | # End Previous Simulation 105 | # 106 | proc vendor_end_previous_simulation {} { 107 | } 108 | 109 | # ------------------------------------------------- 110 | # Simulate 111 | # 112 | proc vendor_simulate {LibraryName LibraryUnit args} { 113 | } 114 | 115 | # ------------------------------------------------- 116 | proc vendor_generic {Name Value} { 117 | } 118 | 119 | 120 | # ------------------------------------------------- 121 | # Merge Coverage 122 | # 123 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 124 | } 125 | 126 | proc vendor_ReportCodeCoverage {TestSuiteName ResultsDirectory} { 127 | } 128 | 129 | proc vendor_GetCoverageFileName {TestName} { 130 | return $TestName 131 | } 132 | -------------------------------------------------------------------------------- /CssOsvvmStyle.css: -------------------------------------------------------------------------------- 1 | /* 2 | # File Name: CssOsvvmStyles.css 3 | # Purpose: CSS for OSVVM HTML reports 4 | # Revision: OSVVM MODELS STANDARD VERSION 5 | # 6 | # Maintainer: Jim Lewis email: jim@synthworks.com 7 | # Contributor(s): 8 | # Patrick Lehmann 9 | # Jim Lewis email: jim@synthworks.com 10 | # 11 | # Description 12 | # CSS for OSVVM HTML reports 13 | # 14 | # 15 | # Revision History: 16 | # Date Version Description 17 | # 05/2024 2024.05 Initial Revision 18 | # 19 | # 20 | # This file is part of OSVVM. 21 | # 22 | # Copyright (c) 2024 by SynthWorks Design Inc. 23 | # 24 | # Licensed under the Apache License, Version 2.0 (the "License"); 25 | # you may not use this file except in compliance with the License. 26 | # You may obtain a copy of the License at 27 | # 28 | # https://www.apache.org/licenses/LICENSE-2.0 29 | # 30 | # Unless required by applicable law or agreed to in writing, software 31 | # distributed under the License is distributed on an "AS IS" BASIS, 32 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 33 | # See the License for the specific language governing permissions and 34 | # limitations under the License. 35 | # 36 | */ 37 | 38 | 39 | body { 40 | margin: 10px 20px; 41 | font-family: "Segoe UI", "Trebuchet MS", Verdana, Tahoma, sans-serif; 42 | /* font-size: 14px;*/ 43 | font-size: 90%; 44 | } 45 | 46 | header { 47 | } 48 | 49 | main { 50 | max-width: 1200px; 51 | } 52 | 53 | footer { 54 | } 55 | 56 | hr { 57 | margin: 30px 0px 30px 0px; 58 | } 59 | 60 | footer hr { 61 | margin: 30px 0px 0px 0px; 62 | } 63 | 64 | h1 { 65 | } 66 | 67 | h2:not(:first-child) { 68 | margin-top: 30px; 69 | } 70 | 71 | div.summary-parent { 72 | display: grid; 73 | grid-template-columns: 1fr 1fr; 74 | } 75 | 76 | div.summary-logo img { 77 | vertical-align: top; 78 | max-width: 400px; 79 | margin-left: 20px; 80 | } 81 | 82 | div.requirements-logo img { 83 | float: center; 84 | vertical-align: middle; 85 | max-width: 200px; 86 | margin: 10px 40px 10px 80px; 87 | } 88 | 89 | div.analysis-results { 90 | } 91 | 92 | div.simulation-results { 93 | } 94 | 95 | div.testsuites { 96 | } 97 | 98 | div.testsuite-results { 99 | } 100 | 101 | details.testsuite-details { 102 | margin-top: 20px; 103 | } 104 | 105 | summary { 106 | margin-top: 20px; 107 | margin-bottom: 5px; 108 | font-weight: bold; 109 | font-size: 1.5em; 110 | } 111 | 112 | summary.subtitle { 113 | margin-top: 20px; 114 | margin-bottom: 5px; 115 | font-weight: bold; 116 | font-size: 1.2em; 117 | } 118 | 119 | summary.subindented { 120 | margin: 20px 20px 5px 20px; 121 | font-weight: bold; 122 | font-size: 1em; 123 | } 124 | 125 | table.CoverageSettings, table.CoverageTable { 126 | margin: 0px 20px 0px 40px; 127 | } 128 | 129 | 130 | details summary b { 131 | font-weight: bold; 132 | } 133 | 134 | table, th, td { 135 | border: 1px solid #CCCCCC; 136 | border-collapse: collapse; 137 | padding: 4px 15px 3px 15px; 138 | } 139 | 140 | table.testsuite-summary-table { 141 | } 142 | 143 | table.testsuite-details-table { 144 | width: 100%; 145 | } 146 | 147 | thead { 148 | background-color: rgba(0,187, 255, 0.5); /* #88d0ff; */ 149 | font-weight: bold; 150 | } 151 | 152 | thead tr.column-header { 153 | height: 40px; 154 | } 155 | 156 | tbody { 157 | text-align: left; 158 | } 159 | 160 | tbody tr:nth-child(odd) { 161 | background-color: #f8f8f8; 162 | } 163 | 164 | tbody tr:hover { 165 | background-color: #FFFF00; 166 | } 167 | 168 | td { 169 | text-align: left; 170 | } 171 | td:nth-child(n+3) { 172 | text-align: right; 173 | } 174 | table.AlertSettings td { 175 | text-align: left; 176 | } 177 | table.RequirementsResults td:nth-child(3) { 178 | text-align: left; 179 | } 180 | 181 | tfoot { 182 | background-color: #e0e0e0; 183 | font-weight: bold; 184 | } 185 | 186 | .passed { 187 | color: #00C000 188 | } 189 | 190 | .failed { 191 | color: #c40000 192 | } 193 | 194 | .skipped { 195 | color: #D09000 196 | } 197 | 198 | .warning { 199 | color: #D09000 200 | } 201 | 202 | .number { 203 | text-align: right; 204 | } 205 | 206 | summary > b { 207 | font-weight: bold; 208 | } 209 | 210 | /* #logo { 211 | width: 100%; 212 | }*/ 213 | -------------------------------------------------------------------------------- /VendorScripts_CompileList.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_Reports.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # VendorScript stub for report generation 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 5/2024 2024.05 Added ToolVersion variable 22 | # 12/2022 2022.12 Updated variable naming 23 | # 2/2022 2022.02 Added template of procedures needed for coverage support 24 | # 9/2021 2021.09 Created from VendorScripts_xxx.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2022 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | # 46 | # Load the tool vendor base files so we get the files it compiles 47 | # 48 | # variable ScriptBaseName $::env(OSVVM_TOOL2) 49 | # source ${::osvvm::OsvvmScriptDirectory}/VendorScripts_${::osvvm::ScriptBaseName}.tcl 50 | 51 | # 52 | # Now replace base level procedures with the following 53 | # 54 | 55 | 56 | namespace eval ::osvvm { 57 | 58 | 59 | # ------------------------------------------------- 60 | # StartTranscript / StopTranscpript 61 | # 62 | # proc vendor_StartTranscript {FileName} { 63 | # } 64 | # 65 | # proc vendor_StopTranscript {FileName} { 66 | # } 67 | 68 | 69 | # ------------------------------------------------- 70 | # IsVendorCommand 71 | # 72 | proc IsVendorCommand {LineOfText} { 73 | 74 | return "false" 75 | } 76 | 77 | # ------------------------------------------------- 78 | # SetCoverageAnalyzeOptions 79 | # SetCoverageCoverageOptions 80 | # 81 | proc vendor_SetCoverageAnalyzeDefaults {} { 82 | variable CoverageAnalyzeOptions 83 | # set defaults here 84 | } 85 | 86 | proc vendor_SetCoverageSimulateDefaults {} { 87 | variable CoverageSimulateOptions 88 | # set defaults here 89 | } 90 | 91 | 92 | # ------------------------------------------------- 93 | # Library 94 | # 95 | proc vendor_library {LibraryName PathToLib} { 96 | } 97 | 98 | proc vendor_LinkLibrary {LibraryName PathToLib} {} 99 | proc vendor_UnlinkLibrary {LibraryName PathToLib} {} 100 | 101 | # ------------------------------------------------- 102 | # analyze 103 | # 104 | proc vendor_analyze_vhdl {LibraryName FileName args} { 105 | set ListOfLibraryFiles [open ${LibraryName}_${::osvvm::ToolName}.files a] 106 | puts $ListOfLibraryFiles $FileName 107 | close $ListOfLibraryFiles 108 | } 109 | 110 | proc vendor_analyze_verilog {LibraryName FileName args} { 111 | set ListOfLibraryFiles [open ${LibraryName}_${::osvvm::ToolName}.files a] 112 | puts $ListOfLibraryFiles $FileName 113 | close $ListOfLibraryFiles 114 | } 115 | 116 | # ------------------------------------------------- 117 | # End Previous Simulation 118 | # 119 | proc vendor_end_previous_simulation {} { 120 | } 121 | 122 | # ------------------------------------------------- 123 | # Simulate 124 | # 125 | proc vendor_simulate {LibraryName LibraryUnit args} { 126 | } 127 | 128 | # ------------------------------------------------- 129 | proc vendor_generic {Name Value} { 130 | } 131 | 132 | 133 | # ------------------------------------------------- 134 | # Merge Coverage 135 | # 136 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 137 | } 138 | 139 | proc vendor_ReportCodeCoverage {TestSuiteName ResultsDirectory} { 140 | } 141 | 142 | proc vendor_GetCoverageFileName {TestName} { 143 | return $TestName 144 | } 145 | 146 | # end namespace ::osvvm 147 | } 148 | -------------------------------------------------------------------------------- /StartUpYamlMockReports.tcl: -------------------------------------------------------------------------------- 1 | # File Name: NoYamlPackage.tcl 2 | # Purpose: Provides handling when YAML packages are not available 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Called when YAML packages are missing. 11 | # Provides implementations of Report2Html, Report2Junit, 12 | # GenerateSimulationReports, Cov2Html, Alert2Html 13 | # that generate error messages and provide information on 14 | # how to load the tcl library. 15 | # 16 | # Developed by: 17 | # SynthWorks Design Inc. 18 | # VHDL Training Classes 19 | # OSVVM Methodology and Model Library 20 | # 11898 SW 128th Ave. Tigard, Or 97223 21 | # http://www.SynthWorks.com 22 | # 23 | # Revision History: 24 | # Date Version Description 25 | # 05/2024 2024.05 Updated name. Updated for refactoring 26 | # 12/2021 2021.12 Fixed name for Simulate2Html 27 | # 10/2021 Initial Initial Revision 28 | # 29 | # 30 | # This file is part of OSVVM. 31 | # 32 | # Copyright (c) 2021 - 2024 by SynthWorks Design Inc. 33 | # 34 | # Licensed under the Apache License, Version 2.0 (the "License"); 35 | # you may not use this file except in compliance with the License. 36 | # You may obtain a copy of the License at 37 | # 38 | # https://www.apache.org/licenses/LICENSE-2.0 39 | # 40 | # Unless required by applicable law or agreed to in writing, software 41 | # distributed under the License is distributed on an "AS IS" BASIS, 42 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43 | # See the License for the specific language governing permissions and 44 | # limitations under the License. 45 | # 46 | 47 | namespace eval ::osvvm { 48 | 49 | variable GotYaml 0 50 | variable YamlErrorSignaled 0 51 | 52 | proc CreateBuildReports {args} { 53 | puts "To generate OSVVM Build Report HTML and JUnit files, please install TCL yaml package from Tcllib" 54 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 55 | } 56 | 57 | proc ReportBuildYaml2Dict {args} { 58 | puts "To generate OSVVM Build Report HTML files, please install TCL yaml package from Tcllib" 59 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 60 | } 61 | 62 | proc ReportBuildDict2Html {args} { 63 | puts "To generate OSVVM Build Report HTML files, please install TCL yaml package from Tcllib" 64 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 65 | } 66 | 67 | proc ReportBuildDict2Junit {args} { 68 | puts "To generate OSVVM Build Report JUnit XML CI Results files, please install TCL yaml package from Tcllib" 69 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 70 | } 71 | 72 | proc Report2Html {args} { 73 | puts "To generate OSVVM Build Report HTML files, please install TCL yaml package from Tcllib" 74 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 75 | } 76 | 77 | proc Report2Junit {args} { 78 | puts "To generate OSVVM Build Report JUnit XML CI Results files, please install TCL yaml package from Tcllib" 79 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 80 | } 81 | 82 | proc Simulate2Html {args} { 83 | puts "To generate OSVVM Test Case HTML files, please install TCL yaml package from Tcllib" 84 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 85 | } 86 | 87 | proc Cov2Html {args} { 88 | puts "To generate OSVVM Test Case Coverage HTML files, please install TCL yaml package from Tcllib" 89 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 90 | } 91 | 92 | proc Alert2Html {args} { 93 | puts "To generate OSVVM Test Case Alert HTML files, please install TCL yaml package from Tcllib" 94 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 95 | } 96 | 97 | proc MergeRequirements {args} { 98 | puts "To generate OSVVM Requirements HTML files, please install TCL yaml package from Tcllib" 99 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 100 | } 101 | 102 | proc Requirements2Html {args} { 103 | puts "To generate OSVVM Requirements HTML files, please install TCL yaml package from Tcllib" 104 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 105 | } 106 | 107 | proc Requirements2Csv {args} { 108 | puts "To generate OSVVM Requirements CSV files, please install TCL yaml package from Tcllib" 109 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 110 | } 111 | 112 | proc ReportBuildStatus {args} { 113 | puts "To generate OSVVM Build Status Mini-Report Text Report (in simulator console), please install TCL yaml package from Tcllib" 114 | puts "See https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/devdoc/tcllib_sources.md" 115 | } 116 | namespace export Simulate2Html Cov2Html Alert2Html Scoreboard2Html MergeRequirements Requirements2Html Requirements2Csv 117 | namespace export CreateBuildReports ReportBuildYaml2Dict ReportBuildDict2Html ReportBuildDict2Junit Report2Html Report2Junit 118 | # end namespace ::osvvm 119 | } 120 | -------------------------------------------------------------------------------- /tools/notepad++-OSVVM.pro.xml: -------------------------------------------------------------------------------- 1 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 00# 01 02 03 04 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | library 60 | build 61 | analyze 62 | include 63 | simulate RunTest 64 | ./ ../ 65 | 66 | 67 | 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /StartUp.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartUp.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures to configure and adapt the OSVVM simulator 11 | # scripting methodology for a particular project. 12 | # As part of its tasks, it runs OSVVM scripts that define 13 | # procedures use in the OSVVM scripting methodology. 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 07/2024 2024.07 Added detection for Siemen's Visualizer 25 | # 05/2022 2022.05 Refactored StartUp.tcl to move items 26 | # shared by all StartUp scripts to StartUpShared.tcl 27 | # 01/2022 2022.01 New StartUp algorithm for detecting ActiveHDL's VSimSA. 28 | # 10/2021 2021.10 Loads YAML utilities when YAML library available: OsvvmYamlSupport.tcl, NoYamlPackage.tcl 29 | # Loads LocalScriptDefaults.tcl if it is in the OsvvmScriptDirectory. This is a optional user settings file. 30 | # LocalScriptsDefaults.tcl is not provided by OSVVM so your local settings will not be overwritten. 31 | # 2/2021 2021.02 Refactored. 32 | # - Tool now determined in here (was in ToolConfiguration.tcl). 33 | # - Simplifies ActiveHDL startup 34 | # - Initial tool settings now in VendorScripts_*.tcl (was in ToolConfiguration.tcl) 35 | # - Added: Default settings now in OsvvmScriptDefaults.tcl (was here) 36 | # - Removed: ToolConfiguration.tcl (now in StartUp.tcl and VendorScripts_*.tcl) 37 | # 7/2020 2020.07 Refactored tool execution for simpler vendor customization 38 | # 2/2020 2020.02 Moved tool determination to outer layer 39 | # 1/2020 2020.01 Updated Licenses to Apache 40 | # 2/2019 Beta Project descriptors in .pro which execute 41 | # 11/2018 Alpha Project descriptors in .files and .dirs files 42 | # as TCL scripts in conjunction with the library 43 | # procedures 44 | # 45 | # 46 | # This file is part of OSVVM. 47 | # 48 | # Copyright (c) 2018 - 2022 by SynthWorks Design Inc. 49 | # 50 | # Licensed under the Apache License, Version 2.0 (the "License"); 51 | # you may not use this file except in compliance with the License. 52 | # You may obtain a copy of the License at 53 | # 54 | # https://www.apache.org/licenses/LICENSE-2.0 55 | # 56 | # Unless required by applicable law or agreed to in writing, software 57 | # distributed under the License is distributed on an "AS IS" BASIS, 58 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 | # See the License for the specific language governing permissions and 60 | # limitations under the License. 61 | # 62 | 63 | 64 | namespace eval ::osvvm { 65 | # Default OsvvmScriptDirectory setup - revised for ActiveHDL VSimSA 66 | variable OsvvmScriptDirectory [file dirname [file normalize [info script]]] 67 | variable OsvvmInitialized "false" 68 | 69 | # 70 | # Determine simulator from name of executable and settings 71 | # Primarily this only applies to simulators that run from a GUI 72 | # 73 | variable ToolExecutable [info nameofexecutable] 74 | variable ToolExecutableName [file rootname [file tail $ToolExecutable]] 75 | 76 | if {[info exists ::env(OSVVM_TOOL)]} { 77 | variable ScriptBaseName $::env(OSVVM_TOOL) 78 | 79 | } elseif {[info exists aldec]} { 80 | variable ToolFamily [lindex [split [vsim -version]] 2] 81 | if {$ToolFamily eq "Riviera-PRO"} { 82 | variable ScriptBaseName "RivieraPro" 83 | 84 | } elseif {[string match -nocase $ToolExecutableName "vsimsa"]} { 85 | if {![info exists ScriptBaseName]} { 86 | set OsvvmScriptDirectory [file dirname [string trim $argv0 ?{}?]] 87 | } 88 | variable ScriptBaseName "VSimSA" 89 | 90 | } else { 91 | variable ScriptBaseName "ActiveHDL" 92 | } 93 | 94 | } elseif {$ToolExecutableName eq "vish" || $ToolExecutableName eq "vsimk"} { 95 | variable ScriptBaseName "Siemens" 96 | 97 | # if {![catch {vsimId} msg]} { 98 | # variable ToolVersion [vsimId] 99 | # } else { 100 | # set VersionString [exec vsim -version &2>1] 101 | # regexp {(vsim\s+)(\d+\.\d+\S*)} $VersionString s1 s2 s3 102 | # variable ToolVersion $s3 103 | # } 104 | 105 | # if {[expr [string compare $ToolVersion "2025.2"] >= 0]} { } ;# if next code is universally supported keep it. 106 | if {![catch {qsim -version} msg]} { 107 | variable ScriptBaseName "Questa" 108 | } 109 | # if {[info exists ::env(OSVVM_TOOL)]} { 110 | # if {$::env(OSVVM_TOOL) eq "Visualizer"} { 111 | # variable ScriptBaseName $::env(OSVVM_TOOL) 112 | # } 113 | # } 114 | 115 | } elseif {$ToolExecutableName eq "hdlclient"} { 116 | # variable ScriptBaseName "Visualizer" 117 | variable ScriptBaseName "Questa" 118 | 119 | } elseif {[string match -nocase $ToolExecutableName "vivado"]} { 120 | variable ScriptBaseName "Vivado" 121 | 122 | } else { 123 | variable ScriptBaseName "GHDL" 124 | # now done at beginning 125 | # if {[info exists ::env(OSVVM_TOOL)]} { 126 | # variable ScriptBaseName $::env(OSVVM_TOOL) 127 | # } 128 | } 129 | } 130 | 131 | source ${::osvvm::OsvvmScriptDirectory}/StartUpShared.tcl 132 | 133 | set ::osvvm::OsvvmInitialized "true" 134 | 135 | puts -nonewline "" ; # suppress printing of true from above line 136 | -------------------------------------------------------------------------------- /VendorScripts_Vivado.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_Vivado.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # Rob Gaddi email: rgaddi@highlandtechnology.com 9 | # 10 | # Description 11 | # Tcl procedures for Xilinx Vivado with the intent of making running 12 | # compiling and simulations tool independent 13 | # 14 | # Revision History: 15 | # Date Version Description 16 | # 5/2024 2024.05 Added ToolVersion variable 17 | # 2/2022 2022.02 Added template of procedures needed for coverage support 18 | # 4/2021 2021.02 Initial revision, tested under Vivado 2020.1 19 | # 20 | # 21 | # This file is part of OSVVM. 22 | # 23 | # Copyright (c) 2021-2022 by SynthWorks Design Inc. 24 | # 25 | # Licensed under the Apache License, Version 2.0 (the "License"); 26 | # you may not use this file except in compliance with the License. 27 | # You may obtain a copy of the License at 28 | # 29 | # https://www.apache.org/licenses/LICENSE-2.0 30 | # 31 | # Unless required by applicable law or agreed to in writing, software 32 | # distributed under the License is distributed on an "AS IS" BASIS, 33 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | # See the License for the specific language governing permissions and 35 | # limitations under the License. 36 | # 37 | 38 | # ------------------------------------------------- 39 | # Tool Settings 40 | # 41 | variable ToolType "synthesis" 42 | variable ToolVendor "Xilinx" 43 | variable ToolName "Vivado" 44 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 45 | variable ToolVersion [version -short] 46 | variable ToolNameVersion ${ToolName}-${ToolVersion} 47 | # puts $ToolNameVersion 48 | 49 | # Quite unfortunately, much of Vivado doesn't support VHDL-2008 properly. 50 | # Therefore the default assumption has to be for VHDL-2002 51 | variable DefaultVHDLVersion 2002 52 | 53 | # Try to get the default library name from the open project, but we can 54 | # fall back to a hard-coded default if necessary. 55 | #if {[catch set XILINX_LIB [get_property DEFAULT_LIB [current_project]]} { 56 | # set XILINX_LIB xil_defaultlib 57 | #} 58 | 59 | # ------------------------------------------------- 60 | # StartTranscript / StopTranscxript 61 | # 62 | 63 | # Haven't been able to find any way to get Vivado to support transcript control 64 | # However, it is a convenient hook to use to suppress some warning messages 65 | # that are otherwise tacky. 66 | 67 | proc vendor_StartTranscript {FileName} { 68 | # WARNING: [filemgmt 56-12] File ... cannot be added to the project because 69 | # it already exists in the project, skipping this file 70 | set_msg_config -id {filemgmt 56-12} -suppress -quiet 71 | } 72 | 73 | proc vendor_StopTranscript {FileName} { 74 | reset_msg_config -id {filemgmt 56-12} -default_severity -quiet 75 | } 76 | 77 | # ------------------------------------------------- 78 | # IsVendorCommand 79 | # 80 | proc IsVendorCommand {LineOfText} { 81 | 82 | return 0 83 | # return [regexp {xvhdl|xelab|xsim} $LineOfText] 84 | } 85 | 86 | # ------------------------------------------------- 87 | # SetCoverageAnalyzeOptions 88 | # SetCoverageCoverageOptions 89 | # 90 | proc vendor_SetCoverageAnalyzeDefaults {} { 91 | variable CoverageAnalyzeOptions 92 | # set defaults here 93 | } 94 | 95 | proc vendor_SetCoverageSimulateDefaults {} { 96 | variable CoverageSimulateOptions 97 | # set defaults here 98 | } 99 | 100 | # ------------------------------------------------- 101 | # Library 102 | # 103 | 104 | # Vivado doesn't maintain library files per se, so there's nothing to do. 105 | 106 | proc vendor_library {LibraryName PathToLib} {} 107 | proc vendor_LinkLibrary {LibraryName PathToLib} {} 108 | proc vendor_UnlinkLibrary {LibraryName PathToLib} {} 109 | 110 | # ------------------------------------------------- 111 | # analyze 112 | # 113 | 114 | proc vendor_analyze_vhdl {LibraryName FileName args} { 115 | variable VhdlVersion 116 | if {$VhdlVersion eq "2008"} { 117 | set f [read_vhdl -library $LibraryName -vhdl2008 $FileName] 118 | } else { 119 | set f [read_vhdl -library $LibraryName $FileName] 120 | } 121 | 122 | if {$f eq {}} { 123 | # The file was already present in the project, so update the parameters 124 | set f [get_files $FileName] 125 | set_property LIBRARY $LibraryName $f 126 | if {$VhdlVersion eq "2008"} { 127 | set_property FILE_TYPE {VHDL 2008} $f 128 | } else { 129 | set_property FILE_TYPE {VHDL} $f 130 | } 131 | } 132 | } 133 | 134 | proc vendor_analyze_verilog {LibraryName FileName args} { 135 | set f [read_verilog -library $LibraryName {*}${args} $FileName] 136 | if {$f eq {}} { 137 | # The file was already present in the project, so update the parameters 138 | set f [get_files $FileName] 139 | set_property LIBRARY $LibraryName $f 140 | } 141 | } 142 | 143 | # ------------------------------------------------- 144 | # End Previous Simulation 145 | # 146 | 147 | # ------------------------------------------------- 148 | # Simulate 149 | 150 | # Since Vivado simulator doesn't support OSVVM, don't even attempt to do 151 | # any simulation stuff; just stub it. 152 | 153 | proc vendor_end_previous_simulation {} {} 154 | proc vendor_simulate {LibraryName LibraryUnit args} {} 155 | 156 | # ------------------------------------------------- 157 | # Merge Coverage 158 | # 159 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 160 | # set CoverageFileBaseName [file join ${CoverageDirectory} ${BuildName} ${TestSuiteName}] 161 | # set CovFiles [glob -nocomplain ${CoverageDirectory}/${TestSuiteName}/*.acdb] 162 | # if {$CovFiles ne ""} { 163 | # acdb merge -o ${CoverageFileBaseName}.acdb -i {*}[join $CovFiles " -i "] 164 | # } 165 | } 166 | 167 | proc vendor_ReportCodeCoverage {TestSuiteName ResultsDirectory} { 168 | # acdb report -html -i ${ResultsDirectory}/${TestSuiteName}.acdb -o ${ResultsDirectory}/${TestSuiteName}_code_cov.html 169 | } 170 | 171 | proc vendor_GetCoverageFileName {TestName} { 172 | set CoverageFileName ${TestName}_code_cov.html 173 | return $CoverageFileName 174 | } 175 | -------------------------------------------------------------------------------- /OsvvmScriptsSimulateSupport.tcl: -------------------------------------------------------------------------------- 1 | # File Name: OsvvmScriptsSimulateSupport.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures that support the OSVVM "simulate" command 11 | # A slow migragation of procedures from OsvvmScriptsCore (which is way to big) 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 6/2025 2025.06 Refactored Simulate Support Scripts from OsvvmScriptsCore.tcl 23 | # 24 | # 25 | # This file is part of OSVVM. 26 | # 27 | # Copyright (c) 2025 by SynthWorks Design Inc. 28 | # 29 | # Licensed under the Apache License, Version 2.0 (the "License"); 30 | # you may not use this file except in compliance with the License. 31 | # You may obtain a copy of the License at 32 | # 33 | # https://www.apache.org/licenses/LICENSE-2.0 34 | # 35 | # Unless required by applicable law or agreed to in writing, software 36 | # distributed under the License is distributed on an "AS IS" BASIS, 37 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 | # See the License for the specific language governing permissions and 39 | # limitations under the License. 40 | # 41 | 42 | 43 | namespace eval ::osvvm { 44 | 45 | variable ScriptFile 46 | 47 | # ------------------------------------------------- 48 | # SimulateCreateDoFile 49 | # called in vendor_simulate in "-do file.tcl" simulators 50 | # Creates a script file that includes files that are found here 51 | # 52 | proc SimulateCreateDoFile {LibraryUnit} { 53 | variable OsvvmScriptDirectory 54 | variable CurrentSimulationDirectory 55 | variable CurrentWorkingDirectory 56 | 57 | set NormalizedSimulationDirectory [file normalize $CurrentSimulationDirectory] 58 | set NormalizedWorkingDirectory [file normalize $CurrentWorkingDirectory] 59 | set NormalizedScriptDirectory [file normalize $OsvvmScriptDirectory] 60 | 61 | SimulateCreateSubScripts ${LibraryUnit} ${CurrentWorkingDirectory} 62 | if {${NormalizedSimulationDirectory} ne ${NormalizedWorkingDirectory}} { 63 | SimulateCreateSubScripts ${LibraryUnit} ${CurrentSimulationDirectory} 64 | } 65 | if {(${NormalizedScriptDirectory} ne ${NormalizedWorkingDirectory}) && (${NormalizedScriptDirectory} ne ${NormalizedSimulationDirectory})} { 66 | SimulateCreateSubScripts ${LibraryUnit} ${OsvvmScriptDirectory} 67 | } 68 | } 69 | 70 | proc SimulateCreateSubScripts {LibraryUnit Directory} { 71 | variable TestCaseName 72 | variable ToolVendor 73 | variable ToolName 74 | variable NoGui 75 | 76 | ScriptCreateIfFileExists [file join ${Directory} ${ToolVendor}.tcl] 77 | ScriptCreateIfFileExists [file join ${Directory} ${ToolName}.tcl] 78 | if {! $NoGui} { 79 | ScriptCreateIfWaveDoExists [file join ${Directory} wave.do] $LibraryUnit 80 | } 81 | ScriptCreateIfFileExists [file join ${Directory} ${LibraryUnit}.tcl] 82 | ScriptCreateIfFileExists [file join ${Directory} ${LibraryUnit}_${ToolName}.tcl] 83 | if {$TestCaseName ne $LibraryUnit} { 84 | ScriptCreateIfFileExists [file join ${Directory} ${TestCaseName}.tcl] 85 | ScriptCreateIfFileExists [file join ${Directory} ${TestCaseName}_${ToolName}.tcl] 86 | } 87 | } 88 | 89 | proc ScriptCreateIfWaveDoExists {ScriptToRun LibraryUnit} { 90 | variable ScriptFile 91 | 92 | if {[file exists $ScriptToRun]} { 93 | puts $ScriptFile " if {[catch {source $ScriptToRun} errorMsg]} {" 94 | puts $ScriptFile " CallbackOnError_WaveDo \$errorMsg \$::errorInfo [file dirname $ScriptToRun] $LibraryUnit" 95 | puts $ScriptFile " }" 96 | } 97 | } 98 | 99 | proc ScriptCreateIfFileExists {ScriptToRun} { 100 | variable ScriptFile 101 | 102 | if {[file exists $ScriptToRun]} { 103 | puts $ScriptFile " source ${ScriptToRun}" 104 | } 105 | } 106 | 107 | 108 | # ------------------------------------------------- 109 | # SimulateRunScripts - 110 | # called from vendor_simulate of command line based simulators 111 | # Runs the script files that are found here as simulate is running 112 | # 113 | proc SimulateRunScripts {LibraryUnit} { 114 | variable OsvvmScriptDirectory 115 | variable CurrentSimulationDirectory 116 | variable CurrentWorkingDirectory 117 | 118 | set NormalizedSimulationDirectory [file normalize $CurrentSimulationDirectory] 119 | set NormalizedWorkingDirectory [file normalize $CurrentWorkingDirectory] 120 | set NormalizedScriptDirectory [file normalize $OsvvmScriptDirectory] 121 | 122 | SimulateRunSubScripts ${LibraryUnit} ${CurrentWorkingDirectory} 123 | if {${NormalizedSimulationDirectory} ne ${NormalizedWorkingDirectory}} { 124 | SimulateRunSubScripts ${LibraryUnit} ${CurrentSimulationDirectory} 125 | } 126 | if {(${NormalizedScriptDirectory} ne ${NormalizedWorkingDirectory}) && (${NormalizedScriptDirectory} ne ${NormalizedSimulationDirectory})} { 127 | SimulateRunSubScripts ${LibraryUnit} ${OsvvmScriptDirectory} 128 | } 129 | } 130 | 131 | proc SimulateRunSubScripts {LibraryUnit Directory} { 132 | variable TestCaseName 133 | variable ToolVendor 134 | variable ToolName 135 | variable NoGui 136 | 137 | RunIfFileExists [file join ${Directory} ${ToolVendor}.tcl] 138 | RunIfFileExists [file join ${Directory} ${ToolName}.tcl] 139 | if {! $NoGui} { 140 | if {[catch {RunIfFileExists [file join ${Directory} wave.do]} errorMsg]} { 141 | CallbackOnError_WaveDo $errorMsg $::errorInfo $Directory $LibraryUnit 142 | } 143 | } 144 | SimulateRunDesignScripts ${LibraryUnit} ${Directory} 145 | if {$TestCaseName ne $LibraryUnit} { 146 | SimulateRunDesignScripts ${TestCaseName} ${Directory} 147 | } 148 | } 149 | 150 | proc SimulateRunDesignScripts {TestName Directory} { 151 | variable ToolName 152 | 153 | RunIfFileExists [file join ${Directory} ${TestName}.tcl] 154 | RunIfFileExists [file join ${Directory} ${TestName}_${ToolName}.tcl] 155 | } 156 | 157 | proc RunIfFileExists {ScriptToRun} { 158 | if {[file exists $ScriptToRun]} { 159 | source ${ScriptToRun} 160 | } 161 | } 162 | 163 | 164 | 165 | 166 | # Exports - here mainly it is for testing only 167 | namespace export CreateSimulateDoFile 168 | 169 | 170 | # end namespace ::osvvm 171 | } 172 | -------------------------------------------------------------------------------- /ReportIndex2Html.tcl: -------------------------------------------------------------------------------- 1 | # File Name: ReportBuildDict2Html.tcl 2 | # Purpose: Convert OSVVM YAML build reports to HTML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Convert OSVVM Build Dictionary into HTML Build Report 11 | # Visible externally: ReportBuildDict2Html 12 | # Must call ReportBuildYaml2Dict first. 13 | # 14 | # Developed by: 15 | # SynthWorks Design Inc. 16 | # VHDL Training Classes 17 | # OSVVM Methodology and Model Library 18 | # 11898 SW 128th Ave. Tigard, Or 97223 19 | # http://www.SynthWorks.com 20 | # 21 | # Revision History: 22 | # Date Version Description 23 | # 06/2025 2025.06 Initial Revision 24 | # 25 | # 26 | # This file is part of OSVVM. 27 | # 28 | # Copyright (c) 2025 by SynthWorks Design Inc. 29 | # 30 | # Licensed under the Apache License, Version 2.0 (the "License"); 31 | # you may not use this file except in compliance with the License. 32 | # You may obtain a copy of the License at 33 | # 34 | # https://www.apache.org/licenses/LICENSE-2.0 35 | # 36 | # Unless required by applicable law or agreed to in writing, software 37 | # distributed under the License is distributed on an "AS IS" BASIS, 38 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39 | # See the License for the specific language governing permissions and 40 | # limitations under the License. 41 | # 42 | 43 | package require yaml 44 | 45 | 46 | 47 | # ------------------------------------------------- 48 | # Index2Html 49 | # 50 | proc Index2Html {} { 51 | variable ResultsFile 52 | variable IndexDict 53 | 54 | # Read the YAML file into a dictionary 55 | set IndexDict [dict get [::yaml::yaml2dict -file ${::osvvm::OsvvmIndexYamlFile}] Builds] 56 | 57 | # Open results file 58 | set ResultsFile [open $::osvvm::OsvvmIndexHtmlFile w] 59 | 60 | # Convert YAML file to HTML & catch results 61 | set ErrorCode [catch {LocalIndex2Html} errmsg] 62 | 63 | # Close Results file - done here s.t. it is closed even if it fails 64 | close $ResultsFile 65 | 66 | if {$ErrorCode} { 67 | CallbackOnError_Index2Html $::osvvm::OsvvmIndexHtmlFile $errmsg 68 | } 69 | } 70 | 71 | # ------------------------------------------------- 72 | # LocalIndex2Html 73 | # 74 | proc LocalIndex2Html {} { 75 | variable ResultsFile 76 | variable IndexDict 77 | variable FirstBuildName 78 | 79 | set FirstBuildName [dict get [lindex $IndexDict 0] Name] 80 | # CreateOsvvmReportHeader $ResultsFile "Index of Builds" [file join $::osvvm::OutputBaseDirectory $FirstBuildName] 1 81 | CreateOsvvmReportHeader $ResultsFile "Index of Builds" $FirstBuildName 1 82 | 83 | CreateBuildIndexHeader 84 | 85 | CreateBuildIndexSummary 86 | 87 | CreateOsvvmReportFooter $ResultsFile 88 | } 89 | 90 | 91 | # ------------------------------------------------- 92 | # CreateBuildIndexHeader 93 | # 94 | proc CreateBuildIndexHeader {} { 95 | variable ResultsFile 96 | 97 | puts $ResultsFile "
" 98 | puts $ResultsFile " " 99 | puts $ResultsFile " " 100 | puts $ResultsFile " " 101 | puts $ResultsFile " " 102 | puts $ResultsFile " " 103 | puts $ResultsFile " " 104 | puts $ResultsFile " " 105 | puts $ResultsFile " " 106 | puts $ResultsFile " " 107 | puts $ResultsFile " " 108 | puts $ResultsFile " " 109 | puts $ResultsFile " " 110 | puts $ResultsFile " " 111 | puts $ResultsFile " " 112 | puts $ResultsFile " " 113 | puts $ResultsFile " " 114 | puts $ResultsFile " " 115 | puts $ResultsFile " " 116 | 117 | } 118 | 119 | 120 | # ------------------------------------------------- 121 | # CreateBuildIndexSummary 122 | # 123 | proc CreateBuildIndexSummary {} { 124 | variable ResultsFile 125 | variable IndexDict 126 | variable FirstBuildName 127 | 128 | puts $ResultsFile " " 129 | 130 | foreach BuildItem $IndexDict { 131 | set BuildItemName [dict get $BuildItem Name] 132 | set BuildStatus [dict get $BuildItem Status] 133 | 134 | set PassedClass "" 135 | set FailedClass "" 136 | if { ${BuildStatus} eq "PASSED" } { 137 | set StatusClass "class=\"passed\"" 138 | set PassedClass "class=\"passed\"" 139 | } elseif { ${BuildStatus} eq "FAILED" } { 140 | set StatusClass "class=\"failed\"" 141 | set FailedClass "class=\"failed\"" 142 | } else { 143 | set StatusClass "class=\"skipped\"" 144 | } 145 | 146 | puts $ResultsFile " " 147 | # puts $ResultsFile " " 148 | puts $ResultsFile " " 149 | puts $ResultsFile " " 150 | puts $ResultsFile " " 151 | puts $ResultsFile " " 152 | puts $ResultsFile " " 153 | set BuildElapsedTime [dict get $BuildItem Elapsed] 154 | puts $ResultsFile " " 155 | puts $ResultsFile " " 156 | puts $ResultsFile " " 157 | puts $ResultsFile " " 158 | puts $ResultsFile " " 159 | puts $ResultsFile " " 160 | puts $ResultsFile " " 161 | } 162 | puts $ResultsFile " " 163 | puts $ResultsFile "
BuildStatusTest CasesElapsed
Time
Analyze
Errors
Simulate
Errors
SimulatorOSVVM
Version
Date
PASSED FAILED SKIPPED
${BuildItemName}${BuildItemName}$BuildStatus[dict get $BuildItem Passed] [dict get $BuildItem Failed] [dict get $BuildItem Skipped][format %d:%02d:%02d [expr ($BuildElapsedTime/(60*60))] [expr (($BuildElapsedTime/60)%60)] [expr (${BuildElapsedTime}%60)]] [dict get $BuildItem AnalyzeErrorCount][dict get $BuildItem SimulateErrorCount][dict get $BuildItem ToolName]-[dict get $BuildItem ToolVersion][dict get $BuildItem OsvvmVersion][dict get $BuildItem FinishTime]
" 164 | puts $ResultsFile "
" 165 | 166 | 167 | } 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /VendorScripts_DSim.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_Xsim.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures with the intent of making running 11 | # compiling and simulations tool independent 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 5/2024 2024.05 Added ToolVersion variable 23 | # 04/2024 2024.04 Created from VendorScripts_xxx.tcl 24 | # 25 | # 26 | # This file is part of OSVVM. 27 | # 28 | # Copyright (c) 2018 - 2024 by SynthWorks Design Inc. 29 | # 30 | # Licensed under the Apache License, Version 2.0 (the "License"); 31 | # you may not use this file except in compliance with the License. 32 | # You may obtain a copy of the License at 33 | # 34 | # https://www.apache.org/licenses/LICENSE-2.0 35 | # 36 | # Unless required by applicable law or agreed to in writing, software 37 | # distributed under the License is distributed on an "AS IS" BASIS, 38 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39 | # See the License for the specific language governing permissions and 40 | # limitations under the License. 41 | # 42 | 43 | 44 | # ------------------------------------------------- 45 | # Tool Settings 46 | # 47 | variable ToolType "simulator" 48 | variable ToolVendor "Xilinx" 49 | variable ToolName "DSim" 50 | variable ToolVersion 2024.04 51 | variable ToolNameVersion ${ToolName}-2024.04 ;# produces "DSim-2024.04" 52 | # variable ToolNameVersion ${ToolName}-${ToolVersion} ;# produces "DSim-2023.2" 53 | # puts $ToolNameVersion 54 | 55 | 56 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 57 | 58 | 59 | # ------------------------------------------------- 60 | # StartTranscript / StopTranscript 61 | # 62 | 63 | # 64 | # With these commented out, it uses DefaultVendor_StartTranscript and DefaultVendor_StopTranscript 65 | # 66 | 67 | # # # With this commented out, it will run the DefaultVendor_StartTranscript 68 | # # proc vendor_StartTranscript {FileName} { 69 | # # # Do nothing - for now 70 | # # } 71 | # # # 72 | # # proc vendor_StopTranscript {FileName} { 73 | # # # This will have everything from a session rather than just the current build. 74 | # # # OK for bring up 75 | # # file copy -force vivado.log ${FileName} 76 | # # } 77 | 78 | # ------------------------------------------------- 79 | # IsVendorCommand 80 | # 81 | proc IsVendorCommand {LineOfText} { 82 | 83 | return [regexp {^dlib|^dvhcom|^dsim} $LineOfText] 84 | } 85 | 86 | # ------------------------------------------------- 87 | # SetCoverageAnalyzeOptions 88 | # SetCoverageCoverageOptions 89 | # 90 | proc vendor_SetCoverageAnalyzeDefaults {} { 91 | variable CoverageAnalyzeOptions 92 | # set defaults here 93 | } 94 | 95 | proc vendor_SetCoverageSimulateDefaults {} { 96 | variable CoverageSimulateOptions 97 | # set defaults here 98 | } 99 | 100 | 101 | # ------------------------------------------------- 102 | # Library 103 | # 104 | proc vendor_library {LibraryName PathToLib} { 105 | set PathAndLib ${PathToLib}/${LibraryName} 106 | CreateDirectory $PathAndLib 107 | vendor_LinkLibrary $LibraryName ${PathToLib} 108 | } 109 | 110 | 111 | proc vendor_LinkLibrary {LibraryName PathToLib} { 112 | set PathAndLib ${PathToLib}/${LibraryName} 113 | 114 | # Policy: If library is already in library list, then skip this for Riviera 115 | if {[IsLibraryInList $LibraryName] < 0} { 116 | if {[file exists ${PathAndLib}]} { 117 | set ResolvedLib ${PathAndLib} 118 | } else { 119 | set ResolvedLib ${PathToLib} 120 | } 121 | puts "dlib map -lib $LibraryName $PathAndLib" 122 | dlib map -lib $LibraryName $PathAndLib 123 | } 124 | } 125 | 126 | proc vendor_UnlinkLibrary {LibraryName PathToLib} { 127 | # Do something here to unmap the library 128 | } 129 | 130 | # ------------------------------------------------- 131 | # analyze 132 | # 133 | proc vendor_analyze_vhdl {LibraryName FileName args} { 134 | variable VhdlVersion 135 | variable VhdlLibraryFullPath 136 | 137 | set DebugOptions "" 138 | 139 | set AnalyzeOptions [concat -${VhdlVersion} {*}${DebugOptions} -lib ${LibraryName} {*}${args} ${FileName}] 140 | puts "dvhcom {*}$AnalyzeOptions" 141 | if {[catch {exec dvhcom {*}$AnalyzeOptions} AnalyzeErrorMessage]} { 142 | PrintWithPrefix "Error:" $AnalyzeMessage 143 | error "Failed: analyze $FileName" 144 | } else { 145 | puts $AnalyzeMessage 146 | } 147 | } 148 | 149 | proc vendor_analyze_verilog {LibraryName FileName args} { 150 | # Untested branch for Verilog - will need adjustment 151 | puts "Verilog is not supported for now" 152 | # eval vlog -work ${LibraryName} ${FileName} 153 | } 154 | 155 | # ------------------------------------------------- 156 | # End Previous Simulation 157 | # 158 | proc vendor_end_previous_simulation {} { 159 | # quit -sim 160 | # framework.documents.closeall -vhdl 161 | } 162 | 163 | # ------------------------------------------------- 164 | # Simulate 165 | # 166 | proc vendor_simulate {LibraryName LibraryUnit args} { 167 | variable OsvvmScriptDirectory 168 | variable SimulateTimeUnits 169 | variable ToolVendor 170 | 171 | set ElaborateOptions [concat -timescale 1${SimulateTimeUnits} -top ${LibraryName}.${LibraryUnit} ${::osvvm::SecondSimulationTopLevel} {*}${args} {*}$::osvvm::GenericOptions] 172 | puts "dsim {*}$ElaborateOptions" 173 | if {[catch {exec dsim {*}$ElaborateOptions} ElaborateMessage]} { 174 | PrintWithPrefix "Elaborate Error:" $ElaborateMessage 175 | error "Failed: simulate $LibraryUnit" 176 | } else { 177 | puts $ElaborateMessage 178 | } 179 | } 180 | 181 | # ------------------------------------------------- 182 | proc vendor_generic {Name Value} { 183 | 184 | # return "-generic_top \"${Name}=${Value}\"" 185 | return "-defparams ${Name}=${Value}" 186 | } 187 | 188 | 189 | # ------------------------------------------------- 190 | # Merge Coverage 191 | # 192 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 193 | # set CoverageFileBaseName [file join ${CoverageDirectory} ${BuildName} ${TestSuiteName}] 194 | # set CovFiles [glob -nocomplain ${CoverageDirectory}/${TestSuiteName}/*.acdb] 195 | # if {$CovFiles ne ""} { 196 | # acdb merge -o ${CoverageFileBaseName}.acdb -i {*}[join $CovFiles " -i "] 197 | # } 198 | } 199 | 200 | proc vendor_ReportCodeCoverage {TestSuiteName ResultsDirectory} { 201 | # acdb report -html -i ${ResultsDirectory}/${TestSuiteName}.acdb -o ${ResultsDirectory}/${TestSuiteName}_code_cov.html 202 | } 203 | 204 | proc vendor_GetCoverageFileName {TestName} { 205 | set CoverageFileName ${TestName}_code_cov.html 206 | return $CoverageFileName 207 | } 208 | -------------------------------------------------------------------------------- /Requirements2Csv.tcl: -------------------------------------------------------------------------------- 1 | # File Name: Requirements2Csv.tcl 2 | # Purpose: Create HTML for Requirements 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Visible externally: Requirements2Csv 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 07/2023 2023.07 Initial Revision 22 | # 23 | # 24 | # This file is part of OSVVM. 25 | # 26 | # Copyright (c) 2023 by SynthWorks Design Inc. 27 | # 28 | # Licensed under the Apache License, Version 2.0 (the "License"); 29 | # you may not use this file except in compliance with the License. 30 | # You may obtain a copy of the License at 31 | # 32 | # https://www.apache.org/licenses/LICENSE-2.0 33 | # 34 | # Unless required by applicable law or agreed to in writing, software 35 | # distributed under the License is distributed on an "AS IS" BASIS, 36 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37 | # See the License for the specific language governing permissions and 38 | # limitations under the License. 39 | # 40 | 41 | package require yaml 42 | 43 | proc Requirements2Csv {RequirementsYamlFile} { 44 | variable ResultsFile 45 | 46 | if {[file exists $RequirementsYamlFile]} { 47 | set FileRoot [file rootname $RequirementsYamlFile] 48 | set CsvFileName ${FileRoot}.csv 49 | set ResultsFile [open ${CsvFileName} w] 50 | set ReportName [regsub {_req} [file tail $FileRoot] ""] 51 | set ErrorCode [catch {LocalRequirements2Csv $RequirementsYamlFile $ReportName} errmsg] 52 | close $ResultsFile 53 | 54 | if {$ErrorCode} { 55 | CallbackOnError_AnyReport "Requirements2Csv" "RequirementsYamlFile: $RequirementsYamlFile" $errmsg 56 | } 57 | } 58 | } 59 | 60 | 61 | proc LocalRequirements2Csv {RequirementsYamlFile ReportName} { 62 | variable ResultsFile 63 | 64 | set Requirements2Dict [::yaml::yaml2dict -file ${RequirementsYamlFile}] 65 | 66 | # CSV only for merged Requirements which are already sorted 67 | # set Requirements2Dict [lsort -index 1 $UnsortedRequirements2Dict] 68 | 69 | foreach item $Requirements2Dict { 70 | set Requirement [dict get $item Requirement] 71 | set TestCases [dict get $item TestCases] 72 | set NumTestCases [llength $TestCases] 73 | if {$NumTestCases == 1} { 74 | set TestCase [lindex $TestCases 0] 75 | WriteOneRequirementCsv $TestCase $Requirement 76 | } else { 77 | WriteMergeTestCaseCsv $TestCases $Requirement 78 | } 79 | } 80 | 81 | } 82 | 83 | 84 | proc WriteOneRequirementCsv {TestCase {Requirement ""}} { 85 | variable ResultsFile 86 | 87 | set TestName [dict get $TestCase TestName] 88 | set Status [dict get $TestCase Status] 89 | set ResultsDict [dict get $TestCase Results] 90 | set Goal [dict get $ResultsDict Goal] 91 | set Passed [dict get $ResultsDict Passed] 92 | set TotalErrors [dict get $ResultsDict Errors] 93 | set Checked [dict get $ResultsDict Checked] 94 | 95 | set AlertCount [dict get $ResultsDict AlertCount] 96 | set AlertFailure [dict get $AlertCount Failure] 97 | set AlertError [dict get $AlertCount Error] 98 | set AlertWarning [dict get $AlertCount Warning] 99 | set DisabledAlertCount [dict get $ResultsDict DisabledAlertCount] 100 | set DisabledAlertFailure [dict get $DisabledAlertCount Failure] 101 | set DisabledAlertError [dict get $DisabledAlertCount Error] 102 | set DisabledAlertWarning [dict get $DisabledAlertCount Warning] 103 | 104 | set Failures [expr {$AlertFailure + $DisabledAlertFailure}] 105 | set Errors [expr {$AlertError + $DisabledAlertError }] 106 | set Warnings [expr {$AlertWarning + $DisabledAlertWarning}] 107 | 108 | puts $ResultsFile "$Requirement, $Goal, $Passed, $TotalErrors, $Failures, $Errors, $Warnings, $Checked" 109 | } 110 | 111 | proc WriteMergeTestCaseCsv { TestCases {Requirement ""}} { 112 | variable ResultsFile 113 | 114 | set TestName Merged 115 | set Status PASSED 116 | set Goal 0 117 | set Passed 0 118 | set TotalErrors 0 119 | set Checked 0 120 | 121 | set AlertFailure 0 122 | set AlertError 0 123 | set AlertWarning 0 124 | set DisabledAlertFailure 0 125 | set DisabledAlertError 0 126 | set DisabledAlertWarning 0 127 | 128 | foreach TestCase $TestCases { 129 | set CurStatus [dict get $TestCase Status] 130 | set ResultsDict [dict get $TestCase Results] 131 | set CurGoal [dict get $ResultsDict Goal] 132 | set DictPassed [dict get $ResultsDict Passed] 133 | set CurPassed [expr {$DictPassed < $CurGoal ? $DictPassed : $CurGoal}] 134 | set CurErrors [dict get $ResultsDict Errors] 135 | set CurChecked [dict get $ResultsDict Checked] 136 | set AlertCount [dict get $ResultsDict AlertCount] 137 | set CurAlertFailure [dict get $AlertCount Failure] 138 | set CurAlertError [dict get $AlertCount Error] 139 | set CurAlertWarning [dict get $AlertCount Warning] 140 | set DisabledAlertCount [dict get $ResultsDict DisabledAlertCount] 141 | set CurDisabledAlertFailure [dict get $DisabledAlertCount Failure] 142 | set CurDisabledAlertError [dict get $DisabledAlertCount Error] 143 | set CurDisabledAlertWarning [dict get $DisabledAlertCount Warning] 144 | 145 | if {$CurStatus eq "FAILED"} { 146 | set Status "FAILED" 147 | } 148 | set Goal [expr {$Goal > $CurGoal ? $Goal : $CurGoal}] 149 | set Passed [expr {$Passed + $CurPassed}] 150 | set TotalErrors [expr {$TotalErrors + $CurErrors}] 151 | set Checked [expr {$Checked + $CurChecked}] 152 | 153 | set AlertFailure [expr {$AlertFailure + $CurAlertFailure}] 154 | set AlertError [expr {$AlertError + $CurAlertError}] 155 | set AlertWarning [expr {$AlertWarning + $CurAlertWarning}] 156 | set DisabledAlertFailure [expr {$DisabledAlertFailure + $CurDisabledAlertFailure}] 157 | set DisabledAlertError [expr {$DisabledAlertError + $CurDisabledAlertError}] 158 | set DisabledAlertWarning [expr {$DisabledAlertWarning + $CurDisabledAlertWarning}] 159 | } 160 | 161 | set Failures [expr {$AlertFailure + $DisabledAlertFailure}] 162 | set Errors [expr {$AlertError + $DisabledAlertError }] 163 | set Warnings [expr {$AlertWarning + $DisabledAlertWarning}] 164 | 165 | puts $ResultsFile "$Requirement, $Goal, $Passed, $TotalErrors, $Failures, $Errors, $Warnings, $Checked" 166 | } 167 | -------------------------------------------------------------------------------- /ReportSimulate2Html.tcl: -------------------------------------------------------------------------------- 1 | # File Name: Simulate2Html.tcl 2 | # Purpose: Convert OSVVM Alert and Coverage results to HTML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Convert OSVVM Alert, Coverage, and Scoreboard results to HTML 11 | # Visible externally: Simulate2Html 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 07/2024 2024.07 Changed *List to *Dict for Scoreboard and Generic 23 | # 05/2024 2024.05 Refactored. Separating file copy from creating HTML. New Call interface. 24 | # 04/2024 2024.04 Updated report formatting 25 | # 03/2024 2024.03 Updated handling of TranscriptFile to account for simulator still having it open (due to abnormal exit) 26 | # 07/2023 2023.07 Updated OpenSimulationReportFile to search for user defined HTML headers 27 | # 02/2023 2023.02 CreateDirectory if results/ does not exist 28 | # 12/2022 2022.12 Refactored to minimize dependecies on other scripts. 29 | # 05/2022 2022.05 Updated directory handling 30 | # 03/2022 2022.03 Added Transcript File reporting. 31 | # 02/2022 2022.02 Added Scoreboard Reports. Updated YAML file handling. 32 | # 10/2021 Initial Initial Revision 33 | # 34 | # This file is part of OSVVM. 35 | # 36 | # Copyright (c) 2021 - 2024 by SynthWorks Design Inc. 37 | # 38 | # Licensed under the Apache License, Version 2.0 (the "License"); 39 | # you may not use this file except in compliance with the License. 40 | # You may obtain a copy of the License at 41 | # 42 | # https://www.apache.org/licenses/LICENSE-2.0 43 | # 44 | # Unless required by applicable law or agreed to in writing, software 45 | # distributed under the License is distributed on an "AS IS" BASIS, 46 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 47 | # See the License for the specific language governing permissions and 48 | # limitations under the License. 49 | # 50 | 51 | package require yaml 52 | package require fileutil 53 | 54 | 55 | #-------------------------------------------------------------- 56 | proc Simulate2Html {SettingsFileWithPath} { 57 | variable ResultsFile 58 | 59 | variable Report2AlertYamlFile 60 | # variable Report2RequirementsYamlFile 61 | variable Report2CovYamlFile 62 | 63 | 64 | GetTestCaseSettings $SettingsFileWithPath 65 | 66 | set TestCaseFileName $::osvvm::Report2TestCaseFileName 67 | set TestCaseName $::osvvm::Report2TestCaseName 68 | set TestSuiteName $::osvvm::Report2TestSuiteName 69 | set BuildName $::osvvm::Report2BuildName 70 | set GenericDict $::osvvm::Report2GenericDict 71 | 72 | 73 | 74 | CreateTestCaseSummaryTable ${TestCaseName} ${TestSuiteName} ${BuildName} ${GenericDict} 75 | 76 | if {[file exists ${Report2AlertYamlFile}]} { 77 | Alert2Html ${TestCaseName} ${TestSuiteName} ${Report2AlertYamlFile} 78 | } 79 | 80 | # if {[file exists ${Report2RequirementsYamlFile}]} { 81 | # # Generate Test Case requirements file - redundant as reported as alerts too. 82 | # Requirements2Html ${Report2RequirementsYamlFile} $TestCaseName $TestSuiteName ;# this form deprecated 83 | # } 84 | 85 | if {[file exists ${Report2CovYamlFile}]} { 86 | Cov2Html ${TestCaseName} ${TestSuiteName} ${Report2CovYamlFile} 87 | } 88 | 89 | if {$::osvvm::Report2ScoreboardDict ne ""} { 90 | foreach {SbName SbFile} ${::osvvm::Report2ScoreboardDict} { 91 | Scoreboard2Html ${TestCaseName} ${TestSuiteName} ${SbFile} Scoreboard_${SbName} 92 | } 93 | } 94 | 95 | FinalizeSimulationReportFile 96 | } 97 | 98 | #-------------------------------------------------------------- 99 | proc OpenSimulationReportFile {FileName {initialize 0}} { 100 | variable ResultsFile 101 | 102 | if { $initialize } { 103 | set ResultsFile [open ${FileName} w] 104 | } else { 105 | set ResultsFile [open ${FileName} a] 106 | } 107 | } 108 | 109 | #-------------------------------------------------------------- 110 | proc CreateTestCaseSummaryTable {TestCaseName TestSuiteName BuildName GenericDict} { 111 | variable ResultsFile 112 | 113 | OpenSimulationReportFile [file join $::osvvm::Report2TestCaseHtml] 1 114 | 115 | set ErrorCode [catch {LocalCreateTestCaseSummaryTable $TestCaseName $TestSuiteName $BuildName $GenericDict} errmsg] 116 | 117 | close $ResultsFile 118 | 119 | if {$ErrorCode} { 120 | CallbackOnError_Simulate2HtmlHeader $TestSuiteName $TestCaseName $errmsg 121 | } 122 | } 123 | 124 | #-------------------------------------------------------------- 125 | proc LocalCreateTestCaseSummaryTable {TestCaseName TestSuiteName BuildName GenericDict} { 126 | variable ResultsFile 127 | 128 | 129 | if {$::osvvm::Report2ReportsSubdirectory eq ""} { 130 | set ReportsPrefix ".." 131 | } else { 132 | set ReportsPrefix "../.." 133 | } 134 | 135 | CreateOsvvmReportHeader $ResultsFile "$TestCaseName Test Case Report" $ReportsPrefix 136 | 137 | 138 | puts $ResultsFile "
" 139 | puts $ResultsFile "
" 140 | puts $ResultsFile " " 141 | puts $ResultsFile " " 142 | puts $ResultsFile " " 143 | puts $ResultsFile " " 144 | puts $ResultsFile " " 145 | 146 | # Print the Generics 147 | if {${GenericDict} ne ""} { 148 | foreach {GenericName GenericValue} $GenericDict { 149 | puts $ResultsFile " " 150 | } 151 | } 152 | 153 | if {[file exists ${::osvvm::Report2AlertYamlFile}]} { 154 | puts $ResultsFile " " 155 | } 156 | if {[file exists ${::osvvm::Report2CovYamlFile}]} { 157 | puts $ResultsFile " " 158 | } 159 | 160 | if {$::osvvm::Report2ScoreboardDict ne ""} { 161 | foreach SbName [dict keys ${::osvvm::Report2ScoreboardDict}] { 162 | puts $ResultsFile " " 163 | } 164 | } 165 | 166 | # Add link to simulation results in HTML Log File 167 | if {$::osvvm::Report2SimulationHtmlLogFile ne ""} { 168 | set TestCaseLink "#${TestSuiteName}_${TestCaseName}${::osvvm::Report2GenericNames}" 169 | puts $ResultsFile " " 170 | } 171 | 172 | # Add link to Test Case file 173 | set TestCaseFile [::fileutil::relative $::osvvm::Report2ReportsDirectory $::osvvm::Report2TestCaseFile] 174 | set TestCaseFileTail [file tail $TestCaseFile] 175 | if {$::osvvm::Report2TestCaseFile ne ""} { 176 | puts $ResultsFile " " 177 | } 178 | 179 | # Add Transcript Filess to Table 180 | if {$::osvvm::Report2TranscriptFiles ne ""} { 181 | foreach TranscriptFile ${::osvvm::Report2TranscriptFiles} { 182 | set TranscriptFileName [file tail $TranscriptFile] 183 | puts $ResultsFile " " 184 | } 185 | } 186 | 187 | # Print link back to Build Summary Report 188 | if {$BuildName ne ""} { 189 | set BuildLink ${ReportsPrefix}/${BuildName}.html 190 | puts $ResultsFile " " 191 | } 192 | 193 | puts $ResultsFile " " 194 | puts $ResultsFile "
Available Reports
Generic: $GenericName = $GenericValue
Alert Report
Functional Coverage Report(s)
ScoreboardPkg_${SbName} Report(s)
Link to Simulation Results
$TestCaseFileTail
${TranscriptFileName}
${BuildName} Build Summary
" 195 | puts $ResultsFile "
" 196 | 197 | LinkLogoFile $ResultsFile $ReportsPrefix 198 | 199 | puts $ResultsFile "
" 200 | } 201 | 202 | proc FinalizeSimulationReportFile {} { 203 | variable ResultsFile 204 | 205 | OpenSimulationReportFile [file join $::osvvm::Report2TestCaseHtml] 206 | 207 | CreateOsvvmReportFooter $ResultsFile 208 | 209 | close $ResultsFile 210 | } 211 | -------------------------------------------------------------------------------- /ReportSupport.tcl: -------------------------------------------------------------------------------- 1 | # File Name: ReportSupport.tcl 2 | # Purpose: Convert OSVVM YAML build reports to HTML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # HTML Report Helpers 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 07/2024 2024.07 Updated variable naming. Changed GenericList to Report2GenericDict 22 | # 05/2024 2024.05 Initial Revision 23 | # 24 | # 25 | # This file is part of OSVVM. 26 | # 27 | # Copyright (c) 2024 by SynthWorks Design Inc. 28 | # 29 | # Licensed under the Apache License, Version 2.0 (the "License"); 30 | # you may not use this file except in compliance with the License. 31 | # You may obtain a copy of the License at 32 | # 33 | # https://www.apache.org/licenses/LICENSE-2.0 34 | # 35 | # Unless required by applicable law or agreed to in writing, software 36 | # distributed under the License is distributed on an "AS IS" BASIS, 37 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 | # See the License for the specific language governing permissions and 39 | # limitations under the License. 40 | # 41 | 42 | package require yaml 43 | 44 | # ------------------------------------------------- 45 | # CreateOsvvmReportHeader 46 | # 47 | proc CreateOsvvmReportHeader {ResultsFile ReportName {RelativePath ""} {IncludeLogo 0} } { 48 | 49 | puts $ResultsFile "" 50 | puts $ResultsFile "" 51 | puts $ResultsFile "" 52 | 53 | LinkCssFiles $ResultsFile $RelativePath 54 | 55 | puts $ResultsFile " $ReportName" 56 | puts $ResultsFile "" 57 | puts $ResultsFile "" 58 | if {$IncludeLogo} { 59 | puts $ResultsFile "
" 60 | puts $ResultsFile "
" 61 | puts $ResultsFile "
" 62 | puts $ResultsFile "

$ReportName

" 63 | puts $ResultsFile "
" 64 | 65 | LinkLogoFile $ResultsFile $RelativePath "requirements-logo" 66 | 67 | puts $ResultsFile "
" 68 | puts $ResultsFile "
" 69 | } else { 70 | puts $ResultsFile "
" 71 | puts $ResultsFile "

$ReportName

" 72 | puts $ResultsFile "
" 73 | } 74 | puts $ResultsFile "
" 75 | } 76 | 77 | # ------------------------------------------------- 78 | # CreateOsvvmReportFooter 79 | # 80 | proc CreateOsvvmReportFooter {ResultsFile} { 81 | puts $ResultsFile "
" 82 | puts $ResultsFile "" 87 | puts $ResultsFile "" 88 | puts $ResultsFile "" 89 | } 90 | 91 | # ------------------------------------------------- 92 | # FindHtmlThemeFiles 93 | # 94 | # proc FindHtmlThemeFiles {BaseDirectory CssTargetSubdirectory} { 95 | # variable Report2CssFiles 96 | # variable Report2PngFile 97 | # 98 | # # Note files are linked into the HTML in glob order (alphabetical but may be OS dependent WRT upper case) 99 | # set CssFiles [glob -nocomplain [file join ${BaseDirectory} ${CssTargetSubdirectory} *.css]] 100 | # set Report2CssFiles "" 101 | # if {$CssFiles ne ""} { 102 | # foreach CssFileWithPath ${CssFiles} { 103 | # set CssFile [file join $CssTargetSubdirectory [file tail $CssFileWithPath]] 104 | # lappend Report2CssFiles $CssFile 105 | # } 106 | # } 107 | # 108 | # # There should only be one *.png file. 109 | # set PngFiles [glob -nocomplain [file join ${BaseDirectory} ${CssTargetSubdirectory} *.png]] 110 | # set Report2PngFile "" 111 | # if {$PngFiles ne ""} { 112 | # foreach PngFileWithPath ${PngFiles} { 113 | # set PngDestFile [file join $CssTargetSubdirectory [file tail $PngFileWithPath]] 114 | # } 115 | # } 116 | # # There should be only one PNG file, so only copy the last one we find. 117 | # # file copy -force ${PngFileWithPath} [file join $BaseDirectory $CssTargetSubdirectory $PngFile] 118 | # set Report2PngFile $PngDestFile 119 | # } 120 | 121 | # ------------------------------------------------- 122 | # LinkCssFiles 123 | # 124 | proc LinkCssFiles {ResultsFile {RelativePath ""}} { 125 | variable Report2CssFiles 126 | 127 | # Note files are linked into the HTML in glob order (alphabetical but may be OS dependent WRT upper case) 128 | if {$Report2CssFiles ne ""} { 129 | foreach CssFile ${Report2CssFiles} { 130 | puts $ResultsFile " " 131 | } 132 | } 133 | } 134 | 135 | # ------------------------------------------------- 136 | # LinkLogoFile 137 | # 138 | proc LinkLogoFile {ResultsFile {RelativePath ""} {LogoClass "summary-logo"}} { 139 | variable Report2PngFile 140 | 141 | puts $ResultsFile "
" 142 | puts $ResultsFile " \"OSVVM" 143 | puts $ResultsFile "
" 144 | } 145 | 146 | # ------------------------------------------------- 147 | # GetOsvvmPathSettings 148 | # 149 | proc GetOsvvmPathSettings {TestDict} { 150 | set SettingsInfoDict [dict get $TestDict OsvvmSettingsInfo] 151 | variable ::osvvm::Report2BaseDirectory [dict get $SettingsInfoDict BaseDirectory] 152 | variable ::osvvm::Report2ReportsSubdirectory [dict get $SettingsInfoDict ReportsSubdirectory] 153 | # variable Report2HtmlThemeSubdirectory [dict get $SettingsInfoDict HtmlThemeSubdirectory] 154 | variable ::osvvm::Report2SimulationLogFile [dict get $SettingsInfoDict SimulationLogFile] 155 | variable ::osvvm::Report2SimulationHtmlLogFile [dict get $SettingsInfoDict SimulationHtmlLogFile] 156 | variable ::osvvm::Report2RequirementsSubdirectory [dict get $SettingsInfoDict RequirementsSubdirectory] 157 | variable ::osvvm::Report2CoverageSubdirectory [dict get $SettingsInfoDict CoverageSubdirectory] 158 | variable ::osvvm::Report2CssFiles [dict get $SettingsInfoDict Report2CssFiles] 159 | variable ::osvvm::Report2PngFile [dict get $SettingsInfoDict Report2PngFile] 160 | } 161 | 162 | # ------------------------------------------------- 163 | # GetTestCaseSettings 164 | # 165 | proc GetTestCaseSettings {SettingsFileName} { 166 | set TestDict [::yaml::yaml2dict -file ${SettingsFileName}] 167 | variable ::osvvm::Report2TestCaseName [dict get $TestDict TestCaseName ] 168 | variable ::osvvm::Report2TestCaseFile [dict get $TestDict TestCaseFile ] 169 | variable ::osvvm::Report2TestSuiteName [dict get $TestDict TestSuiteName ] 170 | variable ::osvvm::Report2BuildName [dict get $TestDict BuildName ] 171 | variable ::osvvm::Report2GenericDict [dict get $TestDict Generics ] 172 | 173 | variable ::osvvm::Report2TestCaseFileName [dict get $TestDict TestCaseFileName ] 174 | variable ::osvvm::Report2GenericNames [dict get $TestDict GenericNames ] 175 | 176 | variable ::osvvm::Report2TestSuiteDirectory [dict get $TestDict ReportsTestSuiteDirectory ] 177 | variable ::osvvm::Report2RequirementsYamlFile [dict get $TestDict RequirementsYamlFile] 178 | variable ::osvvm::Report2AlertYamlFile [dict get $TestDict AlertYamlFile ] 179 | variable ::osvvm::Report2CovYamlFile [dict get $TestDict CovYamlFile ] 180 | variable ::osvvm::Report2ScoreboardDict [dict get $TestDict ScoreboardDict ] 181 | variable ::osvvm::Report2TranscriptFiles [dict get $TestDict TranscriptFiles ] 182 | 183 | variable ::osvvm::Report2TestCaseHtml [file join $Report2TestSuiteDirectory ${Report2TestCaseFileName}.html] 184 | 185 | GetOsvvmPathSettings $TestDict 186 | 187 | variable ::osvvm::Report2ReportsDirectory [file normalize [file join $::osvvm::Report2BaseDirectory $::osvvm::Report2ReportsSubdirectory $::osvvm::Report2TestSuiteName]] 188 | } 189 | 190 | 191 | -------------------------------------------------------------------------------- /VendorScripts_VSimSA.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_VSimSA.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures with the intent of making running 11 | # compiling and simulations tool independent 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 5/2024 2024.05 Added ToolVersion variable 23 | # 5/2022 2022.05 Coverage report name based on TestCaseName rather than LibraryUnit 24 | # Updated variable naming 25 | # 2/2022 2022.02 Added Coverage Collection 26 | # 12/2021 2021.12 Updated to use relative paths. 27 | # 3/2021 2021.03 In Simulate, added optional scripts to run as part of simulate 28 | # 2/2021 2021.02 Refactored variable settings to here from ToolConfiguration.tcl 29 | # 7/2020 2020.07 Refactored tool execution for simpler vendor customization 30 | # 1/2020 2020.01 Updated Licenses to Apache 31 | # 2/2019 Beta Project descriptors in .pro which execute 32 | # as TCL scripts in conjunction with the library 33 | # procedures 34 | # 11/2018 Alpha Project descriptors in .files and .dirs files 35 | # 36 | # 37 | # This file is part of OSVVM. 38 | # 39 | # Copyright (c) 2018 - 2021 by SynthWorks Design Inc. 40 | # 41 | # Licensed under the Apache License, Version 2.0 (the "License"); 42 | # you may not use this file except in compliance with the License. 43 | # You may obtain a copy of the License at 44 | # 45 | # https://www.apache.org/licenses/LICENSE-2.0 46 | # 47 | # Unless required by applicable law or agreed to in writing, software 48 | # distributed under the License is distributed on an "AS IS" BASIS, 49 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50 | # See the License for the specific language governing permissions and 51 | # limitations under the License. 52 | # 53 | 54 | # ------------------------------------------------- 55 | # Tool Settings 56 | # 57 | variable ToolType "simulator" 58 | variable ToolVendor "Aldec" 59 | variable ToolName "VSimSA" 60 | # variable ToolName "ActiveHDL" 61 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 62 | variable ToolVersion [lindex [split $version] [llength $version]-1] 63 | variable ToolNameVersion ${ToolName}-${ToolVersion} 64 | # puts $ToolNameVersion 65 | 66 | if {[expr [string compare $ToolVersion "12.0"] >= 0]} { 67 | SetVHDLVersion 2019 68 | variable Support2019FilePath "true" 69 | } 70 | 71 | variable FunctionalCoverageIntegratedInSimulator "Aldec" 72 | 73 | if {[batch_mode]} { 74 | variable NoGui "true" 75 | } else { 76 | variable NoGui "false" 77 | } 78 | 79 | # ------------------------------------------------- 80 | # StartTranscript / StopTranscxript 81 | # 82 | proc vendor_StartTranscript {FileName} { 83 | transcript off 84 | puts "transcript to $FileName" 85 | transcript to $FileName 86 | } 87 | 88 | proc vendor_StopTranscript {FileName} { 89 | transcript to -off 90 | } 91 | 92 | # ------------------------------------------------- 93 | # IsVendorCommand 94 | # 95 | proc IsVendorCommand {LineOfText} { 96 | 97 | return [regexp {^alib |^amap |^acom |^alog |^asim |^vlib |^vmap |^vcom |^vlog |^vsim |^run |^acdb } $LineOfText] 98 | } 99 | 100 | # ------------------------------------------------- 101 | # SetCoverageAnalyzeOptions 102 | # SetCoverageCoverageOptions 103 | # 104 | proc vendor_SetCoverageAnalyzeDefaults {} { 105 | variable CoverageAnalyzeOptions 106 | # set CoverageAnalyzeOptions "-coverage sbmec" 107 | set CoverageAnalyzeOptions "-coverage sbm" 108 | } 109 | 110 | proc vendor_SetCoverageSimulateDefaults {} { 111 | variable CoverageSimulateOptions 112 | # set CoverageSimulateOptions "-acdb -acdb_cov sbmec -cc_all" 113 | set CoverageSimulateOptions "-acdb -acdb_cov sbm -cc_all" 114 | } 115 | 116 | 117 | # ------------------------------------------------- 118 | # Library 119 | # 120 | proc vendor_library {LibraryName PathToLib} { 121 | set PathAndLib ${PathToLib}/${LibraryName} 122 | 123 | if {![file exists ${PathAndLib}]} { 124 | puts "vlib ${PathAndLib}" 125 | vlib ${PathAndLib} 126 | # after 1000 127 | } 128 | puts "vmap $LibraryName ${PathAndLib}" 129 | vmap $LibraryName ${PathAndLib} 130 | } 131 | 132 | proc vendor_LinkLibrary {LibraryName PathToLib} { 133 | set PathAndLib ${PathToLib}/${LibraryName} 134 | 135 | if {[file exists ${PathAndLib}]} { 136 | set ResolvedLib ${PathAndLib} 137 | } else { 138 | set ResolvedLib ${PathToLib} 139 | } 140 | puts "vmap $LibraryName ${ResolvedLib}" 141 | vmap $LibraryName ${ResolvedLib} 142 | } 143 | 144 | proc vendor_UnlinkLibrary {LibraryName PathToLib} { 145 | vmap -del ${LibraryName} 146 | } 147 | 148 | # ------------------------------------------------- 149 | # analyze 150 | # 151 | proc vendor_analyze_vhdl {LibraryName FileName args} { 152 | variable VhdlVersion 153 | 154 | # For now, do not use -dbg flag with coverage. 155 | set DebugOptions "" 156 | 157 | set AnalyzeOptions [concat -${VhdlVersion} {*}${DebugOptions} -relax -work ${LibraryName} {*}${args} ${FileName}] 158 | 159 | puts "vcom $AnalyzeOptions" 160 | vcom {*}$AnalyzeOptions 161 | } 162 | 163 | proc vendor_analyze_verilog {LibraryName FileName args} { 164 | set AnalyzeOptions [concat [CreateVerilogLibraryParams "-l "] -work ${LibraryName} {*}${args} ${FileName}] 165 | puts "vlog $AnalyzeOptions" 166 | vlog {*}$AnalyzeOptions 167 | } 168 | 169 | # ------------------------------------------------- 170 | proc NoNullRangeWarning {} { 171 | return "-nowarn COMP96_0119" 172 | } 173 | 174 | # ------------------------------------------------- 175 | # End Previous Simulation 176 | # 177 | proc vendor_end_previous_simulation {} { 178 | endsim 179 | } 180 | 181 | # ------------------------------------------------- 182 | # Simulate 183 | # 184 | proc vendor_simulate {LibraryName LibraryUnit args} { 185 | variable OsvvmScriptDirectory 186 | variable SimulateTimeUnits 187 | variable ToolVendor 188 | variable TestSuiteName 189 | variable TestCaseFileName 190 | global aldec ; # required for matlab cosim 191 | 192 | puts "vendor simulate LN=$LibraryName LU=$LibraryUnit A=$args" 193 | set SimulateOptions [concat {*}${args} {*}${::osvvm::GenericOptions} -t $SimulateTimeUnits -lib ${LibraryName} ${LibraryUnit} ${::osvvm::SecondSimulationTopLevel}] 194 | 195 | puts "vsim ${SimulateOptions}" 196 | eval vsim {*}${SimulateOptions} 197 | 198 | SimulateRunScripts ${LibraryUnit} 199 | 200 | # VSimSA is a batch simulator 201 | # add log -r /* 202 | run -all 203 | 204 | # Save Coverage Information 205 | if {$::osvvm::CoverageEnable && $::osvvm::CoverageSimulateEnable} { 206 | acdb save -o ${::osvvm::CoverageDirectory}/${TestSuiteName}/${TestCaseFileName}.acdb -testname ${TestCaseFileName} 207 | } 208 | } 209 | 210 | # ------------------------------------------------- 211 | proc vendor_generic {Name Value} { 212 | 213 | return "-g${Name}=${Value}" 214 | } 215 | 216 | # ------------------------------------------------- 217 | # Merge Coverage 218 | # 219 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 220 | set CoverageFileBaseName [file join ${CoverageDirectory} ${BuildName} ${TestSuiteName}] 221 | set CovFiles [glob -nocomplain ${CoverageDirectory}/${TestSuiteName}/*.acdb] 222 | if {$CovFiles ne ""} { 223 | acdb merge -o ${CoverageFileBaseName}.acdb -i {*}[join $CovFiles " -i "] 224 | } 225 | } 226 | 227 | proc vendor_ReportCodeCoverage {TestSuiteName CodeCoverageDirectory} { 228 | set CodeCovResultsDir ${CodeCoverageDirectory}/${TestSuiteName}_code_cov 229 | if {[file exists ${CodeCovResultsDir}.html]} { 230 | file delete -force -- ${CodeCovResultsDir}.html 231 | } 232 | if {[file exists ${CodeCovResultsDir}_files]} { 233 | file delete -force -- ${CodeCovResultsDir}_files 234 | } 235 | acdb report -html -i ${CodeCoverageDirectory}/${TestSuiteName}.acdb -o ${CodeCovResultsDir}.html 236 | } 237 | 238 | proc vendor_GetCoverageFileName {TestName} { 239 | set CoverageFileName ${TestName}_code_cov.html 240 | return $CoverageFileName 241 | } 242 | -------------------------------------------------------------------------------- /VendorScripts_Xsim.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_Xsim.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Tcl procedures with the intent of making running 11 | # compiling and simulations tool independent 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 5/2024 2024.05 Added ToolVersion variable 23 | # 12/2023 2024.01 Updated as 2023.02's OSVVM support is looking good. 24 | # 05/2022 2022.05 Updated variable naming 25 | # 2/2022 2022.02 Added template of procedures needed for coverage support 26 | # 9/2021 2021.09 Created from VendorScripts_xxx.tcl 27 | # 28 | # 29 | # This file is part of OSVVM. 30 | # 31 | # Copyright (c) 2018 - 2023 by SynthWorks Design Inc. 32 | # 33 | # Licensed under the Apache License, Version 2.0 (the "License"); 34 | # you may not use this file except in compliance with the License. 35 | # You may obtain a copy of the License at 36 | # 37 | # https://www.apache.org/licenses/LICENSE-2.0 38 | # 39 | # Unless required by applicable law or agreed to in writing, software 40 | # distributed under the License is distributed on an "AS IS" BASIS, 41 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42 | # See the License for the specific language governing permissions and 43 | # limitations under the License. 44 | # 45 | 46 | 47 | # ------------------------------------------------- 48 | # Tool Settings 49 | # 50 | variable ToolType "simulator" 51 | variable ToolVendor "Xilinx" 52 | variable ToolName "XSIM" 53 | variable ToolVersion [version -short] 54 | variable ToolNameVersion ${ToolName}-${ToolVersion} 55 | # puts $ToolNameVersion 56 | 57 | # Make this version dependent when Xilinx starts supporting it 58 | variable ToolSupportsDeferredConstants "false" 59 | 60 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 61 | 62 | 63 | # ------------------------------------------------- 64 | # StartTranscript / StopTranscript 65 | # 66 | 67 | # 68 | # If uncomment the following will DefaultVendor_StartTranscript and DefaultVendor_StopTranscript 69 | # 70 | 71 | # XSIM 2024.2 uses tcl 8.6 so OSVVM's default logging should work 72 | # # With this commented out, it will run the DefaultVendor_StartTranscript 73 | # proc vendor_StartTranscript {FileName} { 74 | # # Do nothing - for now 75 | # } 76 | # # 77 | # proc vendor_StopTranscript {FileName} { 78 | # # This will have everything from a session rather than just the current build. 79 | # # OK for bring up 80 | # file copy -force vivado.log ${FileName} 81 | # } 82 | 83 | # ------------------------------------------------- 84 | # IsVendorCommand 85 | # 86 | proc IsVendorCommand {LineOfText} { 87 | 88 | return [regexp {^xvhdl|^xelab|^xsim} $LineOfText] 89 | } 90 | 91 | # ------------------------------------------------- 92 | # SetCoverageAnalyzeOptions 93 | # SetCoverageCoverageOptions 94 | # 95 | proc vendor_SetCoverageAnalyzeDefaults {} { 96 | variable CoverageAnalyzeOptions 97 | # set defaults here 98 | } 99 | 100 | proc vendor_SetCoverageSimulateDefaults {} { 101 | variable CoverageSimulateOptions 102 | # set defaults here 103 | } 104 | 105 | 106 | # ------------------------------------------------- 107 | # Library 108 | # 109 | proc vendor_library {LibraryName PathToLib} { 110 | # set PathAndLib ${PathToLib}/${LibraryName} 111 | # 112 | # if {![file exists ${PathAndLib}]} { 113 | # puts "file mkdir ${PathAndLib}" 114 | # puts "" > ${PathAndLib} 115 | # eval file mkdir ${PathAndLib} 116 | # } 117 | # if {![file exists ./compile/${LibraryName}.epr]} { 118 | # puts vmap $LibraryName ${PathAndLib} 119 | # eval vmap $LibraryName ${PathAndLib} 120 | # } 121 | } 122 | 123 | proc vendor_LinkLibrary {LibraryName PathToLib} {} 124 | proc vendor_UnlinkLibrary {LibraryName PathToLib} {} 125 | 126 | # ------------------------------------------------- 127 | # analyze 128 | # 129 | proc vendor_analyze_vhdl {LibraryName FileName args} { 130 | variable VhdlVersion 131 | variable VhdlLibraryFullPath 132 | 133 | set DebugOptions "" 134 | 135 | set AnalyzeOptions [concat -${VhdlVersion} {*}${DebugOptions} -work ${LibraryName} {*}${args} ${FileName}] 136 | puts "xvhdl {*}$AnalyzeOptions" 137 | # exec xvhdl {*}$AnalyzeOptions 138 | if {[catch {exec xvhdl {*}$AnalyzeOptions 2>@1} AnalyzeMessage]} { 139 | PrintWithPrefix "Error:" $AnalyzeMessage 140 | error "Failed: analyze $FileName" 141 | } else { 142 | puts $AnalyzeMessage 143 | } 144 | } 145 | 146 | proc vendor_analyze_verilog {LibraryName FileName args} { 147 | # Untested branch for Verilog - will need adjustment 148 | puts "Verilog is not supported for now" 149 | # eval vlog -work ${LibraryName} ${FileName} 150 | } 151 | 152 | # ------------------------------------------------- 153 | # End Previous Simulation 154 | # 155 | proc vendor_end_previous_simulation {} { 156 | # quit -sim 157 | # framework.documents.closeall -vhdl 158 | } 159 | 160 | # ------------------------------------------------- 161 | # Simulate 162 | # 163 | proc vendor_simulate {LibraryName LibraryUnit args} { 164 | variable OsvvmScriptDirectory 165 | variable SimulateTimeUnits 166 | variable ToolVendor 167 | 168 | set ElaborateOptions [concat -timeprecision_vhdl 1${SimulateTimeUnits} -mt auto ${LibraryName}.${LibraryUnit} ${::osvvm::SecondSimulationTopLevel} {*}${args} {*}$::osvvm::GenericOptions -runall] 169 | puts "xelab {*}$ElaborateOptions" 170 | if {[catch {exec xelab {*}$ElaborateOptions 2>@1} ElaborateMessage]} { 171 | PrintWithPrefix "Elaborate Error:" $ElaborateMessage 172 | error "Failed: simulate $LibraryUnit" 173 | } else { 174 | puts $ElaborateMessage 175 | } 176 | 177 | ## This Works## # Patrick suggests that we do this one rather than the above 12/9/2022 178 | ## This Works## # set ElaborateOptions "-timeprecision_vhdl 1${SimulateTimeUnits} -mt off ${LibraryName}.${LibraryUnit} -snapshot ${LibraryName}_${LibraryUnit}" 179 | ## This Works## set ElaborateOptions "-timeprecision_vhdl 1${SimulateTimeUnits} -mt auto ${LibraryName}.${LibraryUnit} -snapshot ${LibraryName}_${LibraryUnit}" 180 | ## This Works## puts "xelab {*}$ElaborateOptions" 181 | ## This Works## # exec xelab {*}$ElaborateOptions 182 | ## This Works## if {[catch {exec xelab {*}$ElaborateOptions 2>@1} ElaborateMessage]} { 183 | ## This Works## PrintWithPrefix "Elaborate Error:" $ElaborateMessage 184 | ## This Works## error "Failed: simulate $LibraryUnit" 185 | ## This Works## } else { 186 | ## This Works## puts $ElaborateMessage 187 | ## This Works## } 188 | ## This Works## 189 | ## This Works## set SimulateOptions "-runall ${LibraryName}_${LibraryUnit}" 190 | ## This Works## puts "xsim {*}$SimulateOptions" 191 | ## This Works## # exec xsim {*}$SimulateOptions 192 | ## This Works## if { [catch {exec xsim {*}$SimulateOptions 2>@1} SimulateMessage]} { 193 | ## This Works## # error "Failed: simulate $LibraryUnit" 194 | ## This Works## PrintWithPrefix "Error:" $SimulateMessage 195 | ## This Works## error "Failed: simulate $LibraryUnit" 196 | ## This Works## } else { 197 | ## This Works## puts $SimulateMessage 198 | ## This Works## } 199 | } 200 | 201 | # ------------------------------------------------- 202 | proc vendor_generic {Name Value} { 203 | 204 | # return "-generic_top \"${Name}=${Value}\"" 205 | return "-generic_top ${Name}=${Value}" 206 | } 207 | 208 | 209 | # ------------------------------------------------- 210 | # Merge Coverage 211 | # 212 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 213 | # set CoverageFileBaseName [file join ${CoverageDirectory} ${BuildName} ${TestSuiteName}] 214 | # set CovFiles [glob -nocomplain ${CoverageDirectory}/${TestSuiteName}/*.acdb] 215 | # if {$CovFiles ne ""} { 216 | # acdb merge -o ${CoverageFileBaseName}.acdb -i {*}[join $CovFiles " -i "] 217 | # } 218 | } 219 | 220 | proc vendor_ReportCodeCoverage {TestSuiteName ResultsDirectory} { 221 | # acdb report -html -i ${ResultsDirectory}/${TestSuiteName}.acdb -o ${ResultsDirectory}/${TestSuiteName}_code_cov.html 222 | } 223 | 224 | proc vendor_GetCoverageFileName {TestName} { 225 | set CoverageFileName ${TestName}_code_cov.html 226 | return $CoverageFileName 227 | } 228 | -------------------------------------------------------------------------------- /OsvvmSettingsRequired.tcl: -------------------------------------------------------------------------------- 1 | # File Name: OsvvmSettingsRequired.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Required initializations for variables. 11 | # DO NOT CHANGE THESE. 12 | # For things users can change, see OsvvmDefaultSettings.tcl 13 | # 14 | # Developed by: 15 | # SynthWorks Design Inc. 16 | # VHDL Training Classes 17 | # OSVVM Methodology and Model Library 18 | # 11898 SW 128th Ave. Tigard, Or 97223 19 | # http://www.SynthWorks.com 20 | # 21 | # Revision History: 22 | # Date Version Description 23 | # 7/2024 2024.07 Set FailOnNoChecks and ClockResetVersion if not already set in OsvvmSettingsLocal (user defined) 24 | # Naming updates. Added WaveFiles default. 25 | # 3/2024 2024.03 Revision Update for release 26 | # Added default values for argc, argv, argv0 for questa -batch 27 | # Sets OsvvmVersionCompatibility if it is not set in LocalScriptDefaults.tcl 28 | # 1/2023 2023.01 Added OsvvmHomeDirectory and OsvvmCoSimDirectory. 29 | # Added options for CoSim 30 | # 5/2022 2022.05 Refactored Variable handling 31 | # 32 | # 33 | # This file is part of OSVVM. 34 | # 35 | # Copyright (c) 2022 - 2025 by SynthWorks Design Inc. 36 | # 37 | # Licensed under the Apache License, Version 2.0 (the "License"); 38 | # you may not use this file except in compliance with the License. 39 | # You may obtain a copy of the License at 40 | # 41 | # https://www.apache.org/licenses/LICENSE-2.0 42 | # 43 | # Unless required by applicable law or agreed to in writing, software 44 | # distributed under the License is distributed on an "AS IS" BASIS, 45 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 46 | # See the License for the specific language governing permissions and 47 | # limitations under the License. 48 | # 49 | # 50 | # DO NOT CHANGE THESE SETTINGS 51 | # These settings are required by OSVVM to function properly 52 | # For user settings use LocalScriptDefaults.tcl. 53 | # If you do not have a LocalScriptDefaults.tcl, 54 | # copy Example_LocalScriptDefaults.tcl to LocalScriptDefaults.tcl 55 | # 56 | 57 | namespace eval ::osvvm { 58 | 59 | variable OsvvmVersion 2025.06a 60 | variable OsvvmBuildYamlVersion 2025.02 61 | variable OsvvmTestCaseYamlVersion 1.0 62 | # The following are set in VHDL code. Either need to pass these or have it directly in the VHDL Code. 63 | variable OsvvmAlertYamlVersion InVhdlCodeVersionTbd 64 | variable OsvvmCoverageYamlVersion InVhdlCodeVersionTbd 65 | variable OsvvmScoreboardYamlVersion InVhdlCodeVersionTbd 66 | variable OsvvmRequirementsYamlVersion InVhdlCodeVersionTbd ;# file is an array of requirements - version not possible w/o file change 67 | 68 | if {![info exists OsvvmVersionCompatibility]} { 69 | variable OsvvmVersionCompatibility $OsvvmVersion 70 | } 71 | if {![info exists FailOnNoChecks]} { 72 | variable FailOnNoChecks [expr [string compare $OsvvmVersionCompatibility "2024.07"] >= 0] 73 | } 74 | if {![info exists ClockResetVersion]} { 75 | variable ClockResetVersion $OsvvmVersionCompatibility 76 | } 77 | 78 | variable OsvvmTempOutputDirectory [file join $OutputBaseDirectory $OsvvmTempOutputSubdirectory] 79 | # Default OsvvmBuildOutputDirectory - otherwise it is [file join $OutputBaseDirectory $BuildName] 80 | variable DefaultBuildOutputDirectory [file join $OutputBaseDirectory $OsvvmTempOutputSubdirectory] 81 | variable OsvvmBuildOutputDirectory $DefaultBuildOutputDirectory 82 | 83 | # 84 | # Formalize settings in OsvvmDefaultSettings + LocalScriptDefaults 85 | # Call OSVVM functions to do parameter checking and normalization 86 | # 87 | if {![info exists VhdlVersion]} { 88 | SetVHDLVersion $DefaultVHDLVersion 89 | } 90 | # SetSimulatorResolution $SimulateTimeUnits ;# SimulateTimeUnits is the definitive value 91 | SetTranscriptType $TranscriptExtension 92 | SetLibraryDirectory $VhdlLibraryParentDirectory 93 | 94 | # 95 | # Set argv0, argv, and argc in the event the tool forgets to. 96 | # 97 | if {![info exists ::argv0]} { 98 | variable ::argv0 "" 99 | } 100 | if {![info exists ::argv]} { 101 | variable ::argv "" 102 | } 103 | if {![info exists ::argc]} { 104 | variable ::argc "" 105 | } 106 | 107 | 108 | # 109 | # Variables set by VendorScripts_***.tcl 110 | # Initialize values that were conditionally initialized 111 | # 112 | if {![info exists ToolArgs]} { 113 | variable ToolArgs "" 114 | } 115 | if {![info exists NoGui]} { 116 | variable NoGui "true" 117 | } 118 | if {![info exists ToolSupportsGenericPackages]} { 119 | variable ToolSupportsGenericPackages "true" 120 | } 121 | if {![info exists ToolSupportsDeferredConstants]} { 122 | variable ToolSupportsDeferredConstants "true" 123 | } 124 | 125 | # 126 | # Create derived directory paths 127 | variable OsvvmCoSimDirectory ${OsvvmHomeDirectory}/CoSim 128 | 129 | # The following directories are now dynamically created by CheckSimulationDirs - locate these in the build directory 130 | variable ReportsDirectory $InvalidDirectory 131 | variable ResultsDirectory $InvalidDirectory 132 | variable CoverageDirectory $InvalidDirectory 133 | 134 | # Dynamically created by StartTranscript 135 | variable LogDirectory $InvalidDirectory 136 | 137 | # 138 | # Initialize OSVVM Internals 139 | # 140 | # Wave files for a single simulation run - set by vendor_DoWaves for some simulators 141 | variable WaveFiles "" 142 | 143 | 144 | # 145 | # Extended TCL information about errors - for debugging 146 | # TCL's errorInfo is saved to these as build finishes 147 | # 148 | variable AnalyzeErrorInfo "" 149 | variable SimulateErrorInfo "" 150 | variable WaveErrorInfo "" 151 | variable BuildErrorInfo "" 152 | variable BuildReportErrorInfo "" 153 | variable SimulateReportErrorInfo "" 154 | variable Simulate2HtmlErrorInfo "" 155 | variable ReportErrorInfo "" 156 | variable Report2HtmlErrorInfo "" 157 | variable Report2JunitErrorInfo "" 158 | variable Log2OsvvmErrorInfo "" 159 | 160 | 161 | variable BuildStarted "false" ; # Detects if build is running and if build is called, call include instead 162 | variable HaveNotCreatedBuildOutputDirectory "true" 163 | variable BuildName "" 164 | variable BuildStatus "FAILED" 165 | variable LastBuildName "" 166 | variable LastAnalyzedFile "" 167 | variable GenericDict "" 168 | variable GenericNames "" 169 | variable GenericOptions "" 170 | variable RunningCoSim "false" 171 | variable RanSimulationWithCoverage "false" 172 | 173 | if {![info exists Support2019FilePath]} { 174 | variable Support2019FilePath "false" 175 | } 176 | 177 | if {[catch {set OperatingSystemName [string tolower [exec uname]]} err]} { 178 | set OperatingSystemName windows 179 | } 180 | 181 | # OsvvmIndex...File - locates index.html for summarizing different builds 182 | variable OsvvmIndexYamlFile [file join ${::osvvm::OutputBaseDirectory} index.yml] 183 | variable OsvvmIndexHtmlFile [file rootname ${::osvvm::OsvvmIndexYamlFile}].html 184 | 185 | # OsvvmTempYamlFile: temporary OSVVM name. Moved to ${OutputBaseDirectory}/${BuildName}/${BuildName}.yaml when build finishes 186 | # Both VHDL and Scripts add to this file 187 | variable OsvvmTempYamlFile [file join ${OsvvmTempOutputDirectory} "OsvvmRun.yml"] ; 188 | 189 | # TempTranscriptYamlFile: temporary file that contains set of files used in TranscriptOpen. Deleted by scripts. 190 | variable TempTranscriptYamlFile [file join ${OsvvmTempOutputDirectory} "OSVVM_transcript.yml"] ; 191 | 192 | # OsvvmTempLogFile: temporary OSVVM name. Moved to ${OutputBaseDirectory}/${BuildName}/${LogSubDirectory}/${BuildName}.log when scripts complete 193 | # Created in temporary space since BuildName may not have been established yet. 194 | variable OsvvmTempLogFile [file join ${OsvvmTempOutputDirectory} "OsvvmBuild.log"] ; 195 | 196 | 197 | # Error handling 198 | variable AnalyzeErrorCount 0 199 | variable LastAnalyzeHasError FALSE 200 | variable ConsecutiveAnalyzeErrors 0 201 | variable SimulateErrorCount 0 202 | variable ConsecutiveSimulateErrors 0 203 | variable ScriptErrorCount 0 204 | 205 | variable GotTee false 206 | 207 | # Initial saved values for ErrorStopCounts 208 | variable SavedAnalyzeErrorStopCount $AnalyzeErrorStopCount 209 | variable SavedSimulateErrorStopCount $SimulateErrorStopCount 210 | 211 | } -------------------------------------------------------------------------------- /ReportCov2Html.tcl: -------------------------------------------------------------------------------- 1 | # File Name: Cov2Html.tcl 2 | # Purpose: Convert OSVVM YAML coverage information to HTML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Convert OSVVM YAML coverage information to HTML 11 | # Visible externally: Cov2Html 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 07/2024 2024.07 Updated handling of Coverage models with 0 weight 23 | # 05/2024 2024.05 Minor updates during Simulate2Html refactoring 24 | # 04/2024 2024.04 Updated report formatting 25 | # 06/2022 2022.06 Print PASSED/FAILED with Coverage HTML 26 | # 02/2022 2022.02 Updated YAML file handling 27 | # 01/2022 2022.01 Handling for All Range 28 | # 10/2021 Initial Initial Revision 29 | # 30 | # 31 | # This file is part of OSVVM. 32 | # 33 | # Copyright (c) 2021-2024 by SynthWorks Design Inc. 34 | # 35 | # Licensed under the Apache License, Version 2.0 (the "License"); 36 | # you may not use this file except in compliance with the License. 37 | # You may obtain a copy of the License at 38 | # 39 | # https://www.apache.org/licenses/LICENSE-2.0 40 | # 41 | # Unless required by applicable law or agreed to in writing, software 42 | # distributed under the License is distributed on an "AS IS" BASIS, 43 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 | # See the License for the specific language governing permissions and 45 | # limitations under the License. 46 | # 47 | 48 | package require yaml 49 | 50 | proc Cov2Html {TestCaseName TestSuiteName CovYamlFile} { 51 | variable ResultsFile 52 | 53 | OpenSimulationReportFile [file join $::osvvm::Report2TestCaseHtml] 54 | 55 | set ErrorCode [catch {LocalCov2Html $TestCaseName $TestSuiteName $CovYamlFile} errmsg] 56 | 57 | close $ResultsFile 58 | 59 | if {$ErrorCode} { 60 | CallbackOnError_Cov2Html $TestSuiteName $TestCaseName $errmsg 61 | } 62 | } 63 | 64 | proc LocalCov2Html {TestCaseName TestSuiteName CovYamlFile} { 65 | variable ResultsFile 66 | 67 | puts $ResultsFile "
" 68 | puts $ResultsFile "
" 69 | puts $ResultsFile "

$TestCaseName Coverage Report

" 70 | 71 | set TestDict [::yaml::yaml2dict -file ${CovYamlFile}] 72 | set VersionNum [dict get $TestDict Version] 73 | set CovSettings [dict get $TestDict Settings] 74 | set WritePassFail [dict get $CovSettings WritePassFail] 75 | set Coverage [dict get $TestDict Coverage] 76 | puts $ResultsFile "

Total Coverage: $Coverage

" 77 | set FoundZeroWeight FALSE 78 | 79 | foreach ModelDict [dict get $TestDict Models] { 80 | set ModelName [dict get $ModelDict Name] 81 | set CovModelSettings [dict get $ModelDict Settings] 82 | set CovWeight [dict get $CovModelSettings CovWeight] 83 | set IsRequirement [dict get $CovModelSettings IsRequirement] 84 | if {$CovWeight < 1} { 85 | if {!$FoundZeroWeight} { 86 | puts $ResultsFile "
Coverage Models with CovWeight = 0. Ignored in GetCov calculations. Used for OSVVM DelayCoverage. " 87 | set FoundZeroWeight TRUE 88 | } 89 | } 90 | puts $ResultsFile "
$ModelName Coverage Model     Coverage: [format %.1f [dict get $ModelDict Coverage]]" 91 | OsvvmCovInfo2Html $ModelName $CovModelSettings 92 | if {$IsRequirement || $WritePassFail} { 93 | set localWritePassFail 1 94 | } else { 95 | set localWritePassFail 0 96 | } 97 | OsvvmCovBins2Html $ModelName $ModelDict $localWritePassFail $CovWeight 98 | puts $ResultsFile "
" 99 | } 100 | if {$FoundZeroWeight} { 101 | puts $ResultsFile "
" 102 | } 103 | puts $ResultsFile "
" 104 | } 105 | 106 | proc OsvvmCovInfo2Html {ModelName CovModelSettings} { 107 | variable ResultsFile 108 | 109 | puts $ResultsFile "
" 110 | puts $ResultsFile "
$ModelName Coverage Settings" 111 | puts $ResultsFile " " 112 | puts $ResultsFile " " 113 | puts $ResultsFile " " 114 | puts $ResultsFile " " 115 | puts $ResultsFile " " 116 | puts $ResultsFile " " 117 | puts $ResultsFile " " 118 | puts $ResultsFile " " 119 | 120 | dict for {key val} ${CovModelSettings} { 121 | if {$key ne "Seeds"} { 122 | puts $ResultsFile " " 123 | } else { 124 | puts $ResultsFile " " 125 | } 126 | } 127 | 128 | puts $ResultsFile " " 129 | puts $ResultsFile "
SettingsValue
${key}${val}
${key}[lindex ${val} 0],  [lindex ${val} 1]
" 130 | puts $ResultsFile "
" 131 | puts $ResultsFile "
" 132 | } 133 | 134 | proc OsvvmCovBins2Html {ModelName ModelDict WritePassFail CovWeight} { 135 | variable ResultsFile 136 | 137 | set BinInfoDict [dict get $ModelDict BinInfo] 138 | set BinsArray [dict get $ModelDict Bins] 139 | 140 | puts $ResultsFile "
" 141 | puts $ResultsFile "
$ModelName Coverage Bins" 142 | puts $ResultsFile " " 143 | puts $ResultsFile " " 144 | puts $ResultsFile " " 145 | puts $ResultsFile " " 146 | puts $ResultsFile " " 147 | foreach Heading [dict get $BinInfoDict FieldNames] { 148 | puts $ResultsFile " " 149 | } 150 | puts $ResultsFile " " 151 | puts $ResultsFile " " 152 | puts $ResultsFile " " 153 | if {$WritePassFail} { 154 | puts $ResultsFile " " 155 | } 156 | puts $ResultsFile " " 157 | puts $ResultsFile " " 158 | puts $ResultsFile " " 159 | 160 | foreach BinDict $BinsArray { 161 | puts $ResultsFile " " 162 | puts $ResultsFile " " 163 | set CovType [dict get $BinDict Type] 164 | puts $ResultsFile " " 165 | set RangeArray [dict get $BinDict Range] 166 | foreach RangeDict $RangeArray { 167 | set MinRange [dict get $RangeDict Min] 168 | set MaxRange [dict get $RangeDict Max] 169 | if {${MinRange} == ${MaxRange}} { 170 | puts $ResultsFile " " 171 | } elseif {${MinRange} > -2147483647 && ${MaxRange} < 2147483647} { 172 | puts $ResultsFile " " 173 | } else { 174 | puts $ResultsFile " " 175 | } 176 | } 177 | set CovCount [dict get $BinDict Count] 178 | set CovAtLeast [dict get $BinDict AtLeast] 179 | puts $ResultsFile " " 180 | puts $ResultsFile " " 181 | puts $ResultsFile " " 182 | if {$WritePassFail} { 183 | if {$CovWeight > 0} { 184 | if {$CovType eq "COUNT"} { 185 | set CovPassed [expr {$CovCount >= $CovAtLeast}] 186 | } elseif {$CovType eq "ILLEGAL"} { 187 | set CovPassed [expr {$CovCount == 0}] 188 | } 189 | if {$CovType ne "IGNORE"} { 190 | if {$CovPassed} { 191 | puts $ResultsFile " " 192 | } else { 193 | puts $ResultsFile " " 194 | } 195 | } else { 196 | puts $ResultsFile " " 197 | } 198 | } else { 199 | puts $ResultsFile " " 200 | } 201 | } 202 | puts $ResultsFile " " 203 | } 204 | set NumBins [expr 5 + [llength $RangeArray]] 205 | puts $ResultsFile " " 206 | puts $ResultsFile " " 207 | puts $ResultsFile " " 208 | puts $ResultsFile " " 209 | puts $ResultsFile "
NameType${Heading}CountAtLeastPercent
Coverage
Status
[dict get $BinDict Name]$CovType${MinRange}${MinRange} to ${MaxRange}ALL$CovCount$CovAtLeast[format %.1f [dict get $BinDict PercentCov]]PASSEDFAILEDIGNORED-
Total Percent Coverage:   [format %.1f [dict get $ModelDict Coverage]]
" 210 | puts $ResultsFile "
" 211 | puts $ResultsFile "
" 212 | } 213 | -------------------------------------------------------------------------------- /StartUpShared.tcl: -------------------------------------------------------------------------------- 1 | # File Name: StartUpShared.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # StartUp scripts that are shared by any simulator 11 | # Called by StartUp and StartVCS, StartXcelium, ... 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 05/2024 2024.05 Updated for renaming during refactoring 23 | # 05/2022 2022.05 Refactored StartUp.tcl to remove items 24 | # shared by all StartUp scripts 25 | # 10/2021 2021.10 Loads OsvvmYamlSupport.tcl when YAML library available 26 | # Loads LocalScriptDefaults.tcl if it is in the OsvvmScriptDirectory 27 | # This is a optional user settings file. 28 | # LocalScriptsDefaults.tcl is not provided by OSVVM so your local settings will not be overwritten. 29 | # 2/2021 2021.02 Refactored. 30 | # - Initial tool settings now in VendorScripts_*.tcl (was in ToolConfiguration.tcl) 31 | # - Added: Default settings now in OsvvmScriptDefaults.tcl (was here) 32 | # - Removed: ToolConfiguration.tcl (now in StartUp.tcl and VendorScripts_*.tcl) 33 | # 7/2020 2020.07 Refactored tool execution for simpler vendor customization 34 | # 1/2020 2020.01 Updated Licenses to Apache 35 | # 2/2019 Beta Project descriptors in .pro which execute 36 | # 11/2018 Alpha Project descriptors in .files and .dirs files 37 | # as TCL scripts in conjunction with the library 38 | # procedures 39 | # 40 | # 41 | # This file is part of OSVVM. 42 | # 43 | # Copyright (c) 2018 - 2022 by SynthWorks Design Inc. 44 | # 45 | # Licensed under the Apache License, Version 2.0 (the "License"); 46 | # you may not use this file except in compliance with the License. 47 | # You may obtain a copy of the License at 48 | # 49 | # https://www.apache.org/licenses/LICENSE-2.0 50 | # 51 | # Unless required by applicable law or agreed to in writing, software 52 | # distributed under the License is distributed on an "AS IS" BASIS, 53 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 54 | # See the License for the specific language governing permissions and 55 | # limitations under the License. 56 | # 57 | 58 | namespace eval ::osvvm { 59 | 60 | # -------------------------------- 61 | # Set OsvvmScriptDirectory if it is not already set 62 | # -------------------------------- 63 | # Usage of SCRIPT_DIR is deprecated. 64 | if {![info exists OsvvmScriptDirectory]} { 65 | # if a calling script uses SCRIPT_DIR, this supports backward compatibility 66 | variable OsvvmScriptDirectory ${SCRIPT_DIR} 67 | } else { 68 | # if a user add on script uses SCRIPT_DIR, this supports backward compatibility 69 | variable SCRIPT_DIR ${OsvvmScriptDirectory} 70 | } 71 | variable OsvvmHomeDirectory [file normalize ${OsvvmScriptDirectory}/..] 72 | } 73 | 74 | variable OsvvmLibraries $::osvvm::OsvvmHomeDirectory 75 | 76 | # -------------------------------- 77 | # Load OSVVM Core API 78 | # -------------------------------- 79 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsCreateYamlReports.tcl ;# Helpers for creating YAML files 80 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsCore.tcl ;# OSVVM Core API 81 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsSimulateSupport.tcl ;# OSVVM Simulate Support Scripts - should this be called by OsvvmScriptsCore after proc simulate? 82 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsFileCreate.tcl ;# OSVVM API for file creation 83 | 84 | # -------------------------------- 85 | # Vendor personalization of OSVVM API 86 | # -------------------------------- 87 | namespace eval ::osvvm { 88 | source ${::osvvm::OsvvmScriptDirectory}/VendorScripts_${::osvvm::ScriptBaseName}.tcl 89 | } 90 | 91 | # -------------------------------- 92 | # Scripts to convert OSVVM Yaml outputs to HTML and XML files 93 | # -------------------------------- 94 | if {[catch {package require yaml}]} { 95 | source ${::osvvm::OsvvmScriptDirectory}/StartUpYamlMockReports.tcl 96 | } else { 97 | source ${::osvvm::OsvvmScriptDirectory}/StartUpYamlLoadReports.tcl 98 | } 99 | 100 | # -------------------------------- 101 | # Convert tool generated log files to HTML, ... 102 | # -------------------------------- 103 | source ${::osvvm::OsvvmScriptDirectory}/Log2Osvvm.tcl 104 | 105 | # -------------------------------- 106 | # CoSim API additions 107 | # -------------------------------- 108 | if {[file exists ${::osvvm::OsvvmScriptDirectory}/../CoSim]} { 109 | source ${::osvvm::OsvvmScriptDirectory}/../CoSim/Scripts/MakeVproc.tcl 110 | } 111 | 112 | 113 | # Import any procedure exported by previous OSVVM scripts 114 | namespace import ::osvvm::* 115 | 116 | 117 | # -------------------------------- 118 | # Settings: OsvvmSettings*.tcl 119 | # -------------------------------- 120 | # Settings First: OSVVM Default Settings 121 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsDefault.tcl 122 | 123 | # Get Directory for User settings 124 | variable ::osvvm::OsvvmUserSettingsDirectory [FindOsvvmSettingsDirectory "Scripts"] 125 | 126 | # Settings Second: OSVVM User/Project Customizations - not required 127 | if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal.tcl]} { 128 | # Found in OSVVM_SETTINGS_DIR 129 | source ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal.tcl 130 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal.tcl]} { 131 | # Deprecated. Found in Scripts Directory - backward compatible 132 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal.tcl 133 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults.tcl]} { 134 | # Deprecated: Uses old name - backward compatible 135 | source ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults.tcl 136 | } 137 | 138 | # Settings Third OSVVM User Simulator specific defaults - not required 139 | if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl]} { 140 | # Found in OSVVM_SETTINGS_DIR 141 | source ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl 142 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl]} { 143 | # Deprecated. Found in Scripts Directory - backward compatible 144 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl 145 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults_${::osvvm::ScriptBaseName}.tcl]} { 146 | # Deprecated: Uses old name - backward compatible 147 | source ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults_${::osvvm::ScriptBaseName}.tcl 148 | } 149 | 150 | # Settings Final OSVVM Finalize Settings - builds names that are dependent on other names 151 | source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsRequired.tcl 152 | 153 | 154 | # -------------------------------- 155 | # CallBacks & Error Handlers: Callback*.tcl 156 | # -------------------------------- 157 | # Callbacks First: OSVVM Default CallBacks 158 | source ${::osvvm::OsvvmScriptDirectory}/CallbackDefaults.tcl 159 | 160 | # Callbacks Second: OSVVM User/Project Customizations - not required 161 | if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks.tcl]} { 162 | # Found in OSVVM_SETTINGS_DIR 163 | source ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks.tcl 164 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks.tcl]} { 165 | # Deprecated. Found in Scripts Directory - backward compatible 166 | source ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks.tcl 167 | } 168 | 169 | 170 | # Callback Third: OSVVM User Simulator specific defaults - not required 171 | if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl]} { 172 | # Found in OSVVM_SETTINGS_DIR 173 | source ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl 174 | } elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl]} { 175 | # Deprecated. Found in Scripts Directory - backward compatible 176 | source ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl 177 | } 178 | 179 | 180 | # -------------------------------- 181 | # If the tee scripts load, mark them as available 182 | # -------------------------------- 183 | if {[catch {source ${::osvvm::OsvvmScriptDirectory}/tee.tcl}]} { 184 | variable ::osvvm::GotTee false 185 | } else { 186 | variable ::osvvm::GotTee true 187 | } 188 | 189 | puts "OSVVM Script Version: $::osvvm::OsvvmVersion" 190 | puts "Simulator Version: $::osvvm::ToolNameVersion" 191 | 192 | 193 | -------------------------------------------------------------------------------- /ReportBuildDict2Junit.tcl: -------------------------------------------------------------------------------- 1 | # File Name: ReportBuildDict2Junit.tcl 2 | # Purpose: Convert OSVVM YAML build reports to JUnit XML 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Convert OSVVM Build Dictionary into JUnit XML 11 | # Visible externally: ReportBuildDict2Junit 12 | # Must call ReportBuildYaml2Dict first. 13 | # 14 | # 15 | # Developed by: 16 | # SynthWorks Design Inc. 17 | # VHDL Training Classes 18 | # OSVVM Methodology and Model Library 19 | # 11898 SW 128th Ave. Tigard, Or 97223 20 | # http://www.SynthWorks.com 21 | # 22 | # Revision History: 23 | # Date Version Description 24 | # 07/2024 2024.07 Reporting for Affirm Counts and Generics 25 | # 05/2024 2024.05 Refactored. 26 | # 04/2024 2024.04 Updated report formatting 27 | # 12/2022 2022.12 Refactored to only use static OSVVM information 28 | # 10/2021 Initial Initial Revision 29 | # 30 | # 31 | # This file is part of OSVVM. 32 | # 33 | # Copyright (c) 2021-2024 by SynthWorks Design Inc. 34 | # 35 | # Licensed under the Apache License, Version 2.0 (the "License"); 36 | # you may not use this file except in compliance with the License. 37 | # You may obtain a copy of the License at 38 | # 39 | # https://www.apache.org/licenses/LICENSE-2.0 40 | # 41 | # Unless required by applicable law or agreed to in writing, software 42 | # distributed under the License is distributed on an "AS IS" BASIS, 43 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 | # See the License for the specific language governing permissions and 45 | # limitations under the License. 46 | # 47 | 48 | package require yaml 49 | 50 | # ------------------------------------------------- 51 | # ReportBuildDict2Junit 52 | # 53 | proc ReportBuildDict2Junit {} { 54 | variable ResultsFile 55 | variable ReportFileRoot 56 | 57 | set ResultsFile [open ${ReportFileRoot}.xml w] 58 | 59 | set ErrorCode [catch {LocalReportBuildDict2Junit} errmsg] 60 | 61 | close $ResultsFile 62 | 63 | if {$ErrorCode} { 64 | CallbackOnError_ReportBuildDict2Junit ${ReportFileRoot}.xml $errmsg 65 | } 66 | } 67 | 68 | # ------------------------------------------------- 69 | # LocalReportBuildDict2Junit 70 | # 71 | proc LocalReportBuildDict2Junit {} { 72 | variable ResultsFile 73 | variable BuildDict 74 | variable TestSuiteSummaryArrayOfDictionaries 75 | variable HaveTestSuites 76 | 77 | CreateJunitSummary $BuildDict 78 | 79 | if { $HaveTestSuites } { 80 | CreateJunitTestSuiteSummaries $BuildDict $TestSuiteSummaryArrayOfDictionaries 81 | } 82 | puts $ResultsFile "" 83 | } 84 | 85 | # ------------------------------------------------- 86 | # CreateJunitSummary 87 | # 88 | proc CreateJunitSummary {TestDict} { 89 | variable ResultsFile 90 | variable ReportBuildName 91 | 92 | variable ReportStartTime 93 | variable ReportIsoStartTime 94 | variable ElapsedTimeSeconds 95 | variable OsvvmVersion 96 | variable ReportSimulator 97 | variable ReportSimulatorVersion 98 | 99 | variable TestCasesPassed 100 | variable TestCasesFailed 101 | variable TestCasesSkipped 102 | variable TestCasesRun 103 | 104 | # Print Initial Build Summary 105 | # 106 | puts $ResultsFile "" 107 | puts $ResultsFile "" 118 | puts $ResultsFile " " 119 | puts $ResultsFile " " 120 | puts $ResultsFile " " 121 | puts $ResultsFile " " 122 | 123 | puts $ResultsFile " " 124 | 125 | } 126 | 127 | # ------------------------------------------------- 128 | # CreateJunitTestSuiteSummaries 129 | # 130 | proc CreateJunitTestSuiteSummaries {TestDict TestSuiteSummary } { 131 | variable ResultsFile 132 | variable TestSuiteName 133 | 134 | set Index 0 135 | foreach TestSuite [dict get $TestDict TestSuites] { 136 | CreateJunitTestCaseSummary [lindex $TestSuiteSummary $Index] 137 | incr Index 138 | 139 | foreach TestCase [dict get $TestSuite TestCases] { 140 | # 141 | # 142 | # 143 | 144 | set TestName [dict get $TestCase TestCaseName] 145 | 146 | if { [dict exists $TestCase Results] } { 147 | set TestResults [dict get $TestCase Results] 148 | if { [dict exists $TestResults AffirmCount] } { 149 | set AffirmCount [dict get $TestResults AffirmCount] 150 | } else { 151 | set AffirmCount 0 152 | } 153 | set TestStatus [dict get $TestCase Status] 154 | set VhdlName [dict get $TestCase Name] 155 | if { $TestStatus ne "SKIPPED" } { 156 | if {[dict exists $TestCase ElapsedTime]} { 157 | set ElapsedTime [dict get $TestCase ElapsedTime] 158 | } else { 159 | set ElapsedTime missing 160 | } 161 | } else { 162 | set ElapsedTime 0 163 | } 164 | set Reason "Test Case Error" 165 | } else { 166 | set TestStatus "FAILED" 167 | set VhdlName $TestName 168 | set ElapsedTime 0 169 | set AffirmCount 0 170 | set Reason "Test did not run" 171 | } 172 | 173 | if { ${TestName} ne ${VhdlName} } { 174 | set TestStatus "FAILED" 175 | set Reason "Name mismatch" 176 | } 177 | if { [dict exists $TestCase TestCaseFileName] } { 178 | set ResolvedTestName [dict get $TestCase TestCaseFileName] 179 | } else { 180 | set ResolvedTestName $TestName 181 | } 182 | 183 | puts $ResultsFile "" 190 | 191 | if { [dict exists $TestCase Generics] } { 192 | set TestCaseGenerics [dict get $TestCase Generics] 193 | if {${TestCaseGenerics} ne ""} { 194 | puts $ResultsFile " " 195 | foreach {GenericName GenericValue} $TestCaseGenerics { 196 | puts $ResultsFile " " 197 | } 198 | puts $ResultsFile " " 199 | } 200 | } 201 | 202 | if { $TestStatus eq "FAILED" } { 203 | puts $ResultsFile "$Reason" 204 | 205 | } elseif { $TestStatus eq "SKIPPED" } { 206 | set Reason [dict get $TestResults Reason] 207 | puts $ResultsFile "$Reason" 208 | } 209 | puts $ResultsFile "" 210 | } 211 | puts $ResultsFile "" 212 | } 213 | } 214 | 215 | # ------------------------------------------------- 216 | # CreateJunitTestCaseSummary 217 | # 218 | proc CreateJunitTestCaseSummary { TestSuiteSummaryDict } { 219 | variable ResultsFile 220 | variable TestSuiteName 221 | 222 | # Print testsuite information 223 | # 224 | set SuitePassed [dict get $TestSuiteSummaryDict PASSED] 225 | set SuiteFailed [dict get $TestSuiteSummaryDict FAILED] 226 | set SuiteSkipped [dict get $TestSuiteSummaryDict SKIPPED] 227 | set TestSuiteName [dict get $TestSuiteSummaryDict Name] 228 | puts $ResultsFile "" 237 | } 238 | 239 | # ------------------------------------------------- 240 | # Report2Junit - provided for backward compatibility 241 | # 242 | proc Report2Junit {BuildYamlFile} { 243 | ReportBuildYaml2Dict ${BuildYamlFile} 244 | ReportBuildDict2Junit 245 | } 246 | -------------------------------------------------------------------------------- /OsvvmSettingsDefault.tcl: -------------------------------------------------------------------------------- 1 | # File Name: OsvvmSettingsDefault.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Sets the defaults for the OSVVM Scripts 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 04/2024 2024.03 Renamed to OsvvmSettingsDefault.tcl 22 | # 05/2022 2022.05 Refactored to move variable settings from OsvvmProjectScripts 23 | # 02/2022 2022.02 Added call to SetTranscriptType to make HTML the default transcript 24 | # 2/2021 2021.02 Refactored Default Settings from StartUp.tcl 25 | # 26 | # 27 | # This file is part of OSVVM. 28 | # 29 | # Copyright (c) 2021 - 2024 by SynthWorks Design Inc. 30 | # 31 | # Licensed under the Apache License, Version 2.0 (the "License"); 32 | # you may not use this file except in compliance with the License. 33 | # You may obtain a copy of the License at 34 | # 35 | # https://www.apache.org/licenses/LICENSE-2.0 36 | # 37 | # Unless required by applicable law or agreed to in writing, software 38 | # distributed under the License is distributed on an "AS IS" BASIS, 39 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40 | # See the License for the specific language governing permissions and 41 | # limitations under the License. 42 | # 43 | 44 | 45 | # 46 | # DO NOT CHANGE THESE SETTINGS 47 | # This file is overwritten with each new release. 48 | # Instead, create a LocalScriptDefaults.tcl and change them there. 49 | # If you do not have a LocalScriptDefaults.tcl, 50 | # copy Example_LocalScriptDefaults.tcl to LocalScriptDefaults.tcl 51 | # 52 | 53 | 54 | # OSVVM Variable Defaults 55 | namespace eval ::osvvm { 56 | # 57 | # Initialize internal settings -- Do not change these 58 | # 59 | # CurrentWorkingDirectory is a relative path to the scripts currently running 60 | variable CurrentWorkingDirectory "" 61 | # CurrentSimulationDirectory is an absolute path to the simulation directory (for reports and such) 62 | variable CurrentSimulationDirectory "Invalid Initial Path !@#$%^&*()+=|><| Should be replaced By CheckWorkingDir" 63 | 64 | # 65 | # Directory structure and results file management 66 | # 67 | # OsvvmTempOutputDirectory is where temporary OSVVM output goes. 68 | # Caution: If you change the value of OsvvmTempOutputDirectory, you must rerun OsvvmLibraries/osvvm/osvvm.pro 69 | # Files only remain in this directory when a tool does not complete correctly 70 | variable OutputBaseDirectory "" ; # Container for all OSVVM ouput 71 | # variable OsvvmTempOutputSubdirectory "OsvvmTemp" 72 | # variable OsvvmTempOutputSubdirectory "OsvvmTemp_${ToolNameVersion}" ; # Temporary directory name. Renamed by BuildName 73 | variable OsvvmTempOutputSubdirectory "OsvvmTemp_${ToolName}" 74 | # variable LogSubdirectory "logs/${ToolNameVersion}" 75 | variable LogSubdirectory "logs" ; # With build directories does not need $ToolNameVersion. Was "logs/${ToolNameVersion}" 76 | variable ReportsSubdirectory "reports" ; # Directory scripts put reports into. 77 | variable ResultsSubdirectory "results" ; # Directory for files opened by TranscriptOpen 78 | variable CoverageSubdirectory "CodeCoverage" 79 | variable InvalidDirectory "Invalid Directory !@#$%^&*()+=|><|" 80 | variable InvalidLibraryDirectory $InvalidDirectory 81 | variable VhdlLibraryParentDirectory $InvalidDirectory 82 | # variable VhdlLibraryParentDirectory [pwd] ; # use local directory 83 | variable VhdlLibraryDirectory "VHDL_LIBS" 84 | variable VhdlLibrarySubdirectory "${ToolNameVersion}" 85 | 86 | variable HtmlThemeSubdirectory ${ReportsSubdirectory} 87 | 88 | # OsvvmSettingsSubdirectory 89 | # Location for package local and generated package bodies 90 | # Settings are relative to $OsvvmLibraries/osvvm if SettingsAreRelativeToSimulationDirectory is false 91 | variable SettingsAreRelativeToSimulationDirectory "false" 92 | variable OsvvmSettingsSubdirectory "" 93 | 94 | 95 | # 96 | # TCL Error signaling during a build 97 | # 98 | if {![info exists FailOnBuildErrors]} { 99 | variable FailOnBuildErrors "true" 100 | } 101 | if {![info exists FailOnReportErrors]} { 102 | variable FailOnReportErrors "false" 103 | } 104 | if {![info exists FailOnTestCaseErrors]} { 105 | variable FailOnTestCaseErrors "false" 106 | } 107 | 108 | # 109 | # Stop Counts for Failures seen by Analyze and Simulate 110 | # Value 0 is special to mean, don't stop 111 | # Otherwise Errors >= ErrorsStopCount, stop the build. 112 | # 113 | variable AnalyzeErrorStopCount 0 114 | variable SimulateErrorStopCount 0 115 | 116 | # 117 | # Generate HTML transcripts if TranscriptExtension = "html". 118 | # Text based log files are always created 119 | # 120 | variable TranscriptExtension "html" ;# Generate log and html transcripts 121 | variable CreateSimScripts "false" ;# Create a script with every simulator command run during this session 122 | variable CreateOsvvmOutput "false" ;# Text file with just OSVVM output 123 | 124 | # 125 | # Requirements Tracking settings 126 | # 127 | # USE_SUM_OF_GOALS 128 | # when false, uses maximum goal - good when merging in specification which provides the maximum goal which is divided across teests 129 | # when true, uses sum of goals - good when not merging the specification and need to sum up goals to get the total 130 | variable USE_SUM_OF_GOALS "false" ;# when false, uses maximum 131 | # variable USE_SUM_OF_GOALS "true" ;# when true uses sum of goals 132 | 133 | # 134 | # VHDL Simulation Settings 135 | # 136 | variable DefaultVHDLVersion "2008" ; # OSVVM requires > 2008. Valid values 1993, 2002, 2008, 2019 137 | variable SimulateTimeUnits "ps" 138 | variable DefaultLibraryName "DefaultLib" 139 | 140 | # 141 | # Default Code Coverage Options 142 | # 143 | variable CoverageEnable "true" 144 | variable CoverageAnalyzeEnable "false" 145 | variable CoverageSimulateEnable "false" 146 | variable CoverageAnalyzeOptions [vendor_SetCoverageAnalyzeDefaults] 147 | variable CoverageSimulateOptions [vendor_SetCoverageSimulateDefaults] 148 | 149 | # 150 | # Simulation Controls 151 | # 152 | variable SimulateInteractive "false" 153 | variable DebugIsSet "false" 154 | variable Debug "false" 155 | variable LogSignalsIsSet "false" 156 | variable LogSignals "false" 157 | variable ScriptDebug "false" 158 | variable OpenBuildHtmlFile "false" 159 | 160 | # 161 | # FunctionalCoverageIntegratedInSimulator controls whether osvvm.pro allows functional coverage to be linked into simulator interface 162 | # osvvm.pro does: analyze CoverageVendorApiPkg_${::osvvm::FunctionalCoverageIntegratedInSimulator}.vhd 163 | # Currently valid values are: 164 | # "default" - do not use any simulator functional coverage linking. 165 | # "Aldec" - use the link for Aldec tools - works with RivieraPRO and ActiveHDL 166 | # "NVC" - works with NVC 1.15.1 or newer. 167 | # Values other than "default" is set by VendorScripts_***.tcl for the respective simulator 168 | # Here, if a value was not previously set, the value "default" will be set. 169 | # To add capabilty to a simulator, 170 | # add a file named CoverageVendorApiPkg_.vhd to directory osvvm and 171 | # set this variable in the VendorScripts_***.tcl for the appropriate version of the simualtor (see VendorScripts_NVC.tcl) 172 | # 173 | if {![info exists FunctionalCoverageIntegratedInSimulator]} { 174 | variable FunctionalCoverageIntegratedInSimulator "default" 175 | } 176 | 177 | # 178 | # Extended Analyze and Simulate Options 179 | # 180 | variable VhdlAnalyzeOptions "" 181 | variable VerilogAnalyzeOptions "" 182 | variable ExtendedAnalyzeOptions "" 183 | variable ExtendedSimulateOptions "" 184 | 185 | # 186 | # For simulators that use two steps for Elaborate/Optimize and Run/Simulate 187 | # 188 | variable ExtendedElaborateOptions "" 189 | variable ExtendedOptimizeOptions "" 190 | variable ExtendedRunOptions "" 191 | variable SaveWaves "false" 192 | variable SimulateInteractive "false" 193 | 194 | 195 | # 196 | # Debug Controls 197 | # 198 | variable TclDebug "false" 199 | 200 | # 201 | # Second Top 202 | # 203 | variable SecondSimulationTopLevel "" 204 | 205 | # 206 | # RemoveLibrary / RemoveLibraryDirectory Controls. 207 | # Also set by by VendorScripts_ActiveHDL. 208 | # Currently both must be false for ActiveHDL 209 | # 210 | if {![info exists RemoveLibraryDirectoryDeletesDirectory]} { 211 | variable RemoveLibraryDirectoryDeletesDirectory "true" 212 | } 213 | 214 | if {![info exists RemoveUnmappedLibraries]} { 215 | variable RemoveUnmappedLibraries "true" 216 | } 217 | 218 | } 219 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is a local copy of the Apache License Version 2.0. 2 | The original can be obtained here: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 3 | 4 | -------------------------------------------------------------------------------- 5 | 6 | # Apache License 7 | 8 | Version 2.0, January 2004 9 | 10 | ## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 11 | 12 | ### 1. Definitions. 13 | 14 | *"License"* shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 15 | 16 | *"Licensor"* shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 17 | 18 | *"Legal Entity"* shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 19 | 20 | *"You"* (or *"Your"*) shall mean an individual or Legal Entity exercising permissions granted by this License. 21 | 22 | *"Source"* form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 23 | 24 | *"Object"* form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 25 | 26 | *"Work"* shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 27 | 28 | *"Derivative Works"* shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 29 | 30 | *"Contribution"* shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, *"submitted"* means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as *"Not a Contribution."* 31 | 32 | *"Contributor"* shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 33 | 34 | ### 2. Grant of Copyright License. 35 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 36 | 37 | ### 3. Grant of Patent License. 38 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 39 | 40 | ### 4. Redistribution. 41 | You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 42 | 43 | - You must give any other recipients of the Work or Derivative Works a copy of this License; and 44 | - You must cause any modified files to carry prominent notices stating that You changed the files; and 45 | - You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 46 | - If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 47 | 48 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 49 | 50 | ### 5. Submission of Contributions. 51 | Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 52 | 53 | ### 6. Trademarks. 54 | This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 55 | 56 | ### 7. Disclaimer of Warranty. 57 | Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 58 | 59 | ### 8. Limitation of Liability. 60 | In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 61 | 62 | ### 9. Accepting Warranty or Additional Liability. 63 | While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 64 | 65 | 66 | ## Appendix: How to apply the Apache License to your work 67 | 68 | To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. 69 | 70 | Copyright [yyyy] [name of copyright owner] 71 | 72 | Licensed under the Apache License, Version 2.0 (the "License"); 73 | you may not use this file except in compliance with the License. 74 | You may obtain a copy of the License at 75 | 76 | http://www.apache.org/licenses/LICENSE-2.0 77 | 78 | Unless required by applicable law or agreed to in writing, software 79 | distributed under the License is distributed on an "AS IS" BASIS, 80 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 81 | See the License for the specific language governing permissions and 82 | limitations under the License. 83 | -------------------------------------------------------------------------------- /Log2Osvvm.tcl: -------------------------------------------------------------------------------- 1 | # File Name: Log2Osvvm.tcl 2 | # Purpose: Extract information from OSVVM Log Files 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # Log2Osvvm - Create HTML, Simulation Scripts, and osvvm logs 11 | # 12 | # Developed by: 13 | # SynthWorks Design Inc. 14 | # VHDL Training Classes 15 | # OSVVM Methodology and Model Library 16 | # 11898 SW 128th Ave. Tigard, Or 97223 17 | # http://www.SynthWorks.com 18 | # 19 | # Revision History: 20 | # Date Version Description 21 | # 07/2024 2024.07 Minor name updates 22 | # 06/2022 2022.06 Initial Revision 23 | # 24 | # 25 | # This file is part of OSVVM. 26 | # 27 | # Copyright (c) 2022 by SynthWorks Design Inc. 28 | # 29 | # Licensed under the Apache License, Version 2.0 (the "License"); 30 | # you may not use this file except in compliance with the License. 31 | # You may obtain a copy of the License at 32 | # 33 | # https://www.apache.org/licenses/LICENSE-2.0 34 | # 35 | # Unless required by applicable law or agreed to in writing, software 36 | # distributed under the License is distributed on an "AS IS" BASIS, 37 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 | # See the License for the specific language governing permissions and 39 | # limitations under the License. 40 | # 41 | 42 | namespace eval ::osvvm { 43 | 44 | proc Log2Osvvm {LogFile} { 45 | variable LogFileHandle 46 | variable HtmlFileHandle 47 | variable SimFileHandle 48 | variable OsvvmFileHandle 49 | variable LocalLogType "html" 50 | variable LocalCreateSimScripts "false" 51 | variable LocalCreateOsvvmOutput "false" 52 | 53 | if {[info exists ::osvvm::TranscriptExtension]} { 54 | set LocalLogType $::osvvm::TranscriptExtension 55 | } 56 | if {[info exists ::osvvm::CreateSimScripts]} { 57 | set LocalCreateSimScripts $::osvvm::CreateSimScripts 58 | } 59 | if {[info exists ::osvvm::CreateOsvvmOutput]} { 60 | set LocalCreateOsvvmOutput $::osvvm::CreateOsvvmOutput 61 | } 62 | 63 | set LogFileHandle [open $LogFile r] 64 | set LogDir [file dirname $LogFile] 65 | set LogName [file rootname [file tail $LogFile]] 66 | 67 | if {$LocalLogType eq "html"} { 68 | set HtmlFile [file join ${LogDir} ${LogName}_log.html] 69 | set HtmlFileHandle [open $HtmlFile w] 70 | puts $HtmlFileHandle "" 71 | puts $HtmlFileHandle "" 85 | puts $HtmlFileHandle "" 86 | puts $HtmlFileHandle "
"
 87 |     }   
 88 |     if {$LocalCreateSimScripts} {
 89 |       set SimFile [file join ${LogDir} ${LogName}_sim.tcl]
 90 |       set SimFileHandle [open $SimFile w]
 91 |     }
 92 |     if {$LocalCreateOsvvmOutput} {
 93 |       set OsvvmFile [file join ${LogDir} ${LogName}_osvvm.log]
 94 |       set OsvvmFileHandle [open $OsvvmFile w]
 95 |     }
 96 |     
 97 |     set ErrorCode [catch {LocalLog2Osvvm $LogFile $LocalLogType $LocalCreateSimScripts $LocalCreateOsvvmOutput} errmsg]
 98 |     
 99 |     close $LogFileHandle 
100 |     
101 |     if {$LocalLogType eq "html"} {
102 |       puts $HtmlFileHandle ""
103 |       close $HtmlFileHandle 
104 |     }
105 |     if {$LocalCreateSimScripts} {
106 |       close $SimFileHandle 
107 |     }
108 |     if {$LocalCreateOsvvmOutput} {
109 |       close $OsvvmFileHandle 
110 |     }
111 |     
112 |     if {$ErrorCode} {
113 |       CallbackOnError_Log2Osvvm $LogFile $errmsg
114 |     }
115 |   }
116 | 
117 |   proc LocalLog2Osvvm {LogFile LocalLogType LocalCreateSimScripts LocalCreateOsvvmOutput} {
118 |     variable LogFileHandle
119 |     variable LineOfLogFile
120 |     variable InRunTest 0
121 |     variable LogTestSuiteName Default
122 |     variable LogTestCaseName  Default
123 |     variable PrintPrefix ""
124 |     variable FoundBuild "false" 
125 |     variable FirstLine  "true"
126 | 
127 |     # Read line by line - For OSVVM regressions, this is 50 to 100 ms slower
128 |     #   while { [gets $LogFileHandle RawLineOfLogFile] >= 0 } {  } ; 
129 |     
130 |     # Read whole file and split it into lines
131 |     foreach RawLineOfLogFile [split [read $LogFileHandle] \n] {
132 |       set LineOfLogFile [regsub {^KERNEL: } [regsub {^# } $RawLineOfLogFile ""] ""]
133 |       
134 |       if {!$FoundBuild} {
135 |         set FoundBuild [FindBuildInLog]
136 |       }
137 |       
138 |       if {$FoundBuild} {
139 |         if {$LocalLogType eq "html"} {
140 |           Log2Html  
141 |         }
142 |         if {$LocalCreateSimScripts} {
143 |           Log2Sim 
144 |         }
145 |         if {$LocalCreateOsvvmOutput} {
146 |           Log2OsvvmOutput  
147 |         }
148 |       }
149 |     }
150 |   }
151 | 
152 |   proc FindBuildInLog {} {
153 |     variable HtmlFileHandle
154 |     variable LineOfLogFile
155 |     variable FirstLine
156 |     variable PrintPrefix 
157 |     
158 |     return [regexp {^build} $LineOfLogFile]
159 | #    if {[regexp {^build} $LineOfLogFile] } {
160 | #      return "true"
161 | #    } else {
162 | #      if {$FirstLine} {
163 | #        puts $HtmlFileHandle "${PrintPrefix}
Simulator Startup Stuff" 164 | # puts $HtmlFileHandle "
" 166 | # set FirstLine "false" 167 | # } 168 | # puts $HtmlFileHandle $LineOfLogFile 169 | # return "false" 170 | # } 171 | } 172 | 173 | proc Log2Html {} { 174 | variable HtmlFileHandle 175 | variable LineOfLogFile 176 | variable InRunTest 177 | variable LogTestSuiteName 178 | variable LogTestCaseName 179 | variable PrintPrefix 180 | 181 | if {[regexp {^Build Start} $LineOfLogFile] } { 182 | # if {$PrintPrefix eq ""} { } 183 | if {[regexp {} ${PrintPrefix}]} { 184 | puts $HtmlFileHandle "${PrintPrefix}${LineOfLogFile}" 185 | } else { 186 | puts $HtmlFileHandle "${PrintPrefix}\n${LineOfLogFile}" 187 | } 188 | set PrintPrefix "" 189 | } elseif {[regexp {^build|^include|^MkVproc|^MkVprocNoClean|^MkVprocSkt|^MkVprocGhdlMain} $LineOfLogFile] } { 190 | puts $HtmlFileHandle "${PrintPrefix}
${LineOfLogFile}" 191 | set PrintPrefix "
" 192 | } elseif {[regexp {^TestSuite} $LineOfLogFile] } { 193 | set LogTestSuiteName [lindex $LineOfLogFile 1] 194 | puts $HtmlFileHandle "${PrintPrefix}
$LineOfLogFile" 195 | set PrintPrefix "
" 196 | } elseif {[regexp {^RunTest} $LineOfLogFile] } { 197 | set InRunTest 1 198 | puts $HtmlFileHandle "${PrintPrefix}
$LineOfLogFile" 199 | set PrintPrefix "▲ ${LineOfLogFile}<\span>
" 200 | } elseif {[regexp {^AnalyzeError:|^SimulateError:|^ScriptError:|^ReportError:|^LibraryError:|^BuildError:} $LineOfLogFile] } { 201 | puts $HtmlFileHandle "${PrintPrefix}$LineOfLogFile" 202 | set PrintPrefix "" 203 | } elseif {[regexp {^Build:} $LineOfLogFile] } { 204 | puts $HtmlFileHandle "${PrintPrefix}$LineOfLogFile" 205 | set PrintPrefix "" 206 | } elseif {[regexp {^analyze} $LineOfLogFile] } { 207 | if {! $InRunTest} { 208 | puts $HtmlFileHandle "${PrintPrefix}
$LineOfLogFile" 209 | set PrintPrefix "
" 210 | } else { 211 | puts $HtmlFileHandle $LineOfLogFile 212 | } 213 | } elseif {[regexp {^simulate} $LineOfLogFile] } { 214 | set GenericNames "" 215 | if {[regexp {generic} $LineOfLogFile] } { 216 | set GenericDict [regsub {\].*} [regsub -all {[^\[]*\[generic ([^\]]*)} $LineOfLogFile {\1 }] ""] 217 | set GenericNames [ToGenericNames $GenericDict] 218 | # foreach {name val} $GenericDict { 219 | # set GenericNames ${GenericNames}_${name}_${val} 220 | # } 221 | } 222 | if {! $InRunTest} { 223 | puts $HtmlFileHandle "${PrintPrefix}
$LineOfLogFile" 224 | set PrintPrefix "▲ ${LineOfLogFile}<\span>
" 225 | } else { 226 | puts $HtmlFileHandle "$LineOfLogFile " 227 | } 228 | set InRunTest 0 229 | } else { 230 | if {[regexp {^TestName} $LineOfLogFile] } { 231 | set LogTestCaseName [lindex $LineOfLogFile 1] 232 | } 233 | if {[regexp {DONE FAILED} $LineOfLogFile]} { 234 | set PrintPrefix "${PrintPrefix}$LineOfLogFile" 235 | puts $HtmlFileHandle "$LineOfLogFile" 236 | } elseif {[regexp {^WaveError:} $LineOfLogFile] } { 237 | puts $HtmlFileHandle "$LineOfLogFile" 238 | } elseif {[regexp {^Error:|^error:|Alert ERROR} $LineOfLogFile] } { 239 | puts $HtmlFileHandle "$LineOfLogFile" 240 | } else { 241 | puts $HtmlFileHandle $LineOfLogFile 242 | } 243 | } 244 | } 245 | 246 | proc Log2Sim {} { 247 | variable SimFileHandle 248 | variable LineOfLogFile 249 | 250 | if {[IsVendorCommand $LineOfLogFile]} { 251 | puts $SimFileHandle [regsub {\{\*\}} $LineOfLogFile ""] 252 | } 253 | } 254 | 255 | proc Log2OsvvmOutput {} { 256 | variable OsvvmFileHandle 257 | variable LineOfLogFile 258 | 259 | if {[regexp {^%%|^simulate |^TestCase } $LineOfLogFile] } { 260 | puts $OsvvmFileHandle $LineOfLogFile 261 | } 262 | } 263 | 264 | namespace export Log2Osvvm 265 | 266 | # end namespace ::osvvm 267 | } 268 | 269 | -------------------------------------------------------------------------------- /VendorScripts_ASim.tcl: -------------------------------------------------------------------------------- 1 | # File Name: VendorScripts_VSimSA.tcl 2 | # Purpose: Scripts for running simulations 3 | # Revision: OSVVM MODELS STANDARD VERSION 4 | # 5 | # Maintainer: Jim Lewis email: jim@synthworks.com 6 | # Contributor(s): 7 | # Jim Lewis email: jim@synthworks.com 8 | # 9 | # Description 10 | # TCL abstraction layer to run OSVVM pro scripts with 11 | # running ActiveHDL from a TCL shell. 12 | # 13 | # Developed by: 14 | # SynthWorks Design Inc. 15 | # VHDL Training Classes 16 | # OSVVM Methodology and Model Library 17 | # 11898 SW 128th Ave. Tigard, Or 97223 18 | # http://www.SynthWorks.com 19 | # 20 | # Revision History: 21 | # Date Version Description 22 | # 5/2024 2024.05 Added ToolVersion variable 23 | # 5/2022 2022.05 Coverage report name based on TestCaseName rather than LibraryUnit 24 | # Updated variable naming 25 | # 2/2022 2022.02 Added Coverage Collection 26 | # 12/2021 2021.12 Updated to use relative paths. 27 | # 3/2021 2021.03 In Simulate, added optional scripts to run as part of simulate 28 | # 2/2021 2021.02 Refactored variable settings to here from ToolConfiguration.tcl 29 | # 7/2020 2020.07 Refactored tool execution for simpler vendor customization 30 | # 1/2020 2020.01 Updated Licenses to Apache 31 | # 2/2019 Beta Project descriptors in .pro which execute 32 | # as TCL scripts in conjunction with the library 33 | # procedures 34 | # 11/2018 Alpha Project descriptors in .files and .dirs files 35 | # 36 | # 37 | # This file is part of OSVVM. 38 | # 39 | # Copyright (c) 2018 - 2021 by SynthWorks Design Inc. 40 | # 41 | # Licensed under the Apache License, Version 2.0 (the "License"); 42 | # you may not use this file except in compliance with the License. 43 | # You may obtain a copy of the License at 44 | # 45 | # https://www.apache.org/licenses/LICENSE-2.0 46 | # 47 | # Unless required by applicable law or agreed to in writing, software 48 | # distributed under the License is distributed on an "AS IS" BASIS, 49 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50 | # See the License for the specific language governing permissions and 51 | # limitations under the License. 52 | # 53 | 54 | # ------------------------------------------------- 55 | # Tool Settings 56 | # 57 | variable ToolType "simulator" 58 | variable ToolVendor "Aldec" 59 | variable ToolName "ActiveASim" 60 | variable simulator $ToolName ; # Variable simulator is deprecated. Use ToolName instead 61 | variable ToolVersion [lindex [split [exec vsim -version]] 4] 62 | # variable ToolVersion [lindex [split $version] [llength $version]-1] 63 | variable ToolNameVersion ${ToolName}-${ToolVersion} 64 | # puts $ToolNameVersion 65 | 66 | if {[expr [string compare $ToolVersion "12.0"] >= 0]} { 67 | SetVHDLVersion 2019 68 | variable Support2019FilePath "true" 69 | } 70 | 71 | variable FunctionalCoverageIntegratedInSimulator "Aldec" 72 | 73 | # if {[batch_mode]} { 74 | variable NoGui "true" 75 | # } else { 76 | # variable NoGui "false" 77 | # } 78 | 79 | # ------------------------------------------------- 80 | # StartTranscript / StopTranscxript 81 | # 82 | # proc vendor_StartTranscript {FileName} { 83 | # transcript off 84 | # puts "transcript to $FileName" 85 | # transcript to $FileName 86 | # } 87 | # 88 | # proc vendor_StopTranscript {FileName} { 89 | # transcript to -off 90 | # } 91 | 92 | # ------------------------------------------------- 93 | # IsVendorCommand 94 | # 95 | proc IsVendorCommand {LineOfText} { 96 | 97 | return [regexp {^alib |^amap |^acom |^alog |^asim |^vlib |^vmap |^vcom |^vlog |^vsim |^run |^acdb } $LineOfText] 98 | } 99 | 100 | # ------------------------------------------------- 101 | # SetCoverageAnalyzeOptions 102 | # SetCoverageCoverageOptions 103 | # 104 | proc vendor_SetCoverageAnalyzeDefaults {} { 105 | variable CoverageAnalyzeOptions 106 | # set CoverageAnalyzeOptions "-coverage sbmec" 107 | set CoverageAnalyzeOptions "-coverage sbm" 108 | } 109 | 110 | proc vendor_SetCoverageSimulateDefaults {} { 111 | variable CoverageSimulateOptions 112 | # set CoverageSimulateOptions "-acdb -acdb_cov sbmec -cc_all" 113 | set CoverageSimulateOptions "-acdb -acdb_cov sbm -cc_all" 114 | } 115 | 116 | 117 | # ------------------------------------------------- 118 | # Library 119 | # 120 | proc vendor_library {LibraryName PathToLib} { 121 | set PathAndLib ${PathToLib}/${LibraryName} 122 | 123 | if {![file exists ${PathAndLib}]} { 124 | puts "vlib ${PathAndLib}" 125 | exec vlib ${PathAndLib} 126 | # after 1000 127 | } 128 | puts "vmap $LibraryName ${PathAndLib}" 129 | exec vmap $LibraryName ${PathAndLib} 130 | } 131 | 132 | proc vendor_LinkLibrary {LibraryName PathToLib} { 133 | set PathAndLib ${PathToLib}/${LibraryName} 134 | 135 | if {[file exists ${PathAndLib}]} { 136 | set ResolvedLib ${PathAndLib} 137 | } else { 138 | set ResolvedLib ${PathToLib} 139 | } 140 | puts "vmap $LibraryName ${ResolvedLib}" 141 | exec vmap $LibraryName ${ResolvedLib} 142 | } 143 | 144 | proc vendor_UnlinkLibrary {LibraryName PathToLib} { 145 | exec vmap -del ${LibraryName} 146 | } 147 | 148 | # ------------------------------------------------- 149 | # analyze 150 | # 151 | proc vendor_analyze_vhdl {LibraryName FileName args} { 152 | variable VhdlVersion 153 | 154 | # For now, do not use -dbg flag with coverage. 155 | set DebugOptions "" 156 | 157 | set AnalyzeOptions [concat -${VhdlVersion} {*}${DebugOptions} -relax -work ${LibraryName} {*}${args} ${FileName}] 158 | 159 | puts "vcom $AnalyzeOptions" 160 | # exec vcom {*}$AnalyzeOptions 161 | 162 | set ErrorCode [catch {exec vcom {*}$AnalyzeOptions} CatchMessage] 163 | if {$ErrorCode != 0} { 164 | PrintWithPrefix "Error:" $CatchMessage 165 | puts $::errorInfo 166 | error "Failed: analyze $FileName" 167 | } else { 168 | puts $CatchMessage 169 | } 170 | } 171 | 172 | proc vendor_analyze_verilog {LibraryName FileName args} { 173 | set AnalyzeOptions [concat [CreateVerilogLibraryParams "-l "] -work ${LibraryName} {*}${args} ${FileName}] 174 | puts "vlog $AnalyzeOptions" 175 | # exec vlog {*}$AnalyzeOptions 176 | 177 | set ErrorCode [catch {exec vlog {*}$AnalyzeOptions} CatchMessage] 178 | if {$ErrorCode != 0} { 179 | PrintWithPrefix "Error:" $CatchMessage 180 | puts $::errorInfo 181 | error "Failed: analyze $FileName" 182 | } else { 183 | puts $CatchMessage 184 | } 185 | } 186 | 187 | # ------------------------------------------------- 188 | proc NoNullRangeWarning {} { 189 | return "-nowarn COMP96_0119" 190 | } 191 | 192 | # ------------------------------------------------- 193 | # End Previous Simulation 194 | # 195 | proc vendor_end_previous_simulation {} { 196 | # endsim 197 | } 198 | 199 | # ------------------------------------------------- 200 | # Simulate 201 | # 202 | proc vendor_simulate {LibraryName LibraryUnit args} { 203 | variable OsvvmScriptDirectory 204 | variable SimulateTimeUnits 205 | variable ToolVendor 206 | variable TestSuiteName 207 | variable TestCaseFileName 208 | global aldec ; # required for matlab cosim 209 | 210 | # Create the script files 211 | set ErrorCode [catch {vendor_CreateSimulateDoFile $LibraryUnit OsvvmSimRun.tcl} CatchMessage] 212 | if {$ErrorCode != 0} { 213 | PrintWithPrefix "Error:" $CatchMessage 214 | puts $::errorInfo 215 | error "Failed: vendor_CreateSimulateDoFile $LibraryUnit" 216 | } 217 | 218 | # puts "vendor simulate LN=$LibraryName LU=$LibraryUnit A=$args" 219 | set SimulateOptions [concat -c {*}${args} {*}${::osvvm::GenericOptions} -t $SimulateTimeUnits -lib ${LibraryName} ${LibraryUnit} ${::osvvm::SecondSimulationTopLevel}] 220 | 221 | puts "vsim ${SimulateOptions}" 222 | ## exec vsim {*}${SimulateOptions} -tcl "OsvvmSimRun.tcl" 223 | 224 | set ErrorCode [catch {exec vsim {*}${SimulateOptions} -tcl "OsvvmSimRun.tcl"} CatchMessage] 225 | if {$ErrorCode != 0} { 226 | PrintWithPrefix "Error:" $CatchMessage 227 | puts $::errorInfo 228 | error "Failed: simulate $LibraryUnit" 229 | } else { 230 | puts $CatchMessage 231 | } 232 | } 233 | 234 | # ------------------------------------------------- 235 | # vendor_CreateSimulateDoFile 236 | # 237 | proc vendor_CreateSimulateDoFile {LibraryUnit ScriptFileName} { 238 | variable ScriptFile 239 | 240 | # Open File 241 | set ScriptFile [open $ScriptFileName w] 242 | 243 | # Do Vendor Simulate pre-run stuff here 244 | 245 | #?? is it possible that we want to save waves in a batch simulator 246 | 247 | SimulateCreateDoFile $LibraryUnit 248 | 249 | puts $ScriptFile "run -all" 250 | 251 | # Save Coverage Information 252 | if {$::osvvm::CoverageEnable && $::osvvm::CoverageSimulateEnable} { 253 | puts $ScriptFile "acdb save -o ${::osvvm::CoverageDirectory}/${TestSuiteName}/${TestCaseFileName}.acdb -testname ${TestCaseFileName}" 254 | } 255 | 256 | # puts $ScriptFile "quit" 257 | close $ScriptFile 258 | } 259 | 260 | 261 | # ------------------------------------------------- 262 | proc vendor_generic {Name Value} { 263 | 264 | return "-g${Name}=${Value}" 265 | } 266 | 267 | # ------------------------------------------------- 268 | # Merge Coverage 269 | # 270 | proc vendor_MergeCodeCoverage {TestSuiteName CoverageDirectory BuildName} { 271 | set CoverageFileBaseName [file join ${CoverageDirectory} ${BuildName} ${TestSuiteName}] 272 | set CovFiles [glob -nocomplain ${CoverageDirectory}/${TestSuiteName}/*.acdb] 273 | if {$CovFiles ne ""} { 274 | exec vsim -c -tcl "acdb merge -o ${CoverageFileBaseName}.acdb -i {*}[join $CovFiles " -i "]" 275 | } 276 | } 277 | 278 | proc vendor_ReportCodeCoverage {TestSuiteName CodeCoverageDirectory} { 279 | set CodeCovResultsDir ${CodeCoverageDirectory}/${TestSuiteName}_code_cov 280 | if {[file exists ${CodeCovResultsDir}.html]} { 281 | file delete -force -- ${CodeCovResultsDir}.html 282 | } 283 | if {[file exists ${CodeCovResultsDir}_files]} { 284 | file delete -force -- ${CodeCovResultsDir}_files 285 | } 286 | exec vsim -c -tcl "acdb report -html -i ${CodeCoverageDirectory}/${TestSuiteName}.acdb -o ${CodeCovResultsDir}.html" 287 | } 288 | 289 | proc vendor_GetCoverageFileName {TestName} { 290 | set CoverageFileName ${TestName}_code_cov.html 291 | return $CoverageFileName 292 | } 293 | --------------------------------------------------------------------------------