Unformatted text preview: ing architecture: 14. 15. 16. 17. 18. IR1000.4.7. IR1000.4.7. IR1000.4.7. IR1000.4.7. IR1000.4.7. Clause 4 Copyright 2000, IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 61 IEEE Std P1076a-1999 2000/D3 IEEE STANDARD VHDL architecture UseSharedVariables of SomeEntity is subtype ShortRange is INTEGER range -1 to 1; type ShortRangeProtected is protected procedure Set(V: ShortRange); procedure Get(V: out ShortRange); end protected; type ShortRangeProtectedis protected body variable Local: ShortRange := 0; begin procedure Set(V: ShortRange) is begin Local := V; end procedure Set; procedure Get(V: out ShortRange) is begin V := Local; end procedure Get; end protected body; shared variable Counter: ShortRangeProtected; begin PROC1: process variable V: ShortRange; begin Counter,Get( V ); Counter.Set( V+1 ); wait; end process PROC1; PROC2: process variable V: ShortRange; begin Counter,Get( V ); Counter.Set( V1 ); wait; end process PROC2; end architecture UseSharedVariables;
In particular, the value of Counter after the execution of both processes is not guaranteed to be 0. The possible values of Counter could be...
View Full Document
- Fall '01
- Object-Oriented Programming, Programming constructs, IEEE Std P1076a-1999 2000/D3