コード例 #1
0
ファイル: dimensions.c プロジェクト: jsbali/iitd_thermal
CellIndex_t get_cell_offset_in_stack
(
    Dimensions_t *dimensions,
    CellIndex_t   layer_index,
    CellIndex_t   row_index,
    CellIndex_t   column_index
)
{
    return layer_index * get_layer_area (dimensions)
           + get_cell_offset_in_layer (dimensions, row_index, column_index) ;
}
コード例 #2
0
ファイル: floorplan_matrix.c プロジェクト: ICCAD/network
void floorplan_matrix_fill
(
    FloorplanMatrix_t      *flpmatrix,
    FloorplanElementList_t *list,
    Dimensions_t           *dimensions
)
{
    CellIndex_t *c_pointers = flpmatrix->ColumnPointers ;
    CellIndex_t *r_indices  = flpmatrix->RowIndices ;
    Source_t    *values     = flpmatrix->Values ;

    *c_pointers++ = 0u ;

    FloorplanElementListNode_t *flpeln ;

    for (flpeln  = floorplan_element_list_begin (list) ;
         flpeln != NULL ;
         flpeln  = floorplan_element_list_next (flpeln))
    {
        FloorplanElement_t *flpel = floorplan_element_list_data (flpeln) ;

        *c_pointers = *(c_pointers - 1) ;

        ICElementListNode_t *iceln ;

        for (iceln  = ic_element_list_begin (&flpel->ICElements) ;
             iceln != NULL ;
             iceln  = ic_element_list_next (iceln))
        {
            ICElement_t *icel = ic_element_list_data (iceln) ;

            CellDimension_t width = 0u ;
            CellDimension_t y     = icel->SW_Y ;

            FOR_EVERY_IC_ELEMENT_ROW (row_index, icel)
            {
                if (row_index < icel->NE_Row)

                    width = get_cell_location_y (dimensions, row_index + 1) - y ;

                else

                    width = (icel->SW_Y + icel->Width) - y ;


                CellDimension_t length = 0u ;
                CellDimension_t x      = icel->SW_X ;

                FOR_EVERY_IC_ELEMENT_COLUMN (column_index, icel)
                {
                    *r_indices++ = get_cell_offset_in_layer

                                   (dimensions, row_index, column_index) ;

                    if (column_index < icel->NE_Column)

                        length = get_cell_location_x (dimensions, column_index + 1) - x ;

                    else

                        length = (icel->SW_X + icel->Length) - x ;

                    *values++ = (length * width) /  flpel->Area ;

                    (*c_pointers)++ ;

                    x += length ;
                }

                y += width ;
            }
        }

        c_pointers++ ;
    }