From 5853a37df7c9468a01d62f7b2eeee7d9773e72ca Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 19 Dec 2022 22:07:02 +0100 Subject: Restructured test example sourcefiles. --- testsuite/pyunit/dom/examples/SimplePackage.vhdl | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testsuite/pyunit/dom/examples/SimplePackage.vhdl (limited to 'testsuite/pyunit/dom/examples/SimplePackage.vhdl') diff --git a/testsuite/pyunit/dom/examples/SimplePackage.vhdl b/testsuite/pyunit/dom/examples/SimplePackage.vhdl new file mode 100644 index 000000000..04df1c521 --- /dev/null +++ b/testsuite/pyunit/dom/examples/SimplePackage.vhdl @@ -0,0 +1,28 @@ +-- Author: Patrick Lehmann +-- +-- A collection of utility types and functions. +-- +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +-- Utility package +package utilities is + -- Deferred constant to distinguish simulation from synthesis. + constant IS_SIMULATION : boolean; + +end package; + +package body utilities is + function simulation return boolean is + variable result : boolean := false; + begin + -- synthesis translate off + result := true; + -- synthesis translate on + return result; + end function; + + constant IS_SIMULATION : boolean := simulation; + +end package body; -- cgit v1.2.3