DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦0603b7053⟧ TextFile

    Length: 3694 (0xe6e)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile


-- PERFORMANCE MEASUREMENT : Measure the time to store and extract
--                           bit fields that are defined by nested
--                           representation clauses using packed arrays of
--                           Boolean and Integer record components
--

with Remote_Global;
use Remote_Global; -- control optimization
with Iteration; -- obtain stable measurement
with Piwg_Io; -- output results

procedure H000008 is  -- main procedure to execute

    Cpu_Time : Duration; -- CPU time for one feature execution
    Wall_Time : Duration; -- WALL time for one feature execution
    Check_Times : constant := 100; -- inside loop count and check
    Iteration_Count : Integer; -- set and varied by ITERATION package
    Stable : Boolean; -- true when measurement stable

    type Index is range 1 .. 7;
    Scan : Index;
    type Packed_Boolean is array (Index) of Boolean;
    pragma Pack (Packed_Boolean);
    type Small_Record is
        record
            I_1 : Integer range -5 .. -4;
            B_A : Packed_Boolean;
        end record;
    for Small_Record use
        record
            I_1 at 0 range 0 .. 0;
            B_A at 0 range 1 .. 7;
        end record;
--
    type Big_Record is
        record
            Int : Integer range 0 .. 255;
            Nest : Small_Record;
        end record;
    for Big_Record use
        record
            Int at 0 range 0 .. 7;
            Nest at 0 range 8 .. 15;
        end record;

    A_Big_One : Big_Record :=
       (Int => 255,
        Nest => (I_1 => -5,
                 B_A => (True, True, False, False, True, True, False)));

begin

    Iteration.Start_Control;  -- dummy to bring in pages on some machines

    delay 0.5;  -- wait for stable enviornment on some machines

    Iteration.Initialize (Iteration_Count);

    loop  -- until stable measurement, ITERATION_COUNT increases each time

--
-- Control loop
--
        Iteration.Start_Control;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            Scan := 1;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One; -- prevent optimization
                Remote;
                Scan := Index (Scan mod 5 + 1);
            end loop;
        end loop;
        if Scan /= Check_Times mod 5 + 2 then
            Scan := 2;
        end if;
        Iteration.Stop_Control (Global, Check_Times);

--
-- Test loop
--
        Iteration.Start_Test;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            Scan := 1;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One; -- prevent optimization
                Remote;
                Scan := Index (Scan mod 5 + 1);
                A_Big_One.Nest.B_A (Scan + 1) := A_Big_One.Nest.B_A (Scan);
                if A_Big_One.Nest.B_A (Scan) /= False then
                    if A_Big_One.Nest.I_1 /= -5 then
                        Scan := 1;
                        raise Program_Error;
                    end if;
                end if;
            end loop;
        end loop;
        if Scan /= Check_Times mod 5 + 2 then
            Scan := 2;
        end if;
        Iteration.Stop_Test (Global, Check_Times);
        Iteration.Test_Stable (Iteration_Count, Stable);
        exit when Stable;
    end loop;
--
    Iteration.Feature_Times (Cpu_Time, Wall_Time);

--
-- Printout
--
    Piwg_Io.Piwg_Output
       ("H000008", "Chapter 13", Cpu_Time, Wall_Time, Iteration_Count,
        " The time to store and extract bit fields that are",
        " defined by nested representation clauses using packed arrays of",
        " Boolean and Integer record components");

end H000008;