3D-ICE 3.0.0
non_uniform_cell.c
1/******************************************************************************
2 * This file is part of 3D-ICE, version 3.1.0 . *
3 * *
4 * 3D-ICE is free software: you can redistribute it and/or modify it under *
5 * the terms of the GNU General Public License as published by the Free *
6 * Software Foundation, either version 3 of the License, or any later *
7 * version. *
8 * *
9 * 3D-ICE is distributed in the hope that it will be useful, but WITHOUT *
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
12 * more details. *
13 * *
14 * You should have received a copy of the GNU General Public License along *
15 * with 3D-ICE. If not, see <http://www.gnu.org/licenses/>. *
16 * *
17 * Copyright (C) 2021 *
18 * Embedded Systems Laboratory - Ecole Polytechnique Federale de Lausanne *
19 * All Rights Reserved. *
20 * *
21 * Authors: Arvind Sridhar Alessandro Vincenzi *
22 * Giseong Bak Martino Ruggiero *
23 * Thomas Brunschwiler Eder Zulian *
24 * Federico Terraneo Darong Huang *
25 * Luis Costero Marina Zapater *
26 * David Atienza *
27 * *
28 * For any comment, suggestion or request about 3D-ICE, please register and *
29 * write to the mailing list (see http://listes.epfl.ch/doc.cgi?liste=3d-ice) *
30 * Any usage of 3D-ICE for research, commercial or other purposes must be *
31 * properly acknowledged in the resulting products or publications. *
32 * *
33 * EPFL-STI-IEL-ESL Mail : 3d-ice@listes.epfl.ch *
34 * Batiment ELG, ELG 130 (SUBSCRIPTION IS NECESSARY) *
35 * Station 11 *
36 * 1015 Lausanne, Switzerland Url : http://esl.epfl.ch/3d-ice *
37 ******************************************************************************/
38#include <stdlib.h> // For the memory functions malloc/free
39
40#include "non_uniform_cell.h"
41#include "macros.h"
42
44{
45 non_uniform_cell->layer_info=0;
46 non_uniform_cell->left_x=0;
47 non_uniform_cell->left_y=0;
48 non_uniform_cell->length=0;
49 non_uniform_cell->width=0;
50 non_uniform_cell->isChannel=0;
51}
52
53void non_uniform_cell_destroy (Non_uniform_cell_t *non_uniform_cell)
54{
55 non_uniform_cell_init (non_uniform_cell) ;
56}
57
58void non_uniform_cell_free (Non_uniform_cell_t *non_uniform_cell)
59{
60 if (non_uniform_cell == NULL)
61
62 return ;
63
64 non_uniform_cell_destroy (non_uniform_cell) ;
65
66 free (non_uniform_cell) ;
67}
68
69void non_uniform_cell_copy (Non_uniform_cell_t *dst, Non_uniform_cell_t *src)
70{
72
73 dst->layer_info = src->layer_info;
74 dst->left_x = src->left_x;
75 dst->left_y = src->left_y;
76 dst->length = src->length;
77 dst->width = src->width;
78 dst->isChannel = src->isChannel;
79
80}
81
82bool non_uniform_cell_equal (Non_uniform_cell_t *non_uniform_cell, Non_uniform_cell_t *other)
83{
84 return non_uniform_cell->layer_info == other->layer_info &&
85 non_uniform_cell->left_x == other->left_x &&
86 non_uniform_cell->left_y == other->left_y &&
87 non_uniform_cell->length == other->length &&
88 non_uniform_cell->width == other->width &&
89 non_uniform_cell->isChannel == other->isChannel;
90}
91
92void non_uniform_cell_print (Non_uniform_cell_t *non_uniform_cell, FILE *stream, String_t prefix)
93{
94 fprintf(stream, "%sLayer info: %d\n", prefix, non_uniform_cell->layer_info) ;
95}
void non_uniform_cell_init(Non_uniform_cell_t *non_uniform_cell)
char * String_t
Definition: string_t.h:55