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 - download
Index: ┃ B T

⟦082c5210c⟧ TextFile

    Length: 5641 (0x1609)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Octet, Mot, Acia_Pack, Erreur, Ppi_Pack, Ptm_Pack;
package body Periph is
    Not_Available : constant Natural := 20;
    Unknown_Periph : constant Natural := 21;
    Unknown_Id : constant Natural := 22;


    type Tperipheral is (Acia, Ppi, Ptm, Unknown);
    type Object is
        record
            Kind : Tperipheral;  
            Number : T_Periph_Number;
        end record;  
    type Object_Table is array (T_Periph_Number) of Object;
    type Object_Manager is
        record  
            Table : Object_Table;
            Last : T_Periph_Number := T_Periph_Number'First;
        end record;
    Periph_Manager : Object_Manager;


    procedure Init (Periph_Type : String;
                    It_Vector : Octet.T_Octet;
                    Basic_Address : Mot.T_Mot;
                    Memory_Mapped : Boolean;
                    It_Connected : Boolean;
                    Number_Of_Register : out Natural;
                    Identifier : out T_Periph_Number) is
        Periph_Number : T_Periph_Number;
        Kind : Tperipheral;
    begin
        Identifier := 0;
        Number_Of_Register := 0;
        if Periph_Manager.Last = T_Periph_Number'Last then
            Erreur.Detectee (Not_Available);
        else
            if Periph_Type = "ACIA" then
                Kind := Acia;
                Acia_Pack.Init (Periph_Manager.Last + 1, It_Vector,
                                Basic_Address, Memory_Mapped, It_Connected,
                                Number_Of_Register, Periph_Number);
            elsif Periph_Type = "PPI" then
                Kind := Ppi;
                Ppi_Pack.Init (Periph_Manager.Last + 1, It_Vector,
                               Basic_Address, Memory_Mapped, It_Connected,
                               Number_Of_Register, Periph_Number);
            elsif Periph_Type = "PTM" then
                Kind := Ptm;
                Ptm_Pack.Init (Periph_Manager.Last + 1, It_Vector,
                               Basic_Address, Memory_Mapped, It_Connected,
                               Number_Of_Register, Periph_Number);
            else  
                Periph_Number := T_Periph_Number'First;  
                Erreur.Detectee (Unknown_Periph);
            end if;
            if Periph_Number /= T_Periph_Number'First then
                Periph_Manager.Last := Periph_Manager.Last + 1;
                Periph_Manager.Table (Periph_Manager.Last).Kind := Kind;
                Periph_Manager.Table (Periph_Manager.Last).Number :=
                   Periph_Number;
                Identifier := Periph_Manager.Last;
            end if;
        end if;
    end Init;


    procedure Put_Register (Identifier : T_Periph_Number;
                            Register_Number : Natural;
                            Value : Octet.T_Octet) is
    begin
        if Identifier > Periph_Manager.Last or
           Identifier = T_Periph_Number'First then
            Erreur.Detectee (Unknown_Id);
        else  
            case Periph_Manager.Table (Identifier).Kind is
                when Acia =>
                    Acia_Pack.Put_Register
                       (Periph_Manager.Table (Identifier).Number,
                        Register_Number, Value);
                when Ppi =>
                    Ppi_Pack.Put_Register
                       (Periph_Manager.Table (Identifier).Number,
                        Register_Number, Value);
                when Ptm =>
                    Ptm_Pack.Put_Register
                       (Periph_Manager.Table (Identifier).Number,
                        Register_Number, Value);
                when others =>
                    Erreur.Detectee (Unknown_Id);
            end case;
        end if;
    end Put_Register;


    function Get_Register (Identifier : T_Periph_Number;
                           Register_Number : Natural) return Octet.T_Octet is
        Value : Octet.T_Octet;
    begin
        if Identifier > Periph_Manager.Last or
           Identifier = T_Periph_Number'First then
            Erreur.Detectee (Unknown_Id);
        else
            case Periph_Manager.Table (Identifier).Kind is
                when Acia =>
                    Value := Acia_Pack.Get_Register
                                (Periph_Manager.Table (Identifier).Number,
                                 Register_Number);
                when Ppi =>
                    Value := Ppi_Pack.Get_Register
                                (Periph_Manager.Table (Identifier).Number,
                                 Register_Number);
                when Ptm =>
                    Value := Ptm_Pack.Get_Register
                                (Periph_Manager.Table (Identifier).Number,
                                 Register_Number);
                when others =>
                    Erreur.Detectee (Unknown_Id);
            end case;
            return Value;
        end if;
    end Get_Register;


    procedure Reset is
    begin
        for I in 1 .. Periph_Manager.Last loop
            case Periph_Manager.Table (I).Kind is
                when Acia =>
                    Acia_Pack.Reset (Periph_Manager.Table (I).Number);
                when Ppi =>
                    Ppi_Pack.Reset (Periph_Manager.Table (I).Number);
                when Ptm =>
                    Ptm_Pack.Reset (Periph_Manager.Table (I).Number);
                when others =>
                    Erreur.Detectee (Unknown_Id);
            end case;
        end loop;
    end Reset;

    procedure Kill is
    begin
        Acia_Pack.Kill;
        Ppi_Pack.Kill;
        Ptm_Pack.Kill;
        Periph_Manager.Last := T_Periph_Number'First;
    end Kill;
end Periph;