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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c97301b.ada] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C97301B.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
-- OBJECTIVE:
26
--     CHECK THAT A TIMED_ENTRY_CALL DELAYS FOR AT LEAST THE SPECIFIED
27
--     AMOUNT OF TIME IF A RENDEZVOUS IS NOT POSSIBLE.
28
 
29
--     CASE  B:  THE QUEUE FOR THE CALLED ENTRY ALREADY CONTAINS
30
--           ANOTHER  TASK WHOSE RENDEZVOUS CANNOT BE COMPLETED WITHIN
31
--           THE SPECIFIED DELAY.
32
 
33
--HISTORY:
34
--     RJW 03/31/86 CREATED ORIGINAL TEST.
35
--     DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
36
 
37
with Impdef;
38
WITH REPORT; USE REPORT;
39
WITH CALENDAR; USE CALENDAR;
40
PROCEDURE C97301B IS
41
 
42
     OR_BRANCH_TAKEN : BOOLEAN := FALSE;
43
 
44
BEGIN
45
 
46
     TEST ("C97301B", "CHECK THAT A TIMED_ENTRY_CALL DELAYS FOR AT " &
47
                      "LEAST THE SPECIFIED AMOUNT OF TIME WHEN THE " &
48
                      "QUEUE FOR THE CALLED ENTRY ALREADY CONTAINS " &
49
                      "ANOTHER TASK WHOSE RENDEZVOUS CANNOT BE " &
50
                      "COMPLETED WITHIN THE SPECIFIED DELAY" );
51
 
52
 
53
     DECLARE
54
          WAIT_TIME  : DURATION :=  3.0 * Impdef.One_Second;
55
 
56
          TASK T1;
57
 
58
          TASK T2 IS
59
               ENTRY AWAKEN_T2;
60
          END T2;
61
 
62
          TASK T3 IS
63
               ENTRY AWAKEN_T3;
64
               ENTRY RELEASE_T;
65
          END T3;
66
 
67
          TASK  T  IS
68
               ENTRY  DO_IT_NOW_OR_WAIT (X : INTEGER);
69
          END  T;
70
 
71
          TASK BODY  T  IS
72
          BEGIN
73
               ACCEPT DO_IT_NOW_OR_WAIT (X : INTEGER) DO
74
                    IF X = 1 THEN
75
                         T2.AWAKEN_T2;
76
                         WHILE DO_IT_NOW_OR_WAIT'COUNT = 0 LOOP
77
                              DELAY 1.0 * Impdef.One_Second;
78
                         END LOOP;
79
                         T3.AWAKEN_T3;
80
                         T3.RELEASE_T;
81
                    ELSE
82
                         FAILED ("WRONG TASK IN RENDEZVOUS - 1");
83
                    END IF;
84
               END DO_IT_NOW_OR_WAIT;
85
               ACCEPT DO_IT_NOW_OR_WAIT (X : INTEGER) DO
86
                    IF X /= 2 THEN
87
                         FAILED ("WRONG TASK IN RENDEZVOUS - 2");
88
                    END IF;
89
               END DO_IT_NOW_OR_WAIT;
90
          END  T;
91
 
92
          TASK BODY T1 IS
93
          BEGIN
94
               T.DO_IT_NOW_OR_WAIT (1);
95
          END T1;
96
 
97
          TASK BODY T2 IS
98
          BEGIN
99
               ACCEPT AWAKEN_T2;
100
               T.DO_IT_NOW_OR_WAIT (2);
101
          END T2;
102
 
103
          TASK BODY T3 IS
104
               START_TIME : TIME;
105
               STOP_TIME : TIME;
106
          BEGIN
107
               BEGIN
108
                    ACCEPT AWAKEN_T3;
109
                    START_TIME := CLOCK;
110
                    SELECT
111
                         T.DO_IT_NOW_OR_WAIT (3);
112
                    OR
113
                                         -- THIS BRANCH MUST BE CHOSEN.
114
                         DELAY WAIT_TIME;
115
                         STOP_TIME := CLOCK;
116
                         IF STOP_TIME >= (WAIT_TIME + START_TIME) THEN
117
                              NULL;
118
                         ELSE
119
                              FAILED ( "INSUFFICIENT DELAY" );
120
                         END IF;
121
                         OR_BRANCH_TAKEN := TRUE;
122
                         COMMENT( "OR_BRANCH TAKEN" );
123
                         ACCEPT RELEASE_T;
124
                    END SELECT;
125
               EXCEPTION
126
                    WHEN TASKING_ERROR =>
127
                         FAILED ( "TASKING ERROR" );
128
               END;
129
                             -- END OF BLOCK CONTAINING TIMED
130
                             -- ENTRY CALL.
131
 
132
                             -- BY NOW, THE TASK T IS EFFECTIVELY
133
                             -- TERMINATED (AND THE NONLOCALS UPDATED).
134
 
135
               IF OR_BRANCH_TAKEN THEN
136
                    NULL;
137
               ELSE
138
                    FAILED( "RENDEZVOUS ATTEMPTED" );
139
               END IF;
140
          END T3;
141
     BEGIN
142
          NULL;
143
     END;
144
 
145
     RESULT;
146
 
147
END C97301B;

powered by: WebSVN 2.1.0

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