|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 25600 (0x6400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Mod101, package body Vsip, seg_05b81f
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Byte_Tools;
with Module_Type;
with Vme;
with System;
-- *********************************
-- **** instanced object : VSIP ****
-- *********************************
package body Vsip is
Base_Address_Vsip : System.Address;
Plugged_Module : array (1 .. 4) of Module_Type.Module_Vsip;
-- **************************************************
-- **** internal procedure : VSIP register setup ****
-- **************************************************
procedure Initialize (Mask_Register1 : in Byte_Tools.Byte_As_Number) is
Register_1 : Byte_Tools.Byte_As_Number;
Register_2 : Byte_Tools.Byte_As_Number;
Address_Register_1 : constant System.Address :=
System."+" (Base_Address_Vsip, 1);
Address_Register_2 : constant System.Address :=
System."+" (Base_Address_Vsip, 3);
for Register_1 use at Address_Register_1;
for Register_2 use at Address_Register_2;
begin
Register_1 := Mask_Register1; -- module initializing
Register_2 := 0;
end Initialize;
-- ********************
-- **** VSIP setup ****
-- ********************
procedure Setup is
Vsip_Mask_Register1 : Byte_Tools.Byte_As_Number;
Index : Byte_Tools.Bit_Number;
use Module_Type;
begin
-- **** VSIP initialization ****
Plugged_Module (1) := Scim_0;
Plugged_Module (2) := Scim_1;
Plugged_Module (3) := Scim_2;
Plugged_Module (4) := Scim_3;
Vsip_Mask_Register1 := 0;
-- **** build the VSIP register 1 configuration word ****
Index := Byte_Tools.Bit_Number'First;
for I in Plugged_Module'Range loop
if Module_Type."/=" (Plugged_Module (I), No_Module) then
Byte_Tools.Set_Bit_To_1
(Of_Byte => Vsip_Mask_Register1, The_Bit => Index);
Index := Byte_Tools.Bit_Number'Succ (Index);
end if;
end loop;
-- **** calculate the VSIP real address ****
Base_Address_Vsip := System."+"
(Base_Address, Vme.Addressing (Vme_Position));
Initialize (Vsip_Mask_Register1);
end Setup;
-- ***************************************
-- **** return the VSIP configuration ****
-- ***************************************
function Status (Register : in Integer; Number : in Positive)
return Byte_Tools.Byte_As_Number is
Register_1 : Byte_Tools.Byte_As_Number;
Register_2 : Byte_Tools.Byte_As_Number;
Address_Register_1 : constant System.Address :=
System."+" (Base_Address_Vsip, 1);
Address_Register_2 : constant System.Address :=
System."+" (Base_Address_Vsip, 3);
for Register_1 use at Address_Register_1;
for Register_2 use at Address_Register_2;
begin
case Number is
when 1 =>
return Register_1;
when 2 =>
return Register_2;
when others =>
raise Default_Reference_Register;
end case;
end Status;
-- ***********************************
-- **** instanced object : MOD101 ****
-- ***********************************
package body Mod101 is
Base_Address_Mod101 : System.Address;
Base_Address_Mod101_1 : System.Address;
Protection : Boolean := False;
type Fonction is (Input, Output, Other);
type Pin is
record
Groupe_Number : Group := No_Group;
Signal_Title : Byte_Tools.Bit_Number;
Pin_Function : Fonction := Other;
end record;
Connector : array (1 .. 50) of Pin;
Pointer_Group_0 : array (1 .. 8) of Pin_No;
Pointer_Group_1 : array (1 .. 8) of Pin_No;
Pointer_Group_2 : array (1 .. 8) of Pin_No;
Pointer_Group_3 : array (1 .. 8) of Pin_No;
Pointer_Group_4 : array (1 .. 8) of Pin_No;
use Byte_Tools;
-- **************************************
-- **** configure the instanced VSIP ****
-- **************************************
procedure Setup is
begin
-- **** set the MOD101 board address ****
Base_Address_Mod101 :=
System."+" (Base_Address_Module, Vme.Addressing (Vme_Position));
Base_Address_Mod101_1 := System."+" (Base_Address_Mod101, 1);
Initialize_Connector;
end Setup;
-- ***************************************************
-- **** enable the pin I/O type control operation ****
-- ***************************************************
procedure Protection_On is
begin
Protection := True;
end Protection_On;
-- ****************************************************
-- **** disable the pin I/O type control operation ****
-- ****************************************************
procedure Protection_Off is
begin
Protection := False;
end Protection_Off;
-- **********************************
-- **** initialize the connector ****
-- **********************************
procedure Initialize_Connector is
Tampon : Byte_Tools.Bit_Number;
begin
for I in Pointer_Group_0'Range loop
Pointer_Group_0 (I) := (I + 2);
end loop;
for I in Pointer_Group_1'Range loop
Pointer_Group_1 (I) := (I + 12);
end loop;
for I in Pointer_Group_2'Range loop
Pointer_Group_2 (I) := (I + 22);
end loop;
for I in Pointer_Group_3'Range loop
Pointer_Group_3 (I) := (I + 32);
end loop;
for I in 4 .. Pointer_Group_4'Last loop
Pointer_Group_4 (I) := (I + 38);
end loop;
Pointer_Group_4 (1) := 12;
Pointer_Group_4 (2) := 22;
Pointer_Group_4 (3) := 32;
Tampon := Byte_Tools.Bit_Number'First;
for Index in Pointer_Group_0'Range loop
Connector (Pointer_Group_0 (Index)) := (Group0, Tampon, Input);
if Tampon /= Byte_Tools.Bit_Number'Last then
Tampon := Byte_Tools.Bit_Number'Succ (Tampon);
end if;
end loop;
Tampon := Byte_Tools.Bit_Number'First;
for Index in Pointer_Group_1'Range loop
Connector (Pointer_Group_1 (Index)) := (Group1, Tampon, Input);
if Tampon /= Byte_Tools.Bit_Number'Last then
Tampon := Byte_Tools.Bit_Number'Succ (Tampon);
end if;
end loop;
Tampon := Byte_Tools.Bit_Number'First;
for Index in Pointer_Group_2'Range loop
Connector (Pointer_Group_2 (Index)) := (Group2, Tampon, Input);
if Tampon /= Byte_Tools.Bit_Number'Last then
Tampon := Byte_Tools.Bit_Number'Succ (Tampon);
end if;
end loop;
Tampon := Byte_Tools.Bit_Number'First;
for Index in Pointer_Group_3'Range loop
Connector (Pointer_Group_3 (Index)) := (Group3, Tampon, Input);
if Tampon /= Byte_Tools.Bit_Number'Last then
Tampon := Byte_Tools.Bit_Number'Succ (Tampon);
end if;
end loop;
Tampon := Byte_Tools.Bit_Number'First;
for Index in Pointer_Group_4'Range loop
Connector (Pointer_Group_4 (Index)) := (Group4, Tampon, Input);
if Tampon /= Byte_Tools.Bit_Number'Last then
Tampon := Byte_Tools.Bit_Number'Succ (Tampon);
end if;
end loop;
end Initialize_Connector;
-- ****************************************************************
-- **** are we working with an pin I/O type control operation? ****
-- ****************************************************************
function Is_Protection_On return Boolean is
begin
return Protection;
end Is_Protection_On;
-- ***************************************
-- **** set the wished pin as a input ****
-- ***************************************
procedure Set_Input_Pin (Pin : in Pin_No) is
begin
if (Connector (Pin).Pin_Function /= Other) then
Connector (Pin).Pin_Function := Input;
else
raise Pin_Error;
end if;
end Set_Input_Pin;
-- ****************************************
-- **** set the wished pin as a output ****
-- ****************************************
procedure Set_Output_Pin (Pin : in Pin_No) is
begin
if (Connector (Pin).Pin_Function /= Other) then
Connector (Pin).Pin_Function := Output;
else
raise Pin_Error;
end if;
end Set_Output_Pin;
function Is_Pin_Output (Pin : in Pin_No) return Boolean is
begin
return (Connector (Pin).Pin_Function = Output);
end Is_Pin_Output;
-- ********************************
-- **** turn the MOD101 led on ****
-- ********************************
procedure Led_On is
Pointer_1 : Byte_Tools.Byte_As_Number;
for Pointer_1 use at Base_Address_Mod101;
begin
Pointer_1 := 16#81#;
end Led_On;
-- *********************************
-- **** turn the MOD101 led off ****
-- *********************************
procedure Led_Off is
Pointer_1 : Byte_Tools.Byte_As_Number;
for Pointer_1 use at Base_Address_Mod101;
begin
Pointer_1 := 16#80#;
end Led_Off;
function Is_Led_On return Boolean is
begin
return False;
end Is_Led_On;
-- *************************************
-- **** read a pin of the connector ****
-- *************************************
function Read_Pin (Pin : in Pin_No) return Boolean is
Value_Group : Byte_Tools.Byte_As_Number;
Pin_Type : Bit_Number;
begin
if (Connector (Pin).Pin_Function /= Other) then
Value_Group := Read_Group (Gp =>
(Connector (Pin).Groupe_Number));
return Byte_Tools.Test_Bit
(Number => Connector (Pin).Signal_Title,
Of_Byte => Value_Group);
else
raise Pin_Error;
end if;
end Read_Pin;
-- ***************************************
-- **** read a group of the connector ****
-- ***************************************
function Read_Group (Gp : in Group) return Byte_Tools.Byte_As_Number is
Pointer_1 : Byte_Tools.Byte_As_Number;
for Pointer_1 use at Base_Address_Mod101;
Pointer_2 : Byte_Tools.Byte_As_Number;
for Pointer_2 use at Base_Address_Mod101_1;
begin
case Gp is
when No_Group =>
raise Group_Error;
when Group0 =>
Pointer_1 := 0;
when Group1 =>
Pointer_1 := 1;
when Group2 =>
Pointer_1 := 2;
when Group3 =>
Pointer_1 := 3;
when Group4 =>
Pointer_1 := 4;
end case;
return Pointer_2;
end Read_Group;
-- ********************************
-- **** internal group writing ****
-- ********************************
procedure Write (To_Group : in Group;
Value_Gp : in Byte_Tools.Byte_As_Number) is
Pointer_1 : Byte_Tools.Byte_As_Number;
for Pointer_1 use at Base_Address_Mod101;
Pointer_2 : Byte_Tools.Byte_As_Number;
for Pointer_2 use at Base_Address_Mod101_1;
begin
case To_Group is
when No_Group =>
raise Group_Error;
when Group0 =>
Pointer_1 := 0;
when Group1 =>
Pointer_1 := 1;
when Group2 =>
Pointer_1 := 2;
when Group3 =>
Pointer_1 := 3;
when Group4 =>
Pointer_1 := 4;
end case;
Pointer_2 := Value_Gp;
-- **** output enabled ****
Pointer_1 := 16#90#;
-- **** for the following group ****
-- case To_Group is
-- when No_Group =>
-- raise Group_Error;
-- when Group0 =>
-- Pointer_2 := 1;
-- when Group1 =>
-- Pointer_2 := 2;
-- when Group2 =>
-- Pointer_2 := 4;
-- when Group3 =>
-- Pointer_2 := 8;
-- when Group4 =>
-- Pointer_2 := 16;
-- end case;
Pointer_2 := 16#1F#;
end Write;
-- *****************************************
-- **** write to a pin of the connector ****
-- *****************************************
procedure Write_Pin (Pin : in Pin_No; Status : in Boolean) is
Value_Group : Byte_Tools.Byte_As_Number;
begin
if (Connector (Pin).Pin_Function = Output) or not Protection then
Value_Group := Read_Group (Gp => Connector (Pin).Groupe_Number);
if Status then
Set_Bit_To_1 (Of_Byte => Value_Group,
The_Bit => Connector (Pin).Signal_Title);
else
Set_Bit_To_0 (Of_Byte => Value_Group,
The_Bit => Connector (Pin).Signal_Title);
end if;
Write (To_Group => Connector (Pin).Groupe_Number,
Value_Gp => Value_Group);
else
raise Pin_Error;
end if;
end Write_Pin;
-- *******************************************
-- **** write to a group of the connector ****
-- *******************************************
procedure Write_Group (Gp : in Group;
Value : in Byte_Tools.Byte_As_Number) is
Authorized : Boolean;
Index : Positive;
begin
Authorized := True;
if Protection then
Index := 1;
case Gp is
when No_Group =>
raise Group_Error;
when Group0 =>
while Index in Pointer_Group_0'Range and Authorized loop
Authorized := (Connector (Pointer_Group_0 (Index)).
Pin_Function = Output);
Index := Index + 1;
end loop;
when Group1 =>
while Index in Pointer_Group_1'Range and Authorized loop
Authorized := (Connector (Pointer_Group_1 (Index)).
Pin_Function = Output);
Index := Index + 1;
end loop;
when Group2 =>
while Index in Pointer_Group_2'Range and Authorized loop
Authorized := (Connector (Pointer_Group_2 (Index)).
Pin_Function = Output);
Index := Index + 1;
end loop;
when Group3 =>
while Index in Pointer_Group_3'Range and Authorized loop
Authorized := (Connector (Pointer_Group_3 (Index)).
Pin_Function = Output);
Index := Index + 1;
end loop;
when Group4 =>
while Index in Pointer_Group_4'Range and Authorized loop
Authorized := (Connector (Pointer_Group_4 (Index)).
Pin_Function = Output);
Index := Index + 1;
end loop;
end case;
end if;
if Authorized then
Write (To_Group => Gp, Value_Gp => Value);
else
raise Group_Error;
end if;
end Write_Group;
end Mod101;
end Vsip;
nblk1=18
nid=d
hdr6=26
[0x00] rec0=1c rec1=00 rec2=01 rec3=006
[0x01] rec0=1a rec1=00 rec2=05 rec3=072
[0x02] rec0=19 rec1=00 rec2=12 rec3=028
[0x03] rec0=1d rec1=00 rec2=06 rec3=030
[0x04] rec0=1b rec1=00 rec2=0b rec3=024
[0x05] rec0=18 rec1=00 rec2=16 rec3=05e
[0x06] rec0=16 rec1=00 rec2=03 rec3=07a
[0x07] rec0=17 rec1=00 rec2=14 rec3=026
[0x08] rec0=1a rec1=00 rec2=11 rec3=018
[0x09] rec0=1e rec1=00 rec2=0e rec3=024
[0x0a] rec0=1e rec1=00 rec2=04 rec3=008
[0x0b] rec0=19 rec1=00 rec2=10 rec3=036
[0x0c] rec0=1c rec1=00 rec2=09 rec3=046
[0x0d] rec0=1e rec1=00 rec2=15 rec3=050
[0x0e] rec0=17 rec1=00 rec2=17 rec3=004
[0x0f] rec0=0d rec1=00 rec2=0a rec3=03c
[0x10] rec0=11 rec1=00 rec2=08 rec3=022
[0x11] rec0=15 rec1=00 rec2=07 rec3=018
[0x12] rec0=03 rec1=00 rec2=0c rec3=000
[0x13] rec0=03 rec1=00 rec2=0c rec3=000
[0x14] rec0=11 rec1=00 rec2=08 rec3=022
[0x15] rec0=15 rec1=00 rec2=07 rec3=018
[0x16] rec0=03 rec1=00 rec2=0c rec3=000
[0x17] rec0=00 rec1=00 rec2=00 rec3=000
tail 0x2176afd3e894b4f17c3b4 0x42a00088462060003
Free Block Chain:
0xd: 0000 00 18 00 1f 80 1c 20 20 20 20 20 20 20 20 20 20 ┆ ┆
0x18: 0000 00 13 00 1b 80 18 20 20 20 20 20 20 20 20 20 20 ┆ ┆
0x13: 0000 00 0f 00 0c 80 09 20 28 50 69 6e 29 2e 53 69 09 ┆ (Pin).Si ┆
0xf: 0000 00 02 03 fc 00 32 20 20 20 20 20 20 20 20 20 20 ┆ 2 ┆
0x2: 0000 00 00 00 28 80 1b 6c 73 2e 42 69 74 5f 4e 75 6d ┆ ( ls.Bit_Num┆