110152Satgutier@umich.edu/*****************************************************************************
210152Satgutier@umich.edu *                                McPAT/CACTI
310152Satgutier@umich.edu *                      SOFTWARE LICENSE AGREEMENT
410152Satgutier@umich.edu *            Copyright 2012 Hewlett-Packard Development Company, L.P.
510234Syasuko.eckert@amd.com *            Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
610152Satgutier@umich.edu *                          All Rights Reserved
710152Satgutier@umich.edu *
810152Satgutier@umich.edu * Redistribution and use in source and binary forms, with or without
910152Satgutier@umich.edu * modification, are permitted provided that the following conditions are
1010152Satgutier@umich.edu * met: redistributions of source code must retain the above copyright
1110152Satgutier@umich.edu * notice, this list of conditions and the following disclaimer;
1210152Satgutier@umich.edu * redistributions in binary form must reproduce the above copyright
1310152Satgutier@umich.edu * notice, this list of conditions and the following disclaimer in the
1410152Satgutier@umich.edu * documentation and/or other materials provided with the distribution;
1510152Satgutier@umich.edu * neither the name of the copyright holders nor the names of its
1610152Satgutier@umich.edu * contributors may be used to endorse or promote products derived from
1710152Satgutier@umich.edu * this software without specific prior written permission.
1810152Satgutier@umich.edu
1910152Satgutier@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2010152Satgutier@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2110152Satgutier@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2210152Satgutier@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2310152Satgutier@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2410152Satgutier@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2510152Satgutier@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2610152Satgutier@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2710152Satgutier@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2810152Satgutier@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2910234Syasuko.eckert@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3010152Satgutier@umich.edu *
3110152Satgutier@umich.edu ***************************************************************************/
3210152Satgutier@umich.edu
3310152Satgutier@umich.edu
3410152Satgutier@umich.edu
3510152Satgutier@umich.edu#ifndef __MAT_H__
3610152Satgutier@umich.edu#define __MAT_H__
3710152Satgutier@umich.edu
3810152Satgutier@umich.edu#include "component.h"
3910152Satgutier@umich.edu#include "decoder.h"
4010152Satgutier@umich.edu#include "subarray.h"
4110152Satgutier@umich.edu#include "wire.h"
4210152Satgutier@umich.edu
4310234Syasuko.eckert@amd.comclass Mat : public Component {
4410234Syasuko.eckert@amd.compublic:
4510152Satgutier@umich.edu    Mat(const DynamicParameter & dyn_p);
4610152Satgutier@umich.edu    ~Mat();
4710152Satgutier@umich.edu    double compute_delays(double inrisetime);  // return outrisetime
4810152Satgutier@umich.edu    void compute_power_energy();
4910152Satgutier@umich.edu
5010152Satgutier@umich.edu    const DynamicParameter & dp;
5110152Satgutier@umich.edu
5210152Satgutier@umich.edu    // TODO: clean up pointers and powerDefs below
5310152Satgutier@umich.edu    Decoder * row_dec;
5410152Satgutier@umich.edu    Decoder * bit_mux_dec;
5510152Satgutier@umich.edu    Decoder * sa_mux_lev_1_dec;
5610152Satgutier@umich.edu    Decoder * sa_mux_lev_2_dec;
5710152Satgutier@umich.edu    PredecBlk * dummy_way_sel_predec_blk1;
5810152Satgutier@umich.edu    PredecBlk * dummy_way_sel_predec_blk2;
5910152Satgutier@umich.edu    PredecBlkDrv * way_sel_drv1;
6010152Satgutier@umich.edu    PredecBlkDrv * dummy_way_sel_predec_blk_drv2;
6110152Satgutier@umich.edu
6210152Satgutier@umich.edu    Predec * r_predec;
6310152Satgutier@umich.edu    Predec * b_mux_predec;
6410152Satgutier@umich.edu    Predec * sa_mux_lev_1_predec;
6510152Satgutier@umich.edu    Predec * sa_mux_lev_2_predec;
6610152Satgutier@umich.edu
6710152Satgutier@umich.edu    Wire   * subarray_out_wire;
6810152Satgutier@umich.edu    Driver * bl_precharge_eq_drv;
6910152Satgutier@umich.edu    Driver * cam_bl_precharge_eq_drv;//bitline pre-charge circuit is separated for CAM and RAM arrays.
7010152Satgutier@umich.edu    Driver * ml_precharge_drv;//matchline prechange driver
7110152Satgutier@umich.edu    Driver * sl_precharge_eq_drv;//searchline prechage driver
7210152Satgutier@umich.edu    Driver * sl_data_drv;//search line data driver
7310152Satgutier@umich.edu    Driver * ml_to_ram_wl_drv;//search line data driver
7410152Satgutier@umich.edu
7510152Satgutier@umich.edu
7610152Satgutier@umich.edu    powerDef power_row_decoders;
7710152Satgutier@umich.edu    powerDef power_bit_mux_decoders;
7810152Satgutier@umich.edu    powerDef power_sa_mux_lev_1_decoders;
7910152Satgutier@umich.edu    powerDef power_sa_mux_lev_2_decoders;
8010152Satgutier@umich.edu    powerDef power_fa_cam;  // TODO: leakage power is not computed yet
8110152Satgutier@umich.edu    powerDef power_bl_precharge_eq_drv;
8210152Satgutier@umich.edu    powerDef power_subarray_out_drv;
8310152Satgutier@umich.edu    powerDef power_cam_all_active;
8410152Satgutier@umich.edu    powerDef power_searchline_precharge;
8510152Satgutier@umich.edu    powerDef power_matchline_precharge;
8610152Satgutier@umich.edu    powerDef power_ml_to_ram_wl_drv;
8710152Satgutier@umich.edu
8810152Satgutier@umich.edu    double   delay_fa_tag, delay_cam;
8910152Satgutier@umich.edu    double   delay_before_decoder;
9010152Satgutier@umich.edu    double   delay_bitline;
9110152Satgutier@umich.edu    double   delay_wl_reset;
9210152Satgutier@umich.edu    double   delay_bl_restore;
9310152Satgutier@umich.edu
9410152Satgutier@umich.edu    double   delay_searchline;
9510152Satgutier@umich.edu    double   delay_matchchline;
9610152Satgutier@umich.edu    double   delay_cam_sl_restore;
9710152Satgutier@umich.edu    double   delay_cam_ml_reset;
9810152Satgutier@umich.edu    double   delay_fa_ram_wl;
9910152Satgutier@umich.edu
10010152Satgutier@umich.edu    double   delay_hit_miss_reset;
10110152Satgutier@umich.edu    double   delay_hit_miss;
10210152Satgutier@umich.edu
10310152Satgutier@umich.edu    Subarray subarray;
10410152Satgutier@umich.edu    powerDef power_bitline, power_searchline, power_matchline;
10510152Satgutier@umich.edu    double   per_bitline_read_energy;
10610152Satgutier@umich.edu    int      deg_bl_muxing;
10710152Satgutier@umich.edu    int      num_act_mats_hor_dir;
10810152Satgutier@umich.edu    double   delay_writeback;
10910234Syasuko.eckert@amd.com    Area     cell, cam_cell;
11010234Syasuko.eckert@amd.com    bool     is_dram, is_fa, pure_cam, camFlag;
11110152Satgutier@umich.edu    int      num_mats;
11210152Satgutier@umich.edu    powerDef power_sa;
11310152Satgutier@umich.edu    double   delay_sa;
11410152Satgutier@umich.edu    double   leak_power_sense_amps_closed_page_state;
11510152Satgutier@umich.edu    double   leak_power_sense_amps_open_page_state;
11610152Satgutier@umich.edu    double   delay_subarray_out_drv;
11710152Satgutier@umich.edu    double   delay_subarray_out_drv_htree;
11810152Satgutier@umich.edu    double   delay_comparator;
11910152Satgutier@umich.edu    powerDef power_comparator;
12010152Satgutier@umich.edu    int      num_do_b_mat;
12110152Satgutier@umich.edu    int      num_so_b_mat;
12210152Satgutier@umich.edu    int      num_sa_subarray;
12310152Satgutier@umich.edu    int      num_sa_subarray_search;
12410152Satgutier@umich.edu    double   C_bl;
12510152Satgutier@umich.edu
12610152Satgutier@umich.edu    uint32_t num_subarrays_per_mat;  // the number of subarrays in a mat
12710152Satgutier@umich.edu    uint32_t num_subarrays_per_row;  // the number of subarrays in a row of a mat
12810152Satgutier@umich.edu
12910152Satgutier@umich.edu
13010234Syasuko.eckert@amd.comprivate:
13110152Satgutier@umich.edu    double compute_bit_mux_sa_precharge_sa_mux_wr_drv_wr_mux_h();
13210152Satgutier@umich.edu    double width_write_driver_or_write_mux();
13310152Satgutier@umich.edu    double compute_comparators_height(int tagbits, int number_ways_in_mat, double subarray_mem_cell_area_w);
13410152Satgutier@umich.edu    double compute_cam_delay(double inrisetime);
13510152Satgutier@umich.edu    double compute_bitline_delay(double inrisetime);
13610152Satgutier@umich.edu    double compute_sa_delay(double inrisetime);
13710152Satgutier@umich.edu    double compute_subarray_out_drv(double inrisetime);
13810152Satgutier@umich.edu    double compute_comparator_delay(double inrisetime);
13910152Satgutier@umich.edu
14010152Satgutier@umich.edu    int RWP;
14110152Satgutier@umich.edu    int ERP;
14210152Satgutier@umich.edu    int EWP;
14310152Satgutier@umich.edu    int SCHP;
14410152Satgutier@umich.edu};
14510152Satgutier@umich.edu
14610152Satgutier@umich.edu
14710152Satgutier@umich.edu
14810152Satgutier@umich.edu#endif
149