forked from OSVVM/OSVVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RandomBasePkg.vhd
602 lines (541 loc) · 24 KB
/
RandomBasePkg.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
--
-- File Name: RandomBasePkg.vhd
-- Design Unit Name: RandomBasePkg
-- Revision: STANDARD VERSION
--
-- Maintainer: Jim Lewis email: [email protected]
-- Contributor(s):
-- Jim Lewis [email protected]
--
--
-- Description:
-- Defines Base randomization, seed definition, seed generation,
-- and seed IO functionality for RandomPkg.vhd
-- Defines:
-- Procedure Uniform - baseline randomization
-- Type RandomSeedType - the seed as a single object
-- function GenRandSeed from integer_vector, integer, or string
-- IO function to_string, & procedures write, read
--
-- In revision 2.0 these types and functions are included by package reference.
-- Long term these will be passed as generics to RandomGenericPkg
--
--
-- Developed for:
-- SynthWorks Design Inc.
-- VHDL Training Classes
-- 11898 SW 128th Ave. Tigard, Or 97223
-- http://www.SynthWorks.com
--
-- Revision History:
-- Date Version Description
-- 06/2021 2021.06 Updated GenRandSeed hash to DJBX33A
-- 01/2020 2020.01 Updated Licenses to Apache
-- 6/2015 2015.06 Changed GenRandSeed to impure
-- 1/2015 2015.01 Changed Assert/Report to Alert
-- 5/2013 2013.05 No Changes
-- 4/2013 2013.04 No Changes
-- 03/01/2011 2.0 STANDARD VERSION
-- Fixed abstraction by moving RandomParmType to RandomPkg.vhd
-- 02/25/2009 1.1 Replaced reference to std_2008 with a reference
-- to ieee_proposed.standard_additions.all ;
-- 02/2009: 1.0 First Public Released Version
-- 01/2008: 0.1 Initial revision
-- Numerous revisions for VHDL Testbenches and Verification
--
--
-- This file is part of OSVVM.
--
-- Copyright (c) 2008 - 2020 by SynthWorks Design Inc.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
library ieee ;
use ieee.math_real.all ;
use std.textio.all ;
use work.OsvvmGlobalPkg.all ;
use work.AlertLogPkg.all ;
use work.SortListPkg_int.all ;
-- comment out following 2 lines with VHDL-2008. Leave in for VHDL-2002
-- library ieee_proposed ; -- remove with VHDL-2008
-- use ieee_proposed.standard_additions.all ; -- remove with VHDL-2008
package RandomBasePkg is
constant OSVVM_RANDOM_ALERTLOG_ID : AlertLogIDType := OSVVM_ALERTLOG_ID ;
-----------------------------------------------------------------
-- note NULL_RANGE_TYPE should probably be in std.standard
subtype NULL_RANGE_TYPE is integer range 0 downto 1 ;
constant NULL_INTV : integer_vector (NULL_RANGE_TYPE) := (others => 0) ;
-----------------------------------------------------------------
-- RandomSeedType - Abstract the type for randomization
type RandomSeedType is array (1 to 2) of integer ;
-----------------------------------------------------------------
-- Uniform
-- Generate a random number with a Uniform distribution
-- Required by RandomPkg. All randomization is derived from here.
-- Value produced must be either:
-- 0 <= Value < 1 or 0 < Value < 1
--
-- Current version uses ieee.math_real.Uniform
-- This abstraction allows higher precision version
-- of a uniform distribution to be used provided
--
procedure Uniform (Result : out real ; Seed : inout RandomSeedType) ;
-----------------------------------------------------------------
-- GenRandSeed
-- Generate / hash a seed from a value that is integer_vector, String, Time, or Integer to RandomSeedType
-- Used by RandomPkg.InitSeed
-- GenRandSeed makes sure all values are in a valid range
impure function GenRandSeed (IV : integer_vector) return RandomSeedType ;
impure function OldGenRandSeed(IV : integer_vector) return RandomSeedType ;
impure function GenRandSeed (I : integer) return RandomSeedType ;
impure function OldGenRandSeed(I : integer) return RandomSeedType ;
impure function GenRandSeed (S : string) return RandomSeedType ;
impure function OldGenRandSeed(S : string) return RandomSeedType ;
-----------------------------------------------------------------
--- RandomSeedType IO
function to_string(A : RandomSeedType; Separator : string := " ") return string ;
procedure write(variable L: inout line ; A : RandomSeedType ) ;
procedure read (variable L: inout line ; A : out RandomSeedType ; good : out boolean ) ;
procedure read (variable L: inout line ; A : out RandomSeedType ) ;
-----------------------------------------------------------------
--- Distribution Types and read/write procedures
type RandomDistType is (NONE, UNIFORM, FAVOR_SMALL, FAVOR_BIG, NORMAL, POISSON) ;
type RandomParmType is record
Distribution : RandomDistType ;
Mean : Real ; -- also used as probability of success
StdDeviation : Real ; -- also used as number of trials for binomial
end record ;
-----------------------------------------------------------------
-- RandomParm IO
function to_string(A : RandomDistType) return string ;
procedure write(variable L : inout line ; A : RandomDistType ) ;
procedure read (variable L : inout line ; A : out RandomDistType ; good : out boolean ) ;
procedure read (variable L : inout line ; A : out RandomDistType ) ;
function to_string(A : RandomParmType) return string ;
procedure write(variable L : inout line ; A : RandomParmType ) ;
procedure read (variable L : inout line ; A : out RandomParmType ; good : out boolean ) ;
procedure read (variable L : inout line ; A : out RandomParmType ) ;
-----------------------------------------------------------------
--- Randomization Support
--- Scale - Scale a value to be within a given range
--- FavorSmall, FavorBig - Distribution Support
--- RemoveExclude
function Scale (A, Min, Max : real) return real ;
function Scale (A : real ; Min, Max : integer) return integer ;
function FavorSmall (A : real) return real ;
function FavorBig (A : real) return real ;
function to_time_vector (A : integer_vector ; Unit : time) return time_vector ;
function to_integer_vector (A : time_vector ; Unit : time) return integer_vector ;
procedure RemoveExclude (A, Exclude : integer_vector ; variable NewA : out integer_vector ; variable NewALength : inout natural ) ;
function inside (A : real ; Exclude : real_vector) return boolean ;
procedure RemoveExclude (A, Exclude : real_vector ; variable NewA : out real_vector ; variable NewALength : inout natural ) ;
function inside (A : time ; Exclude : time_vector) return boolean ;
procedure RemoveExclude (A, Exclude : time_vector ; variable NewA : out time_vector ; variable NewALength : inout natural ) ;
end RandomBasePkg ;
--- ///////////////////////////////////////////////////////////////////////////
--- ///////////////////////////////////////////////////////////////////////////
--- ///////////////////////////////////////////////////////////////////////////
package body RandomBasePkg is
-----------------------------------------------------------------
-- Uniform
-- Generate a random number with a Uniform distribution
-- Required by RandomPkg. All randomization is derived from here.
-- Value produced must be either:
-- 0 <= Value < 1 or 0 < Value < 1
--
-- Current version uses ieee.math_real.Uniform
-- This abstraction allows higher precision version
-- of a uniform distribution to be used provided
--
-----------------------------------------------------------------
procedure Uniform (
-----------------------------------------------------------------
Result : out real ;
Seed : inout RandomSeedType
) is
begin
ieee.math_real.Uniform (Seed(Seed'left), Seed(Seed'right), Result) ;
end procedure Uniform ;
-----------------------------------------------------------------
-- GenRandSeed
-- Convert integer_vector to RandomSeedType
-- Uniform requires two seed values of the form:
-- 1 <= SEED1 <= 2147483562; 1 <= SEED2 <= 2147483398
--
-- if 2 seed values are passed to GenRandSeed and they are
-- in the above range, then they must remain unmodified.
------------------------------------------------------------
impure function GenRandSeed(IV : integer_vector) return RandomSeedType is
------------------------------------------------------------
alias iIV : integer_vector(1 to IV'length) is IV ;
variable Seed1 : integer ;
variable Seed2 : integer ;
constant SEED1_MAX : integer := 2147483562 ;
constant SEED2_MAX : integer := 2147483398 ;
begin
if iIV'Length <= 0 then -- no seed
Alert(OSVVM_ALERTLOG_ID, "RandomBasePkg.GenRandSeed received NULL integer_vector", FAILURE) ;
return (3, 17) ; -- if continue seed = (3, 17)
elsif iIV'Length = 1 then -- one seed value
-- inefficient handling, but condition is unlikely
return GenRandSeed(iIV(1)) ; -- generate a seed
else -- only use the left two values
-- mod returns 0 to MAX-1, the -1 adjusts legal values, +1 adjusts them back
-- 1 <= SEED1 <= 2147483562
Seed1 := ((iIV(1)-1) mod SEED1_MAX) + 1 ;
-- 1 <= SEED2 <= 2147483398
Seed2 := ((iIV(2)-1) mod SEED2_MAX) + 1 ;
return (Seed1, Seed2) ;
end if ;
end function GenRandSeed ;
------------------------------------------------------------
impure function OldGenRandSeed(IV : integer_vector) return RandomSeedType is
------------------------------------------------------------
alias iIV : integer_vector(1 to IV'length) is IV ;
variable Seed1 : integer ;
variable Seed2 : integer ;
constant SEED1_MAX : integer := 2147483562 ;
constant SEED2_MAX : integer := 2147483398 ;
begin
if iIV'Length <= 0 then -- no seed
Alert(OSVVM_ALERTLOG_ID, "RandomBasePkg.GenRandSeed received NULL integer_vector", FAILURE) ;
return (3, 17) ; -- if continue seed = (3, 17)
elsif iIV'Length = 1 then -- one seed value
-- inefficient handling, but condition is unlikely
return OldGenRandSeed(iIV(1)) ; -- generate a seed
else -- only use the left two values
-- mod returns 0 to MAX-1, the -1 adjusts legal values, +1 adjusts them back
-- 1 <= SEED1 <= 2147483562
Seed1 := ((iIV(1)-1) mod SEED1_MAX) + 1 ;
-- 1 <= SEED2 <= 2147483398
Seed2 := ((iIV(2)-1) mod SEED2_MAX) + 1 ;
return (Seed1, Seed2) ;
end if ;
end function OldGenRandSeed ;
-----------------------------------------------------------------
-- GenRandSeed - Integer
impure function GenRandSeed(I : integer) return RandomSeedType is
-----------------------------------------------------------------
variable result : RandomSeedType ;
begin
result(1) := integer((real(I) * 5381.0 + 313.0) mod 2.0 ** 30) ;
result(2) := integer((real(I) * 313.0 + 5381.0) mod 2.0 ** 30) ;
return result ; -- make value ranges legal
end function GenRandSeed ;
-----------------------------------------------------------------
impure function OldGenRandSeed(I : integer) return RandomSeedType is
-----------------------------------------------------------------
variable result : integer_vector(1 to 2) ;
begin
result(1) := I ;
result(2) := I/3 + 1 ;
return OldGenRandSeed(result) ; -- make value ranges legal
end function OldGenRandSeed ;
-----------------------------------------------------------------
-- GenRandSeed - String
-- usage: RV.GenRandSeed(RV'instance_path));
-- hash based on DJBX33A
impure function GenRandSeed(S : string) return RandomSeedType is
-----------------------------------------------------------------
constant LEN : integer := S'length ;
constant HALF_LEN : integer := LEN/2 ;
alias revS : string(LEN downto 1) is S ;
variable result : RandomSeedType ;
variable temp : real := 5381.0 ;
begin
for i in 1 to HALF_LEN loop
temp := (temp*33.0 + real(character'pos(revS(i)))) mod (2.0**30) ;
end loop ;
result(1) := integer(temp) ;
for i in HALF_LEN + 1 to LEN loop
temp := (temp*33.0 + real(character'pos(revS(i)))) mod (2.0**30) ;
end loop ;
result(2) := integer(temp) ;
return result ;
end function GenRandSeed ;
-----------------------------------------------------------------
impure function OldGenRandSeed(S : string) return RandomSeedType is
-----------------------------------------------------------------
constant LEN : integer := S'length ;
constant HALF_LEN : integer := LEN/2 ;
alias revS : string(LEN downto 1) is S ;
variable result : integer_vector(1 to 2) ;
variable temp : integer := 0 ;
begin
for i in 1 to HALF_LEN loop
temp := (temp + character'pos(revS(i))) mod (integer'right - 2**8) ;
end loop ;
result(1) := temp ;
for i in HALF_LEN + 1 to LEN loop
temp := (temp + character'pos(revS(i))) mod (integer'right - 2**8) ;
end loop ;
result(2) := temp ;
return OldGenRandSeed(result) ; -- make value ranges legal
end function OldGenRandSeed ;
-----------------------------------------------------------------
-- RandomSeedType IO
--
-----------------------------------------------------------------
function to_string(A : RandomSeedType; Separator : string := " ") return string is
-----------------------------------------------------------------
begin
return to_string(A(A'left)) & Separator & to_string(A(A'right)) ;
end function to_string ;
-----------------------------------------------------------------
procedure write(variable L: inout line ; A : RandomSeedType ) is
-----------------------------------------------------------------
begin
write(L, to_string(A)) ;
end procedure ;
-----------------------------------------------------------------
procedure read(variable L: inout line ; A : out RandomSeedType ; good : out boolean ) is
-----------------------------------------------------------------
variable iReadValid : boolean ;
begin
for i in A'range loop
read(L, A(i), iReadValid) ;
exit when not iReadValid ;
end loop ;
good := iReadValid ;
end procedure read ;
-----------------------------------------------------------------
procedure read(variable L: inout line ; A : out RandomSeedType ) is
-----------------------------------------------------------------
variable ReadValid : boolean ;
begin
read(L, A, ReadValid) ;
AlertIfNot(ReadValid, OSVVM_ALERTLOG_ID, "RandomBasePkg.read[line, RandomSeedType] failed", FAILURE) ;
end procedure read ;
-----------------------------------------------------------------
-- RandomParmType IO
--
-----------------------------------------------------------------
function to_string(A : RandomDistType) return string is
-----------------------------------------------------------------
begin
return RandomDistType'image(A) ;
end function to_string ;
-----------------------------------------------------------------
procedure write(variable L : inout line ; A : RandomDistType ) is
-----------------------------------------------------------------
begin
write(L, to_string(A)) ;
end procedure write ;
-----------------------------------------------------------------
procedure read(variable L : inout line ; A : out RandomDistType ; good : out boolean ) is
-----------------------------------------------------------------
variable strval : string(1 to 40) ;
variable len : natural ;
begin
-- procedure SREAD (L : inout LINE ; VALUE : out STRING ; STRLEN : out NATURAL) ;
sread(L, strval, len) ;
A := RandomDistType'value(strval(1 to len)) ;
good := len > 0 ;
end procedure read ;
-----------------------------------------------------------------
procedure read(variable L : inout line ; A : out RandomDistType ) is
-----------------------------------------------------------------
variable ReadValid : boolean ;
begin
read(L, A, ReadValid) ;
AlertIfNot( OSVVM_ALERTLOG_ID, ReadValid, "RandomPkg.read[line, RandomDistType] failed", FAILURE) ;
end procedure read ;
-----------------------------------------------------------------
function to_string(A : RandomParmType) return string is
-----------------------------------------------------------------
begin
return RandomDistType'image(A.Distribution) & " " &
to_string(A.Mean, 2) & " " & to_string(A.StdDeviation, 2) ;
end function to_string ;
-----------------------------------------------------------------
procedure write(variable L : inout line ; A : RandomParmType ) is
-----------------------------------------------------------------
begin
write(L, to_string(A)) ;
end procedure write ;
-----------------------------------------------------------------
procedure read(variable L : inout line ; A : out RandomParmType ; good : out boolean ) is
-----------------------------------------------------------------
variable strval : string(1 to 40) ;
variable len : natural ;
variable igood : boolean ;
begin
loop
-- procedure SREAD (L : inout LINE ; VALUE : out STRING ; STRLEN : out NATURAL) ;
sread(L, strval, len) ;
A.Distribution := RandomDistType'value(strval(1 to len)) ;
igood := len > 0 ;
exit when not igood ;
read(L, A.Mean, igood) ;
exit when not igood ;
read(L, A.StdDeviation, igood) ;
exit ;
end loop ;
good := igood ;
end procedure read ;
-----------------------------------------------------------------
procedure read(variable L : inout line ; A : out RandomParmType ) is
-----------------------------------------------------------------
variable ReadValid : boolean ;
begin
read(L, A, ReadValid) ;
AlertIfNot( OSVVM_ALERTLOG_ID, ReadValid, "RandomPkg.read[line, RandomParmType] failed", FAILURE) ;
end procedure read ;
-----------------------------------------------------------------
-- Randomization Support
-- Scale - Scale a value to be within a given range
-- FavorSmall, FavorBig - Distribution Support
-- RemoveExclude
--
-----------------------------------------------------------------
-- Scale - Scale a value to be within a given range
function Scale (A, Min, Max : real) return real is
-----------------------------------------------------------------
variable ValRange : Real ;
begin
ValRange := Max - Min ;
return A * ValRange + Min ;
--!! -- Already done checked and failed if error.
--!! -- If continuing this calculation is no worse than returning real'left
--!! if Max >= Min then
--!! ValRange := Max - Min ;
--!! return A * ValRange + Min ;
--!! else
--!! return real'left ;
--!! end if ;
end function Scale ;
-----------------------------------------------------------------
function Scale (A : real ; Min, Max : integer) return integer is
-----------------------------------------------------------------
variable ValRange : real ;
variable rMin, rMax : real ;
begin
rMin := real(Min) - 0.5 ;
rMax := real(Max) + 0.5 ;
ValRange := rMax - rMin ;
return integer(round(A * ValRange + rMin)) ;
--!! -- Already done checked and failed if error.
--!! -- If continuing this calculation is no worse than returning real'left
--!! if Max >= Min then
--!! rMin := real(Min) - 0.5 ;
--!! rMax := real(Max) + 0.5 ;
--!! ValRange := rMax - rMin ;
--!! return integer(round(A * ValRange + rMin)) ;
--!! else
--!! return integer'left ;
--!! end if ;
end function Scale ;
-----------------------------------------------------------------
-- FavorSmall - create more smaller values
function FavorSmall (A : real) return real is
-----------------------------------------------------------------
begin
return 1.0 - sqrt(A) ;
end FavorSmall ;
-----------------------------------------------------------------
-- FavorBig - create more larger values
-- alias FavorBig is sqrt[real return real] ;
function FavorBig (A : real) return real is
-----------------------------------------------------------------
begin
return sqrt(A) ;
end FavorBig ;
-----------------------------------------------------------------
-- local.
function to_time_vector (A : integer_vector ; Unit : time) return time_vector is
-----------------------------------------------------------------
variable result : time_vector(A'range) ;
begin
for i in A'range loop
result(i) := A(i) * Unit ;
end loop ;
return result ;
end function to_time_vector ;
-----------------------------------------------------------------
-- local
function to_integer_vector (A : time_vector ; Unit : time) return integer_vector is
-----------------------------------------------------------------
variable result : integer_vector(A'range) ;
begin
for i in A'range loop
result(i) := A(i) / Unit ;
end loop ;
return result ;
end function to_integer_vector ;
-----------------------------------------------------------------
-- Remove the exclude list from the list - integer_vector
procedure RemoveExclude(A, Exclude : integer_vector ; variable NewA : out integer_vector ; variable NewALength : inout natural ) is
-----------------------------------------------------------------
alias norm_NewA : integer_vector(1 to NewA'length) is NewA ;
begin
NewALength := 0 ;
for i in A'range loop
if not inside(A(i), Exclude) then
NewALength := NewALength + 1 ;
norm_NewA(NewALength) := A(i) ;
end if ;
end loop ;
end procedure RemoveExclude ;
-----------------------------------------------------------------
-- Inside - real_vector
function inside(A : real ; Exclude : real_vector) return boolean is
-----------------------------------------------------------------
begin
for i in Exclude'range loop
if A = Exclude(i) then
return TRUE ;
end if ;
end loop ;
return FALSE ;
end function inside ;
-----------------------------------------------------------------
-- Remove the exclude list from the list - real_vector
procedure RemoveExclude(A, Exclude : real_vector ; variable NewA : out real_vector ; variable NewALength : inout natural ) is
-----------------------------------------------------------------
alias norm_NewA : real_vector(1 to NewA'length) is NewA ;
begin
NewALength := 0 ;
for i in A'range loop
if not inside(A(i), Exclude) then
NewALength := NewALength + 1 ;
norm_NewA(NewALength) := A(i) ;
end if ;
end loop ;
end procedure RemoveExclude ;
-----------------------------------------------------------------
-- Inside - time_vector
function inside(A : time ; Exclude : time_vector) return boolean is
-----------------------------------------------------------------
begin
for i in Exclude'range loop
if A = Exclude(i) then
return TRUE ;
end if ;
end loop ;
return FALSE ;
end function inside ;
-----------------------------------------------------------------
-- Remove the exclude list from the list - time_vector
procedure RemoveExclude(A, Exclude : time_vector ; variable NewA : out time_vector ; variable NewALength : inout natural ) is
-----------------------------------------------------------------
alias norm_NewA : time_vector(1 to NewA'length) is NewA ;
begin
NewALength := 0 ;
for i in A'range loop
if not inside(A(i), Exclude) then
NewALength := NewALength + 1 ;
norm_NewA(NewALength) := A(i) ;
end if ;
end loop ;
end procedure RemoveExclude ;
end RandomBasePkg ;