From d4b5171fa21e2f8f05784d29b3f3a05683d736ff Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 17 Jan 2020 15:31:44 -0700 Subject: [PATCH] add comments to technology library --- .../libarchopenfpga/src/circuit_library.h | 4 +- .../libarchopenfpga/src/technology_library.h | 90 ++++++++++++++++++- 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/libopenfpga/libarchopenfpga/src/circuit_library.h b/libopenfpga/libarchopenfpga/src/circuit_library.h index 885867252..3b6e42e5c 100644 --- a/libopenfpga/libarchopenfpga/src/circuit_library.h +++ b/libopenfpga/libarchopenfpga/src/circuit_library.h @@ -28,6 +28,7 @@ * It stores all the circuit-level details from XML architecture file * * Typical usage: + * -------------- * // Create an empty circuit library * CircuitLibrary circuit_lib; * // call your builder for circuit library @@ -38,7 +39,8 @@ * * It includes the following data: * - * ------ Fundamental Information ----- + * Fundamental Information + * ----------------------- * 1. model_ids_ : unique identifier to find a circuit model * Use a strong id for search, to avoid illegal type casting * 2. model_types_: types of the circuit model, see details in the definition of enum e_circuit_model_type diff --git a/libopenfpga/libarchopenfpga/src/technology_library.h b/libopenfpga/libarchopenfpga/src/technology_library.h index bd0b40607..cc1030198 100644 --- a/libopenfpga/libarchopenfpga/src/technology_library.h +++ b/libopenfpga/libarchopenfpga/src/technology_library.h @@ -73,6 +73,15 @@ constexpr std::array TECH_LIB_CORNER_TYP /******************************************************************** * A data structure to describe technology library + * + * Typical usage: + * -------------- + * // Create an empty technology library + * TechnologyLibrary tech_lib; + * // call your builder for technology library + * // Build the internal links for the technology library + * tech_lib.link_device_to_variation(); + * *******************************************************************/ class TechnologyLibrary { public: /* Types */ @@ -162,31 +171,106 @@ class TechnologyLibrary { bool valid_variation_id(const TechnologyVariationId& variation_id) const; private: /* Internal data */ /* Transistor-related fundamental information */ + /* Unique identifier for each device + * A device could be either transistors (1 pair of PMOS and NMOS) or RRAMs + */ vtr::vector device_ids_; + + /* Unique name for each device. This is defined by XML file */ vtr::vector device_names_; + + /* Type of each device, either transistors or RRAMs */ vtr::vector device_types_; + + /* Type of models of each device, either industry or academia + * This will lead to different ways when include these models + * For industry models, we use .lib to include library + * For academia models, we use .include to include library + */ vtr::vector device_model_types_; + + /* Name of process corner to be used for each device + * Users can define any string for the process corner they are going to use + * But the corner name should be consistent with their library files + * When this is enabled, the corner name will be added when + * include the models + * For example, for a industry model, .lib + */ vtr::vector device_corners_; + + /* The string used to instanciate the device models + * This will really depend on the type of models + * For most industry models, we can use 'M' to instanciate a transisitor + * For some academia models, we have to use 'X' to do so + */ vtr::vector device_model_refs_; + + /* The path to the transistor models + * This is going to be the when include the library files + * See the example in the comments about process corner + */ vtr::vector device_lib_paths_; + + /* Operating voltage for the devices. Unit: [V] */ vtr::vector device_vdds_; + + /* The width ratio between PMOS and NMOS for a device group + * This really depend the transistor technology + * We recommend users to characterize driving strengths of + * PMOS and NMOS using SPICE simulators + */ vtr::vector device_pn_ratios_; - /* Transistor models stored in vtr::Point data structure */ + /* The model name is the name that is defined in your library file. + * For example, your NMOS transistor may be defined as + * .model nch + * in some BSIM models. In this case, nch will be the model name + * + * In the rest of these transistor-level parameters, we follow the same organization: + * PMOS data will be stored in the first element of the array + * NMOS data will be stored in the second element of the array + */ vtr::vector> transistor_model_names_; + + /* The channel length of a transistor. + * This should be defined by your technology vendor + * For example, a 22nm technology, the channel length is around 22nm + */ vtr::vector> transistor_model_chan_lengths_; + + /* The minimum width of a transistor. + * This should be defined by your technology vendor + */ vtr::vector> transistor_model_min_widths_; + + /* The variation name and id binded to PMOS and NMOS transistor + * We expect users to provide the exact name of variation defined in this technology library + * the name and id will be automatically matched by using function link_device_to_variation() + */ vtr::vector> transistor_model_variation_names_; vtr::vector> transistor_model_variation_ids_; - /* ReRAM-related fundamental information: LRS -> x(); HRS -> y() */ + /* ReRAM-related fundamental information: + * Low Resistance State (LRS) resistance will be stored in the x() part of vtr::Point + * High Resistance State (HRS) resistance will be stored in the y() part of vtr::Point + */ vtr::vector> rram_resistances_; + + /* The variation name and id binded to this RRAM + * We expect users to provide the exact name of variation defined in this technology library + * the name and id will be automatically matched by using function link_device_to_variation() + */ vtr::vector rram_variation_names_; vtr::vector rram_variation_ids_; - /* Variation-related fundamental information */ + /* Unique identifier for each process variation */ vtr::vector variation_ids_; vtr::vector variation_names_; + + /* Absoluate and standard deviation of a process variation + * These are used to apply manual process variations + * in case your technology vender does not provide any + */ vtr::vector variation_abs_values_; vtr::vector variation_num_sigmas_;