PIPS
|
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "misc.h"
#include "matrice.h"
#include "tiling.h"
#include "movements.h"
Go to the source code of this file.
Functions | |
Psysteme | build_sc_machine (int pn, int bn, int ls, Psysteme sc_array_function, entity proc_id, Pbase bank_indices, entity entity_var) |
PACKAGE MOVEMENTS. More... | |
Psysteme build_sc_machine | ( | int | pn, |
int | bn, | ||
int | ls, | ||
Psysteme | sc_array_function, | ||
entity | proc_id, | ||
Pbase | bank_indices, | ||
entity | entity_var | ||
) |
PACKAGE MOVEMENTS.
Corinne Ancourt - septembre 1991 this function builds the following system of constraints depending on the machine. It describes the implementation of array elements in the memory in function of bank, ligne size, ligne bank,...
bn is the number of banks, ls the ligne size, ms the first array dimension bank is a variable giving the bank id., ligne a variable corresponding to a ligne in the bank, ofs a variable corresponding to an offset in a ligne of the bank.
if COLUMN_MAJOR is true the system is the following one
(VAR1-1) + (VAR2-1) *ms == bn*ls* ligne +ls*bank+ofs, 1 <= bank <= bn , 1 <= proc <= pn , 0 <= ofs <= ls-1
else it is
(VAR1-1) * ms + (VAR2-1) == bn*ls*ligne +ls*bank+ofs, 1 <= bank <= bn , 1 <= proc <= pn , 0 <= ofs <= ls-1
Si l'on veut utiliser le nombre d'octets il faut remplacer l'equation par deux inequations du type
if COLUMN_MAJOR is true the system is the following one
(VAR1-1) + (VAR2-1) ms <= bn*ls (ligne-1) +ls*(bank-1)+ofs, bn*ls* (ligne-1) +ls*(bank-1)+ofs <= (VAR1) + (VAR2-1) *ms
else it is
(VAR1-1) * ms + (VAR2-1) <= bn*ls*(ligne-1) +ls*(bank-1)+ofs, bn*ls*(ligne-1) +ls*(bank-1)+ofs <= (VAR1-1) * ms + (VAR2)
nb_bytes = SizeOfElements(bas);
bank_indices is assumed to belong the three variables bank_id, L and O (see documentation for more details)
if COLUMN_MAJOR is true then build the constraint
(VAR1-1) + (VAR2-1) *ms == bn*ls*L +ls*bank_id+O, else build the constraint (VAR1-1) * ms + (VAR2-1) == bn*ls*L +ls*bank_id+O, VAR1 and VAR2 correspond to the image array function indices
to deal with MONO dimensional array
to deal with MONO dimensional array
build the constraints 0 <= bank_id <= bn-1
build the constraints 0 <= proc_id <= pn-1
build the constraints 0 <= O <= ls -1
build the constraints 0 <= L
pn | n |
bn | n |
ls | s |
sc_array_function | c_array_function |
proc_id | roc_id |
bank_indices | ank_indices |
entity_var | ntity_var |
Definition at line 70 of file build_sc_machine.c.
References Ssysteme::base, CAR, COLUMN_MAJOR, contrainte_make(), debug(), Ssysteme::dimension, DIMENSION, dimension_lower, dimension_upper, entity_local_name(), entity_type, fprint_string_Value(), fprintf(), ifdebug, Ssysteme::inegalites, int_to_value, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, sc_fprint(), sc_init_with_sc(), Scontrainte::succ, Svecteur::succ, TCST, type_variable, type_variable_p, value_minus, VALUE_MONE, value_mult, VALUE_ONE, value_plus, VALUE_ZERO, variable_dimensions, vect_add(), vect_add_elem(), vect_add_variable(), vect_coeff(), vect_dup(), vect_multiply(), vect_new(), Scontrainte::vecteur, and vecteur_var.
Referenced by sc_image_computation().