48 unsigned int LUT_sizes[3] = { 6 };
58 char * SRAM_bits = NULL;
147 for (i = 0; i < (
sizeof(LUT_sizes) /
sizeof(
int)); i++) {
148 for (j = 1; j <= LUT_sizes[i]; j++) {
150 ((1 << j) + 1) *
sizeof(
char));
155 for (sram_idx = 0; sram_idx < (1 << (j - 1)); sram_idx++) {
156 SRAM_bits[sram_idx + (1 << (j - 1))] =
binary_not(
157 SRAM_bits[sram_idx]);
160 SRAM_bits[1 << j] =
'\0';
163 dens = (
float*)
my_realloc(dens, LUT_sizes[i] *
sizeof(
float));
164 prob = (
float*)
my_realloc(prob, LUT_sizes[i] *
sizeof(
float));
165 for (j = 0; j < LUT_sizes[i]; j++) {
166 dens[j] = 1.0 / (float) LUT_sizes[i];
174 float p[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 };
175 float d[6] = { 1, 1, 1, 1, 1, 1 };
void power_usage_mux_multilevel(t_power_usage *power_usage, t_mux_arch *mux_arch, float *in_prob, float *in_dens, int selected_input, boolean output_level_restored, float period)
void power_usage_ff(t_power_usage *power_usage, float size, float D_prob, float D_dens, float Q_prob, float Q_dens, float clk_prob, float clk_dens, float period)
t_power_output * g_power_output
t_solution_inf g_solution_inf
t_mux_arch * power_get_mux_arch(int num_mux_inputs, float transistor_size)
void power_add_usage(t_power_usage *dest, const t_power_usage *src)
static char binary_not(char c)
const float power_callib_period
void power_usage_lut(t_power_usage *power_usage, int lut_size, float transistor_size, char *SRAM_values, float *input_prob, float *input_dens, float period)
float power_sum_usage(t_power_usage *power_usage)
static void * my_realloc(void *memblk, int ibytes)