OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c97201x.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- C97201X.ADA
2
 
3
--                             Grant of Unlimited Rights
4
--
5
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained 
7
--     unlimited rights in the software and documentation contained herein.
8
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making 
9
--     this public release, the Government intends to confer upon all 
10
--     recipients unlimited rights  equal to those held by the Government.  
11
--     These rights include rights to use, duplicate, release or disclose the 
12
--     released technical data and computer software in whole or in part, in 
13
--     any manner and for any purpose whatsoever, and to have or permit others 
14
--     to do so.
15
--
16
--                                    DISCLAIMER
17
--
18
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
20
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
22
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23
--     PARTICULAR PURPOSE OF SAID MATERIAL.
24
--*
25
-- CHECK THAT NO RENDEZVOUS CAN EVER OCCUR IF BOTH PARTNERS REFUSE TO
26
--     WAIT (THAT IS, IF THE ENTRY CALL IS ISSUED BY A
27
--     "CONDITIONAL_ENTRY_CALL" AND THUS FOLLOWS A NO-WAIT POLICY
28
--     (DEMANDING UNCONDITIONALLY THAT "YOU DO IT   N O W  , OR ELSE"),
29
--     WHILE THE CALLEE IS ALSO COMMITTED TO A NO-WAIT POLICY,
30
--     BY VIRTUE OF A SELECTIVE_WAIT STATEMENT OF THE THIRD KIND
31
--     (WITH AN "ELSE" PART) IN WHICH THE CORRESPONDING ACCEPT_STATEMENT
32
--     IS EMBEDDED).
33
--     ("CLOSE ENCOUNTERS OF THE THIRD KIND"  --  ARE THEY POSSIBLE?)
34
 
35
 
36
-- THE SEMANTICS OF THIS ENTRY CALL REQUIRES THAT THE CALLING TASK
37
--     N O T   ENTER ITSELF ON ANY QUEUE BUT RATHER ATTEMPT AN IMMEDIATE
38
--     RENDEZVOUS WHICH IS TO TAKE PLACE IF AND ONLY IF THE CALLED TASK
39
--     HAS REACHED A POINT WHERE IT IS READY TO ACCEPT THE CALL (I.E.
40
--     IT IS EITHER WAITING AT AN ACCEPT STATEMENT FOR THE CORRESPONDING
41
--     ENTRY OR IT IS WAITING AT A SELECTIVE_WAIT STATEMENT WITH AN OPEN
42
--     ALTERNATIVE STARTING WITH SUCH AN ACCEPT STATEMENT).  IT ALSO
43
--     REQUIRES THAT THE ENTRY CALL BE CANCELLED IF THE CALLED TASK 
44
--     IS NOT AT SUCH A POINT.  ON THE OTHER HAND, THE SEMANTICS OF THE
45
--     SELECTIVE_WAIT STATEMENT WITH AN  'ELSE'  PART  SPECIFIES THAT
46
--     THE  'ELSE'  PART  MUST BE SELECTED IF NO 'ACCEPT' ALTERNATIVE
47
--     CAN BE IMMEDIATELY SELECTED,  AND THAT SUCH AN ALTERNATIVE
48
--     IS DEEMED TO BE IMMEDIATELY SELECTABLE ("SELECTION OF ONE SUCH
49
--     ALTERNATIVE OCCURS IMMEDIATELY"), AND A CORRESPONDING RENDEZVOUS
50
--     POSSIBLE,  IF AND ONLY IF THERE IS A CORRESPONDING ENTRY CALL
51
--     W A I T I N G   TO BE ACCCEPTED.  A "CONDITIONAL ENTRY CALL"
52
--     NEVER WAITS, AND IS NEVER ENTERED IN WAIT QUEUES; IT TAKES
53
--     THE 'ELSE' PART INSTEAD.
54
 
55
 
56
-- NOTE: IF THIS TEST PROGRAM HANGS UP, THE COMPILER WILL BE DEEMED
57
--     TO HAVE FAILED.
58
 
59
 
60
-- RM 3/19/82
61
 
62
 
63
WITH REPORT; USE REPORT;
64
PROCEDURE C97201X IS
65
 
66
     RENDEZVOUS_OCCURRED        :  BOOLEAN  :=  FALSE ;
67
 
68
     CALLER_TAKES_WRONG_BRANCH  :  BOOLEAN  :=  TRUE  ;
69
     SERVER_TAKES_WRONG_BRANCH  :  BOOLEAN  :=  TRUE  ;
70
     QUEUE_NOT_EMPTY            :  BOOLEAN  :=  FALSE ;
71
 
72
BEGIN
73
 
74
 
75
     TEST ("C97201X", "CHECK THAT NO RENDEZVOUS CAN EVER OCCUR IF" &
76
                      " BOTH PARTNERS REFUSE TO WAIT" );
77
 
78
 
79
     DECLARE
80
 
81
 
82
          TASK  T  IS
83
               ENTRY  SYNCHRONIZE ;
84
               ENTRY  DO_IT_NOW_ORELSE( DID_YOU_DO_IT : IN OUT BOOLEAN);
85
               ENTRY  KEEP_ALIVE  ;
86
          END  T ;
87
 
88
 
89
          TASK BODY  T  IS
90
          BEGIN
91
 
92
 
93
               ACCEPT  SYNCHRONIZE ;
94
 
95
 
96
               IF  DO_IT_NOW_ORELSE'COUNT /= 0  THEN
97
                    QUEUE_NOT_EMPTY := TRUE ;
98
               END IF;
99
 
100
 
101
               SELECT
102
                         ACCEPT  DO_IT_NOW_ORELSE
103
                                      ( DID_YOU_DO_IT : IN OUT BOOLEAN )
104
                         DO
105
                              DID_YOU_DO_IT  :=  TRUE ;
106
                         END ;
107
               ELSE         -- (I.E. TASK ADOPTS NO-WAIT POLICY)
108
                            -- 'ELSE' BRANCH MUST THEREFORE BE CHOSEN
109
                    SERVER_TAKES_WRONG_BRANCH := FALSE ;
110
               END SELECT;
111
 
112
 
113
               IF  DO_IT_NOW_ORELSE'COUNT /= 0  THEN
114
                    QUEUE_NOT_EMPTY := TRUE ;
115
               END IF;
116
 
117
 
118
               ACCEPT  KEEP_ALIVE ;  -- TO PREVENT THIS SERVER TASK FROM
119
                                     --     TERMINATING IF IT GETS TO
120
                                     --     THE NO-WAIT MEETING-PLACE
121
                                     --     AHEAD OF THE CALLER (WHICH
122
                                     --     WOULD LEAD TO A SUBSEQUENT
123
                                     --     TASKING_ERROR AT THE TIME OF
124
                                     --     THE NO-WAIT CALL).
125
 
126
 
127
          END  T ;
128
 
129
 
130
     BEGIN
131
 
132
 
133
          T.SYNCHRONIZE ;  -- TO MINIMIZE THE   N E E D   TO WAIT
134
 
135
 
136
          SELECT
137
               T.DO_IT_NOW_ORELSE ( RENDEZVOUS_OCCURRED );
138
          ELSE              -- (I.E. CALLER TOO ADOPTS A NO-WAIT POLICY)
139
                                    -- MUST THEREFORE CHOOSE THIS BRANCH
140
               CALLER_TAKES_WRONG_BRANCH := FALSE ;
141
          END SELECT;
142
 
143
 
144
          T.KEEP_ALIVE ;    -- THIS ALSO UPDATES THE NONLOCALS
145
 
146
 
147
     END;   -- END OF BLOCK CONTAINING THE NO-WAIT ENTRY CALL
148
 
149
 
150
     IF  RENDEZVOUS_OCCURRED
151
     THEN
152
          FAILED( "RENDEZVOUS OCCURRED" );
153
     END IF;
154
 
155
     IF  CALLER_TAKES_WRONG_BRANCH  OR
156
         SERVER_TAKES_WRONG_BRANCH
157
     THEN
158
          FAILED( "WRONG BRANCH TAKEN" );
159
     END IF;
160
 
161
     IF  QUEUE_NOT_EMPTY
162
     THEN
163
          FAILED( "ENTRY QUEUE NOT EMPTY" );
164
     END IF;
165
 
166
 
167
     RESULT;
168
 
169
 
170
END  C97201X ;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.