[143] | 1 | -- Package File Template |
---|
| 2 | -- |
---|
| 3 | -- Purpose: This package defines supplemental types, subtypes, |
---|
| 4 | -- constants, and components |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | library IEEE; |
---|
| 8 | use IEEE.STD_LOGIC_1164.all; |
---|
| 9 | use IEEE.numeric_std.all; |
---|
| 10 | package CoreTypes is |
---|
| 11 | CONSTANT Word :POSITIVE:= 8; |
---|
| 12 | CONSTANT ADRLEN:POSITIVE:=16; |
---|
| 13 | CONSTANT LZFILL :std_logic_vector(2*Word-ADRLEN to 0):=(others=>'0');--indique le nombre de zero à utiliser pour completer le bus de données lorsque la longueur restante du bus d'adresse est inférueure à la largeur du bus de données |
---|
| 14 | CONSTANT IADR0 : NATURAL :=2; --Adresse basse de l'instruction |
---|
| 15 | CONSTANT IADR1 : natural :=3; |
---|
| 16 | CONSTANT CORE_BASE_ADR :natural range 0 to 65535:=4096; |
---|
| 17 | CONSTANT WIN_BASE_ADR :natural range 0 to 65535:=CORE_BASE_ADR+4; |
---|
| 18 | CONSTANT CORE_UPPER_ADR : natural range 0 to 255:=16; |
---|
| 19 | CONSTANT CORE_GET_ADR:natural:=CORE_BASE_ADR+526; |
---|
| 20 | CONSTANT CORE_PUT_ADR :natural:=CORE_BASE_ADR+516; |
---|
| 21 | CONSTANT core_INIT_ADR : natural:=CORE_BASE_ADR+512; |
---|
| 22 | CONSTANT CORE_WCREATE_ADR : natural := CORE_BASE_ADR+536; |
---|
| 23 | CONSTANT CORE_WCOMPL_ADR : natural := CORE_BASE_ADR+546; |
---|
| 24 | CONSTANT CORE_WPOST_ADR : natural := CORE_BASE_ADR+556; |
---|
| 25 | CONSTANT CORE_WWAIT_ADR : natural := CORE_BASE_ADR+566; |
---|
| 26 | CONSTANT CORE_WSYNC_ADR : natural := CORE_BASE_ADR+576; |
---|
| 27 | CONSTANT CORE_SPAWN_ADR : natural := CORE_BASE_ADR+586; |
---|
| 28 | CONSTANT CORE_Rank2port_BASE :NATURAL:=52; |
---|
| 29 | CONSTANT CORE_RANK_ADR : NATURAL:=CORE_BASE_ADR+CORE_Rank2Port_Base; |
---|
| 30 | CONSTANT WIN0_ADR :natural :=CORE_BASE_ADR+4; |
---|
| 31 | CONSTANT WIN1_ADR :natural :=CORE_BASE_ADR+20; |
---|
| 32 | CONSTANT WIN2_ADR :natural :=CORE_BASE_ADR+36; |
---|
| 33 | CONSTANT WIN3_ADR :natural :=CORE_BASE_ADR+52; |
---|
| 34 | CONSTANT GETPORTID : std_logic_vector(3 downto 0):="0001"; |
---|
| 35 | |
---|
| 36 | type Typ_PortIO is |
---|
| 37 | array(natural range <>) of std_logic_vector( Word-1 downto 0); |
---|
| 38 | |
---|
| 39 | type memory is |
---|
| 40 | array (natural range <>) of std_logic_vector(word-1 downto 0); |
---|
| 41 | |
---|
| 42 | type Core_i is |
---|
| 43 | record |
---|
| 44 | Instr_ack :std_logic;-- signal la prise en compte de l'instruction |
---|
| 45 | Ready :std_logic;-- indique que la dernière fonction est terminée |
---|
| 46 | InitOk :std_logic; -- l'initialisation est terminée |
---|
| 47 | Hold_Req :std_logic;--Demande DMA |
---|
| 48 | RamSel :std_logic;-- indique le statut de la RAM (0 ->dispo 1->occupé par Core_MPI) |
---|
| 49 | IsMain : std_logic; -- indique si la librairie est principal |
---|
| 50 | Rank : natural range 0 to 15; --donne le rang du processus courant |
---|
| 51 | Spawned: std_logic; --indique que ce module a été activé par la bibliothèque |
---|
| 52 | end record; |
---|
| 53 | type Core_o is |
---|
| 54 | record |
---|
| 55 | Instr_en :std_logic; -- active une instruction MPI |
---|
| 56 | Hold_Ack :std_logic;-- Autorisation DMA |
---|
| 57 | MemBusy :std_logic;-- active le refus de DMA (1 -> ignoré la requête DMA de MPI HCL) |
---|
| 58 | Instruction :std_logic_vector (word-1 downto 0); -- fonction Mpi à exécuter |
---|
| 59 | end record; |
---|
| 60 | type core_s is |
---|
| 61 | record |
---|
| 62 | Rank : natural range 0 to 15; --donne le rang du processus courant |
---|
| 63 | IntState1 : natural range 0 to 255; --permet de stocker l'état des MAE interne dans les procédures |
---|
| 64 | IntState2 : natural range 0 to 255; |
---|
| 65 | WinId :natural range 0 to 255; --stocke le dernier Id utilisé par WinCreate |
---|
| 66 | GPost : std_logic_vector(15 downto 0); --etat de la fenêtre active |
---|
| 67 | GStart : std_logic_vector(15 downto 0); |
---|
| 68 | tmem : memory(0 to 3); --petite mémoire tampon pour stocker les variables statiques des MVPs |
---|
| 69 | end record; |
---|
| 70 | type core_io is |
---|
| 71 | record |
---|
| 72 | I:core_i; --les entrées |
---|
| 73 | O:core_o; --les sorties |
---|
| 74 | S:core_s; --les signaux temporaires |
---|
| 75 | end record; |
---|
| 76 | |
---|
| 77 | type Core_io_old is |
---|
| 78 | record |
---|
| 79 | Instr_en :std_logic; -- active une instruction MPI |
---|
| 80 | Instr_ack :std_logic;-- signal la prise en compte de l'instruction |
---|
| 81 | Ready :std_logic;-- indique que la dernière fonction est terminée |
---|
| 82 | InitOk :std_logic; -- l'initialisation est terminée |
---|
| 83 | Hold_Req :std_logic;--Demande DMA |
---|
| 84 | Hold_Ack :std_logic;-- Autorisation DMA |
---|
| 85 | MemBusy :std_logic;-- active le refus de DMA (1 -> ignoré la requête DMA) |
---|
| 86 | RamSel :std_logic;-- indique le statut de la RAM (0 ->dispo 1->occupé par Core_MPI) |
---|
| 87 | IntState1 : natural range 0 to 255; --permet de stocker l'état des MAE interne dans les procédures |
---|
| 88 | IntState2 : natural range 0 to 255; |
---|
| 89 | Instruction :std_logic_vector (word-1 downto 0); |
---|
| 90 | WinId :natural range 0 to 255; --stocke le dernier Id utilisé par WinCreate |
---|
| 91 | IsMain : std_logic; -- indique si la librairie est principal |
---|
| 92 | Rank : natural range 0 to 15; --donne le rang du processus courant |
---|
| 93 | Spawned: std_logic; --indique que ce module a été activé par la bibliothèque |
---|
| 94 | end record; |
---|
| 95 | |
---|
| 96 | type typ_dpram_i is |
---|
| 97 | record |
---|
| 98 | data_out : STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 99 | |
---|
| 100 | end record; |
---|
| 101 | type typ_dpram_o is |
---|
| 102 | record |
---|
| 103 | clk_wr : STD_LOGIC; |
---|
| 104 | clk_rd : STD_LOGIC; |
---|
| 105 | we : STD_LOGIC; |
---|
| 106 | ena : STD_LOGIC; |
---|
| 107 | enb : STD_LOGIC; |
---|
| 108 | addr_wr: STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 109 | addr_rd : STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 110 | data_in : STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 111 | end record; |
---|
| 112 | type typ_dpram is |
---|
| 113 | record |
---|
| 114 | O : typ_dpram_o; |
---|
| 115 | I : typ_dpram_I; |
---|
| 116 | end record; |
---|
| 117 | type Typ_MPIPort_in is |
---|
| 118 | record |
---|
| 119 | instruction : STD_LOGIC_VECTOR (Word -1 downto 0); |
---|
| 120 | instruction_en : STD_LOGIC; |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | packet_ack : std_logic; |
---|
| 124 | ram_data_out : STD_LOGIC_VECTOR (Word-1 downto 0); |
---|
| 125 | |
---|
| 126 | hold_ack : STD_Logic; --autorisation par l'application |
---|
| 127 | clk : STD_LOGIC; |
---|
| 128 | reset : STD_LOGIC; |
---|
| 129 | |
---|
| 130 | end record; |
---|
| 131 | type Typ_MPIPort_out is |
---|
| 132 | record |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | ram_we : STD_LOGIC; |
---|
| 136 | ram_en : STD_LOGIC; |
---|
| 137 | ram_data_in : STD_LOGIC_VECTOR (WORD-1 downto 0); |
---|
| 138 | ram_address_rd : STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 139 | ram_address_wr : STD_LOGIC_VECTOR (ADRLEN-1 downto 0); |
---|
| 140 | packet_received : STD_LOGIC; |
---|
| 141 | barrier_completed : STD_LOGIC; |
---|
| 142 | instruction_fifo_full : STD_LOGIC; |
---|
| 143 | PushOut : STD_LOGIC_VECTOR (WORD-1 downto 0); |
---|
| 144 | |
---|
| 145 | hold_req : STD_Logic; --requete vers application |
---|
| 146 | end record; |
---|
| 147 | |
---|
| 148 | Type Ar_MPIPort_In is array (positive range <>) of Typ_MPIPort_in; |
---|
| 149 | Type Ar_MPIPort_out is array (positive range <>) of Typ_MPIPort_out; |
---|
| 150 | type ar_DpRam is array (natural range <>) of typ_dpRam; |
---|
| 151 | -- Declare constants |
---|
| 152 | |
---|
| 153 | -- constant <constant_name> : time := <time_unit> ns; |
---|
| 154 | -- constant <constant_name> : integer := <value>; |
---|
| 155 | -- |
---|
| 156 | -- Declare functions and procedure |
---|
| 157 | Component SWITCH_GEN is |
---|
| 158 | generic(number_of_ports : positive := 8); |
---|
| 159 | port( |
---|
| 160 | -- ports d'entree |
---|
| 161 | Port_in : in typ_portIO(1 to number_of_ports) ; |
---|
| 162 | -- |
---|
| 163 | |
---|
| 164 | -- port de sortie |
---|
| 165 | Port_out : out typ_portIO(1 to number_of_ports); |
---|
| 166 | -- |
---|
| 167 | -- signaux de controle |
---|
| 168 | cmd_in_en : in std_logic_vector(number_of_ports downto 1); |
---|
| 169 | data_in_en : in std_logic_vector(number_of_ports downto 1); |
---|
| 170 | data_out_en : in std_logic_vector(number_of_ports downto 1); |
---|
| 171 | fifo_in_full : out std_logic_vector(number_of_ports downto 1); |
---|
| 172 | fifo_in_empty : out std_logic_vector(number_of_ports downto 1); |
---|
| 173 | data_available : out std_logic_vector(number_of_ports downto 1); |
---|
| 174 | clk : in STD_LOGIC; |
---|
| 175 | reset : in STD_LOGIC); |
---|
| 176 | end component SWITCH_GEN; |
---|
| 177 | -- déclaration des fonctions utilisées |
---|
| 178 | |
---|
| 179 | FUNCTION all_ones(s1:std_logic_vector) return std_logic; |
---|
| 180 | --This function returns if the input vector has all ones and no zeros |
---|
| 181 | FUNCTION all_zeros(s1:std_logic_vector) return std_logic; |
---|
| 182 | --This function returns if the input vector has all zeros and no ones |
---|
| 183 | FUNCTION incr_vec(s1:std_logic_vector;en:std_logic) return std_logic_vector; |
---|
| 184 | --This function increments an std_logic_vector type by '1', without |
---|
| 185 | --using any arithmatic |
---|
| 186 | |
---|
| 187 | FUNCTION dcr_vec(s1:std_logic_vector;en:std_logic) return std_logic_vector; |
---|
| 188 | --This function decrements an std_logic_vector type by '1', without |
---|
| 189 | --using any arithmatic |
---|
| 190 | FUNCTION Rol_Vec(s1:std_logic_vector) return std_logic_vector; |
---|
| 191 | --renvoie un std_logic_vector de taille ADRLEN |
---|
| 192 | Function Stdlv (s1 : natural) return std_logic_vector; |
---|
| 193 | --renvoie un std_logic_vector de taille width |
---|
| 194 | Function Stdlv (s1 : natural;width:positive ) return std_logic_vector; |
---|
| 195 | function image(L: bit_vector) return String; |
---|
| 196 | function image(L: bit) return String; |
---|
| 197 | function image(L: std_logic_vector) return String; |
---|
| 198 | function image(L: std_logic) return String; |
---|
| 199 | function Hex_to_Ascii(l : std_logic_vector(3 downto 0))return std_logic_vector; |
---|
| 200 | -- function HexImage(L: unsigned) return String; |
---|
| 201 | -- function HexImage(L: signed) return String; |
---|
| 202 | -- function HexImage(L: std_ulogic_vector) return String; |
---|
| 203 | -- function HexImage(L: std_logic_vector) return String; |
---|
| 204 | -- function HexImage(L: bit_vector) return String; |
---|
| 205 | end CoreTypes; |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | Package body CoreTypes is |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | FUNCTION incr_vec(s1:std_logic_vector;en:std_logic) return std_logic_vector is |
---|
| 212 | --this function increments a std_logic_vector type by '1' |
---|
| 213 | VARIABLE V : std_logic_vector(s1'high downto s1'low) ; |
---|
| 214 | VARIABLE tb : std_logic_vector(s1'high downto s1'low); |
---|
| 215 | BEGIN |
---|
| 216 | tb(s1'low) := en; |
---|
| 217 | V := s1; |
---|
| 218 | for i in (V'low + 1) to V'high loop |
---|
| 219 | tb(i) := V(i - 1) and tb(i -1); |
---|
| 220 | end loop; |
---|
| 221 | for i in V'low to V'high loop |
---|
| 222 | if(tb(i) = '1') then |
---|
| 223 | V(i) := not(V(i)); |
---|
| 224 | end if; |
---|
| 225 | end loop; |
---|
| 226 | return V; |
---|
| 227 | end incr_vec; -- end function |
---|
| 228 | |
---|
| 229 | FUNCTION dcr_vec(s1:std_logic_vector;en:std_logic) return std_logic_vector is |
---|
| 230 | --this function decrements a std_logic_vector type by '1' |
---|
| 231 | VARIABLE V : std_logic_vector(s1'high downto s1'low) ; |
---|
| 232 | VARIABLE tb : std_logic_vector(s1'high downto s1'low); |
---|
| 233 | BEGIN |
---|
| 234 | tb(s1'low) := not(en); |
---|
| 235 | V := s1; |
---|
| 236 | for i in (V'low + 1) to V'high loop |
---|
| 237 | tb(i) := V(i - 1) or tb(i -1); |
---|
| 238 | end loop; |
---|
| 239 | for i in V'low to V'high loop |
---|
| 240 | if(tb(i) = '0') then |
---|
| 241 | V(i) := not(V(i)); |
---|
| 242 | end if; |
---|
| 243 | end loop; |
---|
| 244 | return V; |
---|
| 245 | end dcr_vec; -- end function |
---|
| 246 | FUNCTION all_ones(s1:std_logic_vector) return std_logic is |
---|
| 247 | --this function tells if all bits of a vector are '1' |
---|
| 248 | --return value Z is '1', then vector has all 1 bits |
---|
| 249 | --VARIABLE V : std_logic_vector(s1'high downto s1'low) ; |
---|
| 250 | VARIABLE Z : std_logic; |
---|
| 251 | BEGIN |
---|
| 252 | Z := s1(s1'low); |
---|
| 253 | FOR i IN (s1'low+1) to s1'high LOOP |
---|
| 254 | Z := Z AND s1(i); |
---|
| 255 | END LOOP; |
---|
| 256 | RETURN Z; |
---|
| 257 | END all_ones; -- end function |
---|
| 258 | FUNCTION all_zeros(s1:std_logic_vector) return std_logic is |
---|
| 259 | --this function tells if all bits of a vector are '0' |
---|
| 260 | --return value Z if '1', then vector has all 0 bits |
---|
| 261 | --VARIABLE V : std_logic_vector(s1'high downto s1'low) ; |
---|
| 262 | VARIABLE Z : std_logic; |
---|
| 263 | BEGIN |
---|
| 264 | Z := '0'; |
---|
| 265 | FOR i IN (s1'low) to s1'high LOOP |
---|
| 266 | Z := Z OR s1(i); |
---|
| 267 | END LOOP; |
---|
| 268 | RETURN not(Z); |
---|
| 269 | END all_zeros; -- end function |
---|
| 270 | |
---|
| 271 | FUNCTION Rol_Vec(s1:std_logic_vector) return std_logic_vector is |
---|
| 272 | --cette fonction fait roter un STD_logic d'un pas vers la gauche |
---|
| 273 | VARIABLE V : std_logic_vector(s1'high downto s1'low) ; |
---|
| 274 | VARIABLE lb : std_logic :=s1(s1'left); |
---|
| 275 | BEGIN |
---|
| 276 | |
---|
| 277 | for i in V'left downto (V'right+1) loop |
---|
| 278 | V(i) := s1(i - 1) ; |
---|
| 279 | end loop; |
---|
| 280 | V(V'right):=lb; |
---|
| 281 | return V; |
---|
| 282 | end Rol_vec; |
---|
| 283 | Function Stdlv (s1 : natural ) return std_logic_vector is |
---|
| 284 | VARIABLE V : std_logic_vector(ADRLEN-1 downto 0); |
---|
| 285 | begin |
---|
| 286 | V:=std_logic_vector(to_unsigned(s1,ADRLEN)); |
---|
| 287 | return V; |
---|
| 288 | end stdlv; |
---|
| 289 | Function Stdlv (s1 : natural;width:positive ) return std_logic_vector is |
---|
| 290 | VARIABLE V : std_logic_vector(width-1 downto 0); |
---|
| 291 | begin |
---|
| 292 | V:=std_logic_vector(to_unsigned(s1,width)); |
---|
| 293 | return V; |
---|
| 294 | end stdlv; |
---|
| 295 | |
---|
| 296 | -- Start of heximage functions |
---|
| 297 | --function HexImage(L: bit_vector) return String is |
---|
| 298 | --begin |
---|
| 299 | --return(HexImage(imge(L))); |
---|
| 300 | --end function HexImage; |
---|
| 301 | -- |
---|
| 302 | --function HexImage(L: std_ulogic_vector) return String is |
---|
| 303 | --begin |
---|
| 304 | --return(HexImage(image(to_x01(L)))); |
---|
| 305 | --end function HexImage; |
---|
| 306 | |
---|
| 307 | --function HexImage(L: std_logic_vector) return String is |
---|
| 308 | --begin |
---|
| 309 | --return(HexImage(imge(to_x01(L)))); |
---|
| 310 | --end function HexImage; |
---|
| 311 | -- |
---|
| 312 | --function HexImage(L: signed) return String is |
---|
| 313 | --begin |
---|
| 314 | --return(HexImage(imge(L))); |
---|
| 315 | --end function HexImage; |
---|
| 316 | -- |
---|
| 317 | --function HexImage(L: unsigned) return String is |
---|
| 318 | --begin |
---|
| 319 | --return(HexImage(image(L))); |
---|
| 320 | --end function HexImage; |
---|
| 321 | -- End of heximage functions |
---|
| 322 | -- Start of an example image function |
---|
| 323 | function Hex_to_Ascii(l : std_logic_vector(3 downto 0)) return std_logic_vector is |
---|
| 324 | variable he:std_logic_vector(7 downto 0); |
---|
| 325 | variable val : unsigned(7 downto 0); |
---|
| 326 | begin |
---|
| 327 | val:= unsigned(X"0" & unsigned(l)); |
---|
| 328 | |
---|
| 329 | if val<10 then |
---|
| 330 | he:=std_logic_vector(val+48); |
---|
| 331 | else |
---|
| 332 | he:=std_logic_vector(val+55); |
---|
| 333 | end if; |
---|
| 334 | return he; |
---|
| 335 | end function; |
---|
| 336 | function image(L: bit) return String is |
---|
| 337 | variable bit_image: String(1 to 1) := bit'image(L); |
---|
| 338 | begin |
---|
| 339 | return(bit_image(1 to 1)); |
---|
| 340 | end function image; |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | function image(L: std_logic) return String is |
---|
| 344 | variable bit_image: String(1 to 3) := std_logic'image(L); |
---|
| 345 | begin |
---|
| 346 | return(bit_image(1 to 1)); |
---|
| 347 | end function image; |
---|
| 348 | |
---|
| 349 | function image(L: bit_vector) return String is |
---|
| 350 | variable Lx: bit_vector(1 to L'length); |
---|
| 351 | variable RetVal: String(1 to L'length); |
---|
| 352 | begin |
---|
| 353 | Lx := L; |
---|
| 354 | for i in Lx'range loop |
---|
| 355 | RetVal(i to i) := image(Lx(i)); |
---|
| 356 | end loop; |
---|
| 357 | return(RetVal); |
---|
| 358 | end function image; |
---|
| 359 | |
---|
| 360 | |
---|
| 361 | function image(L: std_logic_vector) return String is |
---|
| 362 | variable Lx: std_logic_vector(1 to L'length); |
---|
| 363 | variable RetVal: String(1 to L'length); |
---|
| 364 | begin |
---|
| 365 | Lx := L; |
---|
| 366 | for i in Lx'range loop |
---|
| 367 | RetVal(i to i) := image(Lx(i)); |
---|
| 368 | end loop; |
---|
| 369 | return(RetVal); |
---|
| 370 | end function image; |
---|
| 371 | --*************************************************** |
---|
| 372 | --functions d'initialisation |
---|
| 373 | function init_memory(size : natural;val :std_logic_vector(Word-1 downto 0):=(others=>'0')) return memory is |
---|
| 374 | variable dt: memory(0 to size-1); |
---|
| 375 | begin |
---|
| 376 | for i in 0 to size-1 loop |
---|
| 377 | dt(i):=val; |
---|
| 378 | end loop; |
---|
| 379 | return dt; |
---|
| 380 | end function; |
---|
| 381 | function init_DpRam return typ_dpram is |
---|
| 382 | variable sram : typ_dpRam; |
---|
| 383 | |
---|
| 384 | begin |
---|
| 385 | sram.I.data_out :=(others=>'0'); |
---|
| 386 | sram.o.clk_wr :='0'; |
---|
| 387 | sram.o.clk_rd :='0'; |
---|
| 388 | sram.o.we :='0'; |
---|
| 389 | sram.o.ena :='0'; |
---|
| 390 | sram.o.enb :='0'; |
---|
| 391 | sram.o.addr_wr:=(others=>'0'); |
---|
| 392 | sram.o.addr_rd:=(others=>'0'); |
---|
| 393 | sram.o.data_in:=(others=>'0'); |
---|
| 394 | |
---|
| 395 | return sram; |
---|
| 396 | end function; |
---|
| 397 | |
---|
| 398 | function init_core_i return Core_i is |
---|
| 399 | variable coreI : Core_i; |
---|
| 400 | begin |
---|
| 401 | |
---|
| 402 | corei.Instr_ack :='0'; -- signal la prise en compte de l'instruction |
---|
| 403 | corei.Ready :='0';-- indique que la dernière fonction est terminée |
---|
| 404 | corei.InitOk :='0'; -- l'initialisation est terminée |
---|
| 405 | corei.Hold_Req :='0';--Demande DMA |
---|
| 406 | corei.RamSel :='0';-- indique le statut de la RAM (0 ->dispo 1->occupé par Core_MPI) |
---|
| 407 | corei.IsMain :='0'; -- indique si la librairie est principal |
---|
| 408 | corei.Rank :=0; --donne le rang du processus courant |
---|
| 409 | corei.Spawned:='0'; --indique que ce module a été activé par la bibliothèque |
---|
| 410 | return (corei); |
---|
| 411 | end function; |
---|
| 412 | function init_core_o return Core_o is |
---|
| 413 | variable coreO : Core_o; |
---|
| 414 | begin |
---|
| 415 | coreo.Instr_en :='0'; -- active une instruction MPI |
---|
| 416 | coreo.Hold_Ack :='0';-- Autorisation DMA |
---|
| 417 | coreo.MemBusy :='0';-- active le refus de DMA (1 -> ignoré la requête DMA de MPI HCL) |
---|
| 418 | coreo.Instruction :=(others=>'0'); -- fonction Mpi à exécuter |
---|
| 419 | return coreo; |
---|
| 420 | end function; |
---|
| 421 | function init_core_s return Core_s is |
---|
| 422 | |
---|
| 423 | variable coreS : Core_s; |
---|
| 424 | begin |
---|
| 425 | cores.Rank :=0; --donne le rang du processus courant |
---|
| 426 | cores.IntState1 :=0; --permet de stocker l'état des MAE interne dans les procédures |
---|
| 427 | cores.IntState2 :=0; |
---|
| 428 | cores.WinId :=0; --stocke le dernier Id utilisé par WinCreate |
---|
| 429 | cores.GPost :=(others=>'0'); --etat de la fenêtre active |
---|
| 430 | cores.GStart :=(others=>'0'); |
---|
| 431 | cores.tmem :=init_memory(4); --petite mémoire tampon pour stocker les variables statiques des MVPs |
---|
| 432 | return Cores ; |
---|
| 433 | end function; |
---|
| 434 | function init_core_io return Core_io is |
---|
| 435 | variable coreIO : Core_io; |
---|
| 436 | begin |
---|
| 437 | CoreIO.O:=init_core_o; |
---|
| 438 | CoreIO.I:=Init_Core_I; |
---|
| 439 | CoreIO.S:=Init_Core_S; |
---|
| 440 | return CoreIO; |
---|
| 441 | end function; |
---|
| 442 | |
---|
| 443 | end CoreTypes; |
---|