62 if (src->NRows == 0u || src->NColumns == 0u || src->NNz == 0u)
68 if (src->ColumnPointers != NULL)
70 memcpy (dst->ColumnPointers, src->ColumnPointers,
73 if (src->RowIndices != NULL)
75 memcpy (dst->RowIndices, src->RowIndices,
78 if (src->Values != NULL)
80 memcpy (dst->Values, src->Values,
94 flpmatrix->
NRows = nrows ;
96 flpmatrix->
NNz = nnz ;
114 if (flpmatrix->
Values == NULL)
136 if (flpmatrix->
Values != NULL)
138 free (flpmatrix->
Values) ;
148 FloorplanElementList_t *list,
158 FloorplanElementListNode_t *flpeln ;
160 for (flpeln = floorplan_element_list_begin (list) ;
162 flpeln = floorplan_element_list_next (flpeln))
166 *c_pointers = *(c_pointers - 1) ;
168 ICElementListNode_t *iceln ;
170 for (iceln = ic_element_list_begin (&flpel->
ICElements) ;
172 iceln = ic_element_list_next (iceln))
182 for (row = icel->
SW_Row ; row <= icel->NE_Row ; row++)
184 if (row < icel->NE_Row)
196 for (column = icel->
SW_Column ; column <= icel->NE_Column ; column++)
200 (dimensions, row, column) ;
202 if (column < icel->NE_Column)
210 *values++ = (length * width) / flpel->
Area ;
238 || flpmatrix->
NNz == 0 || flpmatrix->
Values == NULL)
240 fprintf (stderr,
"matrix multiply error: matrix unset\n") ;
245 for (j = 0; j < flpmatrix->
NColumns; ++j)
250 i < flpmatrix->ColumnPointers[j+1] ; ++i)
252 x [ flpmatrix->
RowIndices [i] ] += b[j] * flpmatrix -> Values [i] ;
261 FILE* file = fopen (file_name,
"w") ;
265 fprintf(stderr,
"Cannot open file %s\n", file_name) ;
271 for (column = 0 ; column < flpmatrix.
NColumns ; column++)
277 fprintf (file,
"%9d\t%9d\t%32.24f\n",
ChipDimension_t get_cell_location_y(Dimensions_t *dimensions, CellIndex_t row_index)
ChipDimension_t get_cell_location_x(Dimensions_t *dimensions, CellIndex_t column_index)
CellIndex_t get_cell_offset_in_layer(Dimensions_t *dimensions, CellIndex_t row_index, CellIndex_t column_index)
void floorplan_matrix_copy(FloorplanMatrix_t *dst, FloorplanMatrix_t *src)
void floorplan_matrix_init(FloorplanMatrix_t *flpmatrix)
Error_t floorplan_matrix_build(FloorplanMatrix_t *flpmatrix, CellIndex_t nrows, CellIndex_t ncolumns, CellIndex_t nnz)
void floorplan_matrix_fill(FloorplanMatrix_t *flpmatrix, FloorplanElementList_t *list, Dimensions_t *dimensions)
void floorplan_matrix_print(FloorplanMatrix_t flpmatrix, String_t file_name)
void floorplan_matrix_multiply(FloorplanMatrix_t *flpmatrix, Source_t *x, Source_t *b)
void floorplan_matrix_destroy(FloorplanMatrix_t *flpmatrix)
Collections of all the structures that are needed for the thermal simulation.
Structure containing information about a floorplan element.
ICElementList_t ICElements
Structure representing the matrix storing the coefficients of the floorplans tha scales power values ...
CellIndex_t * ColumnPointers
@ TDICE_SUCCESS
The function returns with success.
@ TDICE_FAILURE
The function retuerns with a generic error.