forked from OSVVM/OSVVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated files to OSVVM release 2014.07a.
- Loading branch information
Patrick Lehmann
authored and
Patrick Lehmann
committed
Dec 7, 2015
1 parent
cde14ce
commit 0042ec4
Showing
8 changed files
with
956 additions
and
430 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
-- | ||
-- File Name: NamePkg.vhd | ||
-- Design Unit Name: NamePkg | ||
-- Revision: STANDARD VERSION, revision 2014.07 | ||
-- | ||
-- Maintainer: Jim Lewis email: [email protected] | ||
-- Contributor(s): | ||
-- Jim Lewis SynthWorks | ||
-- | ||
-- | ||
-- Package Defines | ||
-- Data structure for name. | ||
-- | ||
-- Developed for: | ||
-- SynthWorks Design Inc. | ||
-- VHDL Training Classes | ||
-- 11898 SW 128th Ave. Tigard, Or 97223 | ||
-- http://www.SynthWorks.com | ||
-- | ||
-- Latest standard version available at: | ||
-- http://www.SynthWorks.com/downloads | ||
-- | ||
-- Revision History: | ||
-- Date Version Description | ||
-- 06/2010: 0.1 Initial revision | ||
-- 07/2014: 2014.07 Moved specialization required by CoveragePkg to CoveragePkg | ||
-- Separated name handling from message handling to simplify naming | ||
-- 07/2014: 2014.07a Removed initialized pointers which can lead to memory leaks. | ||
-- | ||
-- | ||
-- Copyright (c) 2010 - 2014 by SynthWorks Design Inc. All rights reserved. | ||
-- | ||
-- Verbatim copies of this source file may be used and | ||
-- distributed without restriction. | ||
-- | ||
-- This source file is free software; you can redistribute it | ||
-- and/or modify it under the terms of the ARTISTIC License | ||
-- as published by The Perl Foundation; either version 2.0 of | ||
-- the License, or (at your option) any later version. | ||
-- | ||
-- This source is distributed in the hope that it will be | ||
-- useful, but WITHOUT ANY WARRANTY; without even the implied | ||
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
-- PURPOSE. See the Artistic License for details. | ||
-- | ||
-- You should have received a copy of the license with this source. | ||
-- If not download it from, | ||
-- http://www.perlfoundation.org/artistic_license_2_0 | ||
-- | ||
|
||
use std.textio.all ; | ||
|
||
package NamePkg is | ||
|
||
type NamePType is protected | ||
procedure Set (NameIn : String) ; | ||
impure function Get return string ; | ||
impure function IsSet return boolean ; | ||
procedure Clear ; -- clear name | ||
procedure Deallocate ; -- effectively alias to clear name | ||
end protected NamePType ; | ||
|
||
end package NamePkg ; | ||
package body NamePkg is | ||
|
||
|
||
type NamePType is protected body | ||
|
||
variable NamePtr : line ; | ||
|
||
------------------------------------------------------------ | ||
procedure Set (NameIn : String) is | ||
------------------------------------------------------------ | ||
begin | ||
deallocate(NamePtr) ; | ||
NamePtr := new string'(NameIn) ; | ||
end procedure Set ; | ||
|
||
------------------------------------------------------------ | ||
impure function Get return string is | ||
------------------------------------------------------------ | ||
begin | ||
if NamePtr = NULL then | ||
return "" ; | ||
else | ||
return NamePtr.all ; | ||
end if ; | ||
end function Get ; | ||
|
||
------------------------------------------------------------ | ||
impure function IsSet return boolean is | ||
------------------------------------------------------------ | ||
begin | ||
return NamePtr /= NULL ; | ||
end function IsSet ; | ||
|
||
------------------------------------------------------------ | ||
procedure Clear is -- clear name | ||
------------------------------------------------------------ | ||
begin | ||
deallocate(NamePtr) ; | ||
end procedure Clear ; | ||
|
||
------------------------------------------------------------ | ||
procedure Deallocate is -- clear name | ||
------------------------------------------------------------ | ||
begin | ||
Clear ; | ||
end procedure Deallocate ; | ||
|
||
end protected body NamePType ; | ||
|
||
end package body NamePkg ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.