1 | -- Package File Template |
---|
2 | -- |
---|
3 | -- Purpose: This package defines supplemental types, subtypes, |
---|
4 | -- constants, and functions |
---|
5 | -- package definissant le codage des fonctions MPI |
---|
6 | -- dans le champs packet type des instructions MPI |
---|
7 | |
---|
8 | -- Ce fichier définit les trames des instruction MPI qui sont utilisables |
---|
9 | library IEEE; |
---|
10 | use IEEE.STD_LOGIC_1164.all; |
---|
11 | |
---|
12 | package Packet_type is |
---|
13 | |
---|
14 | constant ADRLEN1 :natural:=16; |
---|
15 | constant MPI_COMM_WORLD :natural:=1; |
---|
16 | constant MPI_DEFAULT :natural:=0; |
---|
17 | constant MPI_INT :natural:=1; |
---|
18 | constant MPI_INFO_NULL :natural:=0; |
---|
19 | constant Default_Win :natural:=1; |
---|
20 | constant MPI_GET_RANK : std_logic_vector(3 downto 0) := "0000"; |
---|
21 | constant MPI_GET_SIZE : std_logic_vector(3 downto 0) := "0001"; |
---|
22 | constant MPI_BARRIER : std_logic_vector(3 downto 0) := "0010"; |
---|
23 | constant MPI_BARRIER_REACHED : std_logic_vector(3 downto 0) := "0011"; |
---|
24 | constant MPI_BARRIER_COMPLETED : std_logic_vector(3 downto 0) := "1110"; |
---|
25 | constant MPI_ACK : std_logic_vector(3 downto 0) := "0100"; |
---|
26 | constant MPI_PUT : std_logic_vector(3 downto 0) := "0101"; |
---|
27 | constant MPI_GET : std_logic_vector(3 downto 0) := "0110"; |
---|
28 | constant MPI_BROADCAST : std_logic_vector(3 downto 0) := "0111"; |
---|
29 | constant MPI_INIT : std_logic_vector(3 downto 0) := "1000"; |
---|
30 | constant MPI_SPAWN : std_logic_vector(3 downto 0) := "1001"; |
---|
31 | |
---|
32 | constant MPI_WIN_CREATE : std_logic_vector(3 downto 0) := "1010"; |
---|
33 | constant MPI_WIN_SYNC :std_logic_vector(3 downto 0):="1011"; |
---|
34 | constant MPI_WIN_COMPLETE : std_logic_vector(3 downto 0) := "1100"; |
---|
35 | constant MPI_WIN_POST : std_logic_vector(3 downto 0) := "1101"; |
---|
36 | constant MPI_WIN_WAIT : std_logic_vector(3 downto 0) := "1110"; |
---|
37 | |
---|
38 | |
---|
39 | |
---|
40 | constant MPI_WTIME : std_logic_vector(3 downto 0) := "1110"; |
---|
41 | constant MPI_WTICK : std_logic_vector(3 downto 0) := "1111"; |
---|
42 | constant MPI_CONFIG : std_logic_vector(3 downto 0) := "1101"; |
---|
43 | --paramètres des commandes |
---|
44 | Constant INIT_SEEKMAIN : std_logic_vector(3 downto 0) := "0001"; |
---|
45 | Constant INIT_SETRANK : std_logic_vector(3 downto 0) := "0011"; |
---|
46 | Constant INIT_REGISTER : std_logic_vector(3 downto 0) := "0010"; |
---|
47 | Constant INIT_STAT : std_logic_vector(3 downto 0) := "0100"; |
---|
48 | Constant INIT_SPAWN : std_logic_vector(3 downto 0) := "0101"; |
---|
49 | |
---|
50 | Constant SPAWN_LOAD : std_logic_vector(3 downto 0) := "1001"; |
---|
51 | Constant SPAWN_START : std_logic_vector(3 downto 0) := "1010"; |
---|
52 | Constant SPAWN_COMP : std_logic_vector(3 downto 0) := "1011"; |
---|
53 | Constant SPAWN_ERR : std_logic_vector(3 downto 0) := "1110"; |
---|
54 | |
---|
55 | Constant SYNC_WSTART : std_logic_vector(3 downto 0) := "0001"; |
---|
56 | Constant SYNC_WPOST : std_logic_vector(3 downto 0) := "0010"; |
---|
57 | Constant SYNC_WCOMP : std_logic_vector(3 downto 0) := "0011"; |
---|
58 | Constant SYNC_WWAIT : std_logic_vector(3 downto 0) := "0100"; |
---|
59 | -- constantes pour le NoC |
---|
60 | Constant NOC_GETPORTID : std_logic_vector(7 downto 0) := "00000001"; |
---|
61 | --constante pour les Ptr |
---|
62 | constant W_Status :natural:=0; --position relative des champs dans la mémoire |
---|
63 | constant W_Id :natural:=2; -- pour le type MPI_Win |
---|
64 | constant W_GStart :natural:=3; |
---|
65 | constant W_GPost :natural:=5; |
---|
66 | constant W_Addr :natural:=7; |
---|
67 | constant W_Size :natural:=9; |
---|
68 | constant W_comm :natural:=10; |
---|
69 | |
---|
70 | Type MPI_Datatype is (MPI_BYTE,MPI_INTEGER,MPI_REAL,MPI_PACKET, MPI_pointer); |
---|
71 | SUBType MPI_COMM is natural range 0 to 2**ADRLEN1-1 ; --pointeur sur la structure du communicateur |
---|
72 | subType Mpi_AInt is natural range 0 to 2**ADRLEN1-1 ; |
---|
73 | --subType Mpi_win is natural range 0 to 2**ADRLEN1-1 ; |
---|
74 | Type MPI_COMM_struc is record |
---|
75 | id : natural range 0 to 3; -- id du communicateur |
---|
76 | grp : std_logic_vector(15 downto 0); --groupe associé au communicateur |
---|
77 | nproc : natural range 0 to 15; -- nombre de membres du groupe de ce communicateur |
---|
78 | AddrLib : std_logic_vector(15 downto 0); -- adresse dans la mémoire de la Lib |
---|
79 | -- des registres GStart et GPost |
---|
80 | ParentId:natural range 0 to 3; --Id du communicateur parent si Intercomm=1 |
---|
81 | C_open,C_close,InterComm : std_logic; -- état du communciateur (Inistialisé ou finalisé) |
---|
82 | end record; |
---|
83 | |
---|
84 | Type Mpi_Win is record |
---|
85 | status : std_logic_vector(7 downto 0); --état de la fenêtre (create,Start,Complete,Post,WaitSync, etc.) |
---|
86 | id : natural range 0 to 15 ; -- numéro de la fenêtre |
---|
87 | |
---|
88 | Addr : std_logic_vector(15 downto 0); -- adresse dans la mémoire locale du PE |
---|
89 | Size : natural range 0 to 65535; -- taille de la fenêtre en octets |
---|
90 | GPost : std_logic_vector(15 downto 0);--registres de synchronisation en cible |
---|
91 | GStart : std_logic_vector(15 downto 0);-- registre de synchronisation source |
---|
92 | comm : MPI_COMM; -- Ptr sur communicateur associé à la fenêtre |
---|
93 | end record; |
---|
94 | Type Mpi_group is record --normalement sous-goupe d'un communicateur |
---|
95 | grp : std_logic_vector(15 downto 0); --( vecteur de la liste des processus du groupe) |
---|
96 | nb : natural range 0 to 15; -- nombre de membres(processus du groupe) |
---|
97 | comm_id : natural range 0 to 3; -- reférence du communicateur |
---|
98 | end record; |
---|
99 | end Packet_type; |
---|
100 | |
---|
101 | package body Packet_type is |
---|
102 | |
---|
103 | |
---|
104 | end Packet_type; |
---|