diff --git a/libopenfpga/libarchopenfpga/arch/sample_arch.xml b/libopenfpga/libarchopenfpga/arch/sample_arch.xml index 8338108fe..09a4833d2 100644 --- a/libopenfpga/libarchopenfpga/arch/sample_arch.xml +++ b/libopenfpga/libarchopenfpga/arch/sample_arch.xml @@ -9,26 +9,26 @@ --> - + - - + + - - + + - - - + + + - - + + diff --git a/libopenfpga/libarchopenfpga/src/technology_library.h b/libopenfpga/libarchopenfpga/src/technology_library.h index 4f9600cbe..c062c7ec3 100644 --- a/libopenfpga/libarchopenfpga/src/technology_library.h +++ b/libopenfpga/libarchopenfpga/src/technology_library.h @@ -4,6 +4,8 @@ /******************************************************************** * This file include the declaration of technology library *******************************************************************/ +#include +#include "technology_library_fwd.h" /******************************************************************** * Types for technology library attributes @@ -16,26 +18,26 @@ * PTM is the Predictive Technology Model provided by the Arizona * State University (ASU). Available at ptm.asu.edu *******************************************************************/ -enum e_tech_lib_type { - TECH_LIB_INDUSTRY, - TECH_LIB_ACADEMIA, - NUM_TECH_LIB_TYPES +enum e_tech_lib_model_type { + TECH_LIB_MODEL_INDUSTRY, + TECH_LIB_MODEL_ACADEMIA, + NUM_TECH_LIB_MODEL_TYPES }; /* Strings correspond to each technology library type */ -constexpr std::array TECH_LIB_TYPE_STRING = {{"industry", "academia"}}; +constexpr std::array TECH_LIB_MODEL_TYPE_STRING = {{"industry", "academia"}}; /******************************************************************** - * Types of transistor groups which may be defined in a technology library - * We categorize the transistors in terms of their usage in FPGA architecture - * 1. NMOS transistor - * 2. PMOS transistor + * Types of device which may be defined in a technology library + * 1. transistor + * 2. RRAM *******************************************************************/ -enum e_tech_lib_trans_type { - TECH_LIB_TRANS_NMOS, - TECH_LIB_TRANS_PMOS, +enum e_tech_lib_device_type { + TECH_LIB_DEVICE_TRANSISTOR, + TECH_LIB_DEVICE_RRAM, + NUM_TECH_LIB_DEVICE_TYPES }; -/* Strings correspond to transistor type type */ -constexpr std::array TECH_LIB_TRANS_TYPE_STRING = {{"industry", "academia"}}; +/* Strings correspond to transistor type */ +constexpr std::array TECH_LIB_DEVICE_TYPE_STRING = {{"transistor", "rram"}}; /******************************************************************** * Types of transistors which may be defined in a technology library @@ -43,19 +45,58 @@ constexpr std::array TECH_LIB_TRANS_TYPE_STRING * 2. PMOS transistor *******************************************************************/ enum e_tech_lib_trans_type { - TECH_LIB_TRANS_NMOS, TECH_LIB_TRANS_PMOS, + TECH_LIB_TRANS_NMOS, + NUM_TECH_LIB_TRANS_TYPES }; -/* Strings correspond to transistor type type */ -constexpr std::array TECH_LIB_TRANS_TYPE_STRING = {{"industry", "academia"}}; +/* Strings correspond to transistor type */ +constexpr std::array TECH_LIB_TRANS_TYPE_STRING = {{"pmos", "nmos"}}; /******************************************************************** * Process corners supported *******************************************************************/ enum e_process_corner { - BEST_CORNER, - TYPICAL_CORNER, - WORST_CORNER + TECH_LIB_CORNER_FF, + TECH_LIB_CORNER_TT, + TECH_LIB_CORNER_SS, + NUM_TECH_LIB_CORNER_TYPES +}; +/* Strings correspond to process corner type */ +constexpr std::array TECH_LIB_CORNER_TYPE_STRING = {{"FF", "TT", "SS"}}; + +/******************************************************************** + * A data structure to describe technology library + *******************************************************************/ +class TechnologyLibrary { + private: /* Internal data */ + /* Transistor-related fundamental information */ + vtr::vector device_ids_; + vtr::vector device_names_; + vtr::vector device_types_; + vtr::vector device_model_types_; + vtr::vector device_corners_; + vtr::vector device_model_refs_; + vtr::vector device_lib_paths_; + vtr::vector device_vdds_; + vtr::vector device_pn_ratios_; + + /* Transistor models stored in vtr::Point data structure. pmos->x, nmos->y */ + vtr::vector> transistor_model_names_; + vtr::vector> transistor_model_chan_lengths_; + vtr::vector> transistor_model_min_widths_; + vtr::vector> transistor_model_variation_names_; + vtr::vector> transistor_model_variation_ids_; + + /* ReRAM-related fundamental information */ + vtr::vector> rram_resistances_; + vtr::vector rram_variation_names_; + vtr::vector rram_variation_ids_; + + /* Variation-related fundamental information */ + vtr::vector variation_ids_; + vtr::vector variation_names_; + vtr::vector variation_abs_values_; + vtr::vector variation_num_sigmas_; }; #endif diff --git a/libopenfpga/libarchopenfpga/src/technology_library_fwd.h b/libopenfpga/libarchopenfpga/src/technology_library_fwd.h new file mode 100644 index 000000000..4055ff4f2 --- /dev/null +++ b/libopenfpga/libarchopenfpga/src/technology_library_fwd.h @@ -0,0 +1,24 @@ +/************************************************************************ + * A header file for TechnologyLibrary class, including critical data declaration + * Please include this file only for using any TechnologyLibrary data structure + * Refer to circuit_library.h for more details + ***********************************************************************/ + +/************************************************************************ + * Create strong id for TechnologyDevice to avoid illegal type casting + ***********************************************************************/ +#ifndef TECHNOLOGY_LIBRARY_FWD_H +#define TECHNOLOGY_LIBRARY_FWD_H + +#include "vtr_strong_id.h" + +struct technology_device_id_tag; +struct technology_variation_id_tag; + +typedef vtr::StrongId TechnologyDeviceId; +typedef vtr::StrongId TechnologyVariationId; + +/* Short declaration of class */ +class TechnologyLibrary; + +#endif