diff --git a/docs/source/arch_lang/circuit_library.rst b/docs/source/arch_lang/circuit_library.rst index 04f0039b4..b28acafea 100644 --- a/docs/source/arch_lang/circuit_library.rst +++ b/docs/source/arch_lang/circuit_library.rst @@ -250,11 +250,11 @@ A circuit model may consist of a number of ports. The port list is mandatory in - ``type="input|output|sram|clock"`` Specify the type of the port, i.e., the directionality and usage. For programmable modules, such as multiplexers and LUTs, SRAM ports MUST be defined. For registers, such as FFs and memory banks, clock ports MUST be defined. - - ``prefix=`` the name of the port to appear in the autogenerated netlists. Each port will be shown as ``[i]`` in Verilog/SPICE netlists. + - ``prefix=""`` the name of the port to appear in the autogenerated netlists. Each port will be shown as ``[i]`` in Verilog/SPICE netlists. - - ``lib_name=`` the name of the port defined in standard cells or customized cells. If not specified, this attribute will be the same as ``prefix``. + - ``lib_name=""`` the name of the port defined in standard cells or customized cells. If not specified, this attribute will be the same as ``prefix``. - - ``size=`` bandwidth of the port. MUST be larger than zero. + - ``size=""`` bandwidth of the port. MUST be larger than zero. - ``default_val=""`` Specify default logic value for a port, which is used as the initial logic value of this port in testbench generation. Can be either 0 or 1. We assume each pin of this port has the same default value. diff --git a/docs/source/arch_lang/circuit_model_examples.rst b/docs/source/arch_lang/circuit_model_examples.rst index 7e6a50229..a4472c01d 100644 --- a/docs/source/arch_lang/circuit_model_examples.rst +++ b/docs/source/arch_lang/circuit_model_examples.rst @@ -2,34 +2,36 @@ Circuit model examples ---------------------- -The next subsections are dedicated to detailed examples of each circuit model type. Through these examples, we give a global overview of the different implementations which are available for the user. +As circuit model in different types have various special syntax. +Here, we will provide detailed examples on each type of ``circuit_model``. +These examples may be considered as template for users to craft their own ``circuit_model``. Inverters and Buffers ~~~~~~~~~~~~~~~~~~~~~ +Template +```````` + .. code-block:: xml - - - - + + + + -.. note:: customized Verilog/SPICE netlists are not currently supported for inverters and buffers. +.. option:: -* design_technology: + - ``topology="inverter|buffer"`` Specify the type of this component, can be either an inverter or a buffer. - * **topology:** [``inverter`` | ``buffer``]. Specify the type of this component, can be either an inverter or a buffer. + - ``size=""`` Specify the driving strength of inverter/buffer. For a buffer, the size is the driving strength of the inverter at the second level. Note that we consider a two-level structure for a buffer here. - * **size:** Specify the driving strength of inverter/buffer. For a buffer, the size is the driving strength of the inverter at the second level. We consider a two-level structure for a buffer here. The support for multi-level structure of a buffer will be introduced in the tapered options. + - ``num_level=""`` Define the number of levels of a tapered inverter/buffer. This is required when users need an inverter or a buffer consisting of >2 stages - * **tapered:** [``on`` | ``off``]. Define if the buffer is a tapered (multi-level) buffer. When ``on`` is defined, the following parameter are required.* + - ``f_per_stage=""`` Define the ratio of driving strength between the levels of a tapered inverter/buffer. Default value is 4. - * **tap_drive_level:** Define the number of levels of a tapered buffer. This parameter is valid only when tapered is turned on. - - * **f_per_stage:** Define the ratio of driving strength between the levels of a tapered driver. This parameter is valid only when tapered is turned on. Default value is 4. - -**Inverter x1 example** +Inverter 1x Example +``````````````````` :numref:`fig_inv1` is the inverter symbol depicted in this example. @@ -37,9 +39,9 @@ Inverters and Buffers .. figure:: ./figures/Inverter_1.png :scale: 100% - :alt: classical inverter x1 symbol + :alt: classical inverter 1x symbol - Classical inverter x1 symbol. + Classical inverter 1x symbol. The XML code describing this inverter is: @@ -52,18 +54,20 @@ The XML code describing this inverter is: This example shows: - * The topology chosen as inverter - * Size of 1 for the output strength - * The tapered parameter is not declared and is off by default -**Power-gated Inverter x1 example** + - The topology chosen as inverter + - Size of 1 for the output strength + - The tapered parameter is not declared and is ``false`` by default + +Power-gated Inverter 1x example +``````````````````````````````` The XML code describing an inverter which can be power-gated by the control signals ``EN`` and ``ENB`` : .. code-block:: xml - + @@ -72,15 +76,16 @@ The XML code describing an inverter which can be power-gated by the control sign .. note:: For power-gated inverters: all the control signals must be set as ``config_enable`` so that the testbench generation will generate testing waveforms. If the power-gated inverters are auto-generated , all the ``config_enable`` signals must be ``global`` signals as well. If the pwoer-gated inverters come from user-defined netlists, restrictions on ``global`` signals are free. -**Buffer x2 example** +Buffer 2x example +````````````````` :numref:`fig_buff` is the buffer symbol depicted in this example. .. _fig_buff: .. figure:: ./figures/Buffer.png - :scale: 100% - :alt: buffer symbol composed by 2 inverter, its output strength equal 2 + :scale: 50% + :alt: buffer symbol composed by 2 inverter, its output strength equals to 2 Buffer made by two inverter, with an output strength of 2. @@ -95,19 +100,20 @@ The XML code describing this buffer is: This example shows: - * The topology chosen as buffer - * Size of 2 for the output strength - * The tapered parameter is not declared and is off by default + - The topology chosen as buffer + - Size of 2 for the output strength + - The tapered parameter is not declared and is ``false`` by default -**Tapered inverter x16 example** +Tapered inverter 16x example +```````````````````````````` :numref:`fig_invtap4` is the tapered inverter symbol depicted this example. .. _fig_invtap4: .. figure:: ./figures/Tapered_inverter.png - :scale: 100% + :scale: 50% :alt: tapered inverter composed by 3 inverter for an output strength = 16 Inverter with high output strength made by 3 stage of inverter. @@ -117,62 +123,65 @@ The XML code describing this inverter is: .. code-block:: xml - + This example shows: - * The topology chosen as inverter - * Size of 1 for the first stage output strength - * The tapered parameter is on. Then the required sub parameters are declared - * The number of stage is set to 3 by tap_drive_level - * f_per_stage is set to 4. Then 2nd stage output strength is 4* the 1st stage output strength (so 4*1 = 4) and the 3rd stage output strength is 4* the 2nd stage output strength (so 4*4 = 16). - + - The topology chosen as inverter + - Size of 1 for the first stage output strength + - The number of stage is set to 3 by + - f_per_stage is set to 4. Then 2nd stage output strength is 4* the 1st stage output strength (so 4*1 = 4) and the 3rd stage output strength is 4* the 2nd stage output strength (so 4*4 = 16). Pass-gate Logic ~~~~~~~~~~~~~~~ +Template +```````` + .. code-block:: xml - - - - - - + + + + + + -.. note:: customized Verilog/SPICE netlists are not currently supported for pass-gate logics. +.. note:: Please do not add input and output buffers to pass-gate logic. -* design_technology: +.. option:: - * **topology:** [``transmission_gate`` | ``pass_transistor``]. The transmission gate consists of a NMOS transistor and a PMOS transistor. The pass transistor consists of a NMOS transistor. + - ``topology="transmission_gate|pass_transistor"`` Specify the circuit topology for the pass-gate logic. A transmission gate consists of a *n*-type transistor and a *p*-type transistor. The pass transistor consists of only a *n*-type transistor. - * **nmos_size:** the size of NMOS transistor in a transmission gate or pass_transistor, expressed in terms of the min_width defined in XML node . + - ``nmos_size=""`` the size of *n*-type transistor in a transmission gate or pass_transistor, expressed in terms of the minimum width ``min_width`` defined in the transistor model in :ref:`technology_library`. - * **pmos_size:** the size of PMOS transistor in a transmission gate, expressed in terms of the min_width defined in XML node . + - ``pmos_size=""`` the size of *p*-type transistor in a transmission gate, expressed in terms of the minimum width ``min_width`` defined in the transistor model in :ref:`technology_library`. -**Transmission-gate example** +.. note:: ``nmos_size`` and ``pmos_size`` are required for FPGA-SPICE + +Transmission-gate Example +````````````````````````` :numref:`fig_passgate` is the pass-gate symbol depicted in this example. .. _fig_passgate: .. figure:: ./figures/pass-gate.png - :scale: 60% + :scale: 30% :alt: pmos and nmos transistortors forming a pass-gate - Pass-gate made by pmos ans nmos association. + Pass-gate made by a *p*-type and a *n*-type transistors. The XML code describing this pass-gate is: .. code-block:: xml - + @@ -180,18 +189,18 @@ The XML code describing this pass-gate is: This example shows: - * Topology is ``transmission_gate``, which means the component need entries for each transistor gate (pmos and nmos) - * 3 inputs considered, 1 for signal and 2 to control the transistors gates - * No input or output buffer used, these parameters can be uninitialized + - A ``transmission_gate`` built with a *n*-type transistor in the size of 1 and a *p*-type transistor in the size of 2. + - 3 inputs considered, 1 for datapath signal and 2 to turn on/off the transistors gates -**Pass-transistor example** +Pass-transistor Example +``````````````````````` :numref:`fig_passtran` is the pass-gate symbol depicted in this example. .. _fig_passtran: .. figure:: ./figures/pass_transistor.png - :scale: 50% + :scale: 30% :alt: nmos transistortor forming a pass-gate Pass-gate made by a nmos transistor. @@ -208,22 +217,23 @@ The XML code describing this pass-gate is: This example shows: - * Topology is ``pass_transistor``, which means the component need an entry for the transistor gate (nmos) - * 2 inputs considered, 1 for signal and 1 to control the transistor gate - * No input or output buffer used, these parameters can be uninitialized - + - A ``pass_transistor`` build with a *n*-type transistor in the size of 1 + - 2 inputs considered, 1 for datapath signal and 1 to turn on/off the transistor gate SRAMs ~~~~~ +Template +```````` + .. code-block:: xml - + - - - - + + + + .. note:: The circuit designs of SRAMs are highly dependent on the technology node and well optimized by engineers. Therefore, FPGA-Verilog/SPICE requires users to provide their customized SRAM Verilog/SPICE/Verilog netlists. A sample Verilog/SPICE netlist of SRAM can be found in the directory SpiceNetlists in the released package. FPGA-Verilog/SPICE assumes that all the LUTs and MUXes employ the SRAM circuit design. Therefore, currently only one SRAM type is allowed to be defined. @@ -235,64 +245,93 @@ SRAMs Logic gates ~~~~~~~~~~~ +The circuit model in the type of ``gate`` aims to support direct mapping to standard cells or customized cells provided by technology vendors or users. + +Template +```````` + .. code-block:: xml - - - - - - + + + + + + -.. note:: The circuit model in the type of gate aims to support direct mapping to standard cells or customized cells provided by technology vendors or users. -.. note:: The logic functionality of a gate can be defined through the XML keyword ``topology``. Currently, OpenFPGA supports AND, OR and MUX2 gates. As for standard cells, the size of each port is limited to 1. Currently, only 2-input and single-output logic gates are supported. +.. option:: + + - ``topology="AND|OR|MUX2"`` Specify the logic functionality of a gate. As for standard cells, the size of each port is limited to 1. Currently, only 2-input and single-output logic gates are supported. -.. note:: It may happen that the port sequence in generated Verilog netlists has conflicts with the port sequence in standard and customized cells. To avoid this, users can set the XML keyword ``dump_explicit_port_map`` to be true, which enables explicit port mapping are dumped. Users can specify the pin/port name in the standard cell library using the XML keyword ``lib_name``. +2-input OR Gate Example +``````````````````````` + +.. code-block:: xml + + + + + + + + + + 10e-12 8e-12 + + + 10e-12 7e-12 + + + +This example shows: + - A 2-input OR gate without any input and output buffers + - Propagation delay from input ``a`` to ``out`` is 10ps in rising edge and and 8ps in falling edge + - Propagation delay from input ``b`` to ``out`` is 10ps in rising edge and 7ps in falling edge Multiplexers ~~~~~~~~~~~~ +Template +```````` + .. code-block:: xml - - - - - - - - + + + + + + + + -.. note:: customized Verilog/SPICE netlists are not currently supported for multiplexers. +.. note:: user-defined Verilog/SPICE netlists are not currently supported for multiplexers. -* design_technology: +.. option:: - * **structure:** can be [``tree`` \| ``multi-level`` \| ``one-level``]. The structure options are valid for SRAM-based multiplexers. For RRAM-based multiplexers, currently we only support the circuit design in [5]. If ``multi-level`` the following parameter is required: + - ``structure="tree|multi-level|one-level"`` Specify the multiplexer structure for a multiplexer. The structure option is only valid for SRAM-based multiplexers. For RRAM-based multiplexers, currently we only support the one-level structure - * **num_level:** specify the number of levels when multi-level structure is selected, only. + - ``num_level=""`` Specify the number of levels when ``multi-level`` structure is selected. - * **add_const_input:** can be [``true`` \| ``false``]. When enabled, an extra input will be added to the multiplexer circuits defined in this ``circuit_model``. For example, an 4-input multiplexer will be turned to a 5-input multiplexer. The extra input will be wired to a constant value, which can be specified through the XML syntax ``const_input_val``. The constant value can be either 0 or 1 (By default it is 0). Note that adding such input will help reducing the leakage power of FPGA and parasitic signal activities, with a limited area overhead. + - ``add_const_input="true|false"`` Specify if an extra input should be added to the multiplexer circuits. For example, an 4-input multiplexer will be turned to a 5-input multiplexer. The extra input will be wired to a constant value, which can be specified through the XML syntax ``const_input_val``. - * **const_input_val:** specify the constant value, to which the extra input will be connected. This syntax is only valid when the ``add_const_input`` is set to true. + .. note:: Adding an extra constant input will help reducing the leakage power of FPGA and parasitic signal activities, with a limited area overhead. + + - ``const_input_val="0|1"`` Specify the constant value, to which the extra input will be connected. By default it is 0. This syntax is only valid when the ``add_const_input`` is set to true. - * **local_encoder:** can be [``true`` \| ``false``]. When enabled, an local encoder will be added to the multiplexer circuits defined in this ``circuit_model``. The local encoder will be interface the SRAM inputs of multiplexing structure and SRAMs. It can encode the one-hot codes (that drive the select port of multiplexing structure) to a binary code. For example, 8-bit ``00000001`` will be encoded to 3-bit ``000``. This will help reduce the number of SRAM cells used in FPGAs as well as configuration time (especially for scan-chain configuration protocols). But it may cost an area overhead. + - ``local_encoder="true|false"``. Specify if a local encoder should be added to the multiplexer circuits. The local encoder will interface the SRAM inputs of multiplexing structure and SRAMs. It can encode the one-hot codes (that drive the select port of multiplexing structure) to a binary code. For example, 8-bit ``00000001`` will be encoded to 3-bit ``000``. This will help reduce the number of SRAM cells used in FPGAs as well as configuration time (especially for scan-chain configuration protocols). But it may cost an area overhead. - .. note:: Local encoders are only applicable for one-level and multi-level multiplexers. Tree-like multiplexers are already encoded in their nature. + .. note:: Local encoders are only applicable for one-level and multi-level multiplexers. Tree-like multiplexers are already encoded in their nature. - * **prog_transistor_size:** valid only when the type of design technology is ``rram``. Specify the size of programming transistors used in the RRAM-based multiplexer, we use only n-type transistor and the size should be expressed in terms of the min_width defined in XML node ``transistors``. If type of design technology is ``rram``, then the following parameters are required: - - * **ron:** valid only when the type of design technology is rram. Specify the on-resistance of the RRAM device used in the RRAM-based multiplexer. - - * **roff:** valid only when the type of design technology is rram. Specify the off-resistance of the RRAM device used in the RRAM-based multiplexer. - -* port: for a multiplexer, the three types of ports, ``input``, ``output`` and ``sram`` should be defined. +.. note:: A multiplexer should have only three types of ports, ``input``, ``output`` and ``sram``, which are all mandatory. .. note:: For tree-like multiplexers, they can be built with standard cell MUX2. To enable this, users should define a ``circuit_model``, which describes a 2-input multiplexer (See details and examples in how to define a logic gate using ``circuit_model``. In this case, the ``circuit_model_name`` in the ``pass_gate_logic`` should be the name of MUX2 ``circuit_model``. -**Mux 1 level example** +One-level Mux Example +````````````````````` :numref:`fig_mux1` illustrates an example of multiplexer modelling, which consists of input/output buffers and a transmission-gate-based tree structure. @@ -318,12 +357,15 @@ The code describing this Multiplexer is: -**This example shows:** - * Each circuit model composing the Multiplexer - * The possibility to select the input or output buffers - * The possibility to select the pass-gate inside the Mux. +This example shows: + - A one-level 4-input CMOS multiplexer + - All the inputs will be buffered using the circuit model ``inv1x`` + - All the outputs will be buffered using the circuit model ``tapbuf4`` + - The multiplexer will be built by transmission gate using the circuit model ``tgate`` + - The multiplexer will have 4 inputs and 4 SRAMs to control which datapath to propagate -**Mux-tree example** +Tree-like Multiplexer Example +````````````````````````````` :numref:`fig_mux` illustrates an example of multiplexer modelling, which consists of input/output buffers and a transmission-gate-based tree structure. @@ -349,61 +391,101 @@ If we arbitrarily fix the number of Mux entries at 4, the following code could i -**This example shows:** - * The tree topology, 4 entries split in 2 2-to-1 Muxes then another one make the final selection. - * The possibility to select the input or output buffers - * The number of entries parametrized by ``size`` in input port-type. +This example shows: + - A tree-like 4-input CMOS multiplexer + - All the inputs will be buffered using the circuit model ``inv1x`` + - All the outputs will be buffered using the circuit model ``tapbuf4`` + - The multiplexer will be built by transmission gate using the circuit model ``tgate`` + - The multiplexer will have 4 inputs and 3 SRAMs to control which datapath to propagate Look-Up Tables ~~~~~~~~~~~~~~ +Template +```````` + .. code-block:: xml - - - - - - - - - - - + + + + + + + + + + + .. note:: The Verilog/SPICE netlists of LUT can be auto-generated or customized. The auto-generated LUTs are based on a tree-like multiplexer, whose gates of the transistors are used as the inputs of LUTs and the drains/sources of the transistors are used for configurable memories (SRAMs). The LUT provided in customized Verilog/SPICE netlist should have the same decoding methodology as the traditional LUT. -Additional design parameters for LUTs: +.. option:: -* **lut_input_buffer:** Define transistor-level description for the buffer for the inputs of a LUT (gates of the internal multiplexer). Use keyword circuit_model_name to specify the circuit_model that containing details of the circuit. + Define transistor-level description for the buffer for the inputs of a LUT (gates of the internal multiplexer). -* **lut_input_inverter:** Define transistor-level description for the inverter for the inputs of a LUT (gates of the internal multiplexer). Use keyword circuit_model_name to specify the circuit_model that containing details of the circuit. + - ``exist="true|false"`` Specify if the input buffer should exist for LUT inputs + - ``circuit_model_name=""`` Specify the ``circuit_model`` that will be used to build the input buffers -* **lut_intermediate_buffer:** Define transistor-level description for the buffer locating at intermediate stages of internal multiplexer of a LUT. Use keyword circuit_model_name to specify the circuit_model that containing details of the circuit. To customize the location, users can define an integer array in the XML keyword location_map. For example, "-1-1-" indicates buffer inseration to every two stages of the LUT multiplexer tree, considering a 6-input LUT. +.. note:: In the context of LUT, ``input_buffer`` corresponds to the buffer for the datapath inputs of multiplexers inside a LUT. ``lut_input_buffer`` corresponds to the buffer at the inputs of a LUT +.. option:: -Instructions of defining design parameters: + Define transistor-level description for the inverter for the inputs of a LUT (gates of the internal multiplexer). -* **input_buffer:** Specify the buffer/inverter that connects the SRAM outputs to the inputs of multiplexer. + - ``exist="true|false"`` Specify if the input buffer should exist for LUT inputs -* **pass_gate_logic:** Specify the pass-gates of the internal multiplexer, the same as the multiplexers. + - ``circuit_model_name=""`` Specify the ``circuit_model`` that will be used to build the input inverters -* **port:** three types of ports (input, output and sram) should be defined. If the user provides an customized Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. To support customizable LUTs, each type of port contain special keywords. For input ports, the keyword tri_state_map aims to customize which inputs are fixed to constant values when the LUT is in fracturable modes. For example, ``tri_state_map`` ="----11" indicates that the last two inputs will be fixed to be logic '1' when a 6-input LUT is in fracturable modes. The circuit_model_name of input port is used to specify which logic gates will be used to tri-state the inputs in fracturable LUT modes. It is required to use an AND gate to force logic '0' or an OR gate to force logic '1' for the input ports. For output ports, the keyword lut_frac_level is used to specify the level in LUT multiplexer tree where the output port are wired to. For example, lut_frac_level="4" in a fracturable LUT6 means that the output are potentially wired to the 4th stage of a LUT multiplexer and it is an output of a LUT4. The keyword lut_output_mask describes which fracturable outputs are used. For instance, in a 6-LUT, there are potentially four LUT4 outputs can be wired out. lut_output_mask="0,2" indicates that only the first and the thrid LUT4 outputs will be used in fracturable mode. Note that the size of the output port should be consistent to the length of lut_output_mask. +.. option:: -* **SRAM port for mode selection:** To enable switch between different operating modes, the SRAM bits of a fracturable LUT consists of two parts: configuration memory and mode selecting. The SRAM port for mode selection is specified through the XML keyword mode_select. Note that the size of such SRAM port should be consistent to the number of 1s or 0s in the ``tri_state_map``. + Define transistor-level description for the buffer locating at intermediate stages of internal multiplexer of a LUT. -**LUT example** + - ``exist="true|false"`` Specify if the input buffer should exist at intermediate stages + + - ``circuit_model_name=""`` Specify the ``circuit_model`` that will be used to build these buffers + + - ``location_map="[1|-]"`` Customize the location of buffers in intermediate stages. Users can define an integer array consisting of '1' and '-'. For example, ``-1-1-`` indicates buffer inseration to every two stages of the LUT multiplexer tree, considering a 6-input LUT. + +.. note:: For a LUT, three types of ports (``input``, ``output`` and ``sram``) should be defined. If the user provides an customized Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. To support customizable LUTs, each type of port contain special keywords. + +.. option:: + + - ``tri_state_map="[-|1]"`` Customize which inputs are fixed to constant values when the LUT is in fracturable modes. For example, ``tri_state_map="----11"`` indicates that the last two inputs will be fixed to be logic '1' when a 6-input LUT is in fracturable modes. + + - ``circuit_model_name=""`` Specify the circuit model to build logic gates in order to tri-state the inputs in fracturable LUT modes. It is required to use an ``AND`` gate to force logic '0' or an ``OR`` gate to force logic '1' for the input ports. + +.. option:: + + - ``lut_frac_level=""`` Specify the level in LUT multiplexer tree where the output port are wired to. For example, ``lut_frac_level="4"`` in a fracturable LUT6 means that the output are potentially wired to the 4th stage of a LUT multiplexer and it is an output of a LUT4. + + - ``lut_output_mask=""`` Describe which fracturable outputs are used. For instance, in a 6-LUT, there are potentially four LUT4 outputs can be wired out. ``lut_output_mask="0,2"`` indicates that only the first and the thrid LUT4 outputs will be used in fracturable mode. + +.. note:: The size of the output port should be consistent to the length of ``lut_output_mask``. + +.. option:: + + - ``mode_select="true|false"`` Specify if this port is used to switch the LUT between different operating modes, the SRAM bits of a fracturable LUT consists of two parts: configuration memory and mode selecting. + + - ``circuit_model_name=""`` Specify the circuit model to be drive the SRAM port. Typically, the circuit model should be in the type of ``ccff`` or ``sram``. + + - ``default_val="0|1"`` Specify the default value for the SRAM port. The default value will be used in generating testbenches for unused LUTs + +.. note:: The size of a mode-selection SRAM port should be consistent to the number of '1s' or '0s' in the ``tri_state_map``. + +Single-Output LUT Example +````````````````````````` :numref:`fig_lut` illustrates an example of LUT modeling, which consists of input/output buffers and a transmission-gate-based tree structure. .. _fig_lut: .. figure:: ./figures/lut.png - :scale: 100% + :scale: 80% :alt: Detailed LUT composition An example of a LUT with transistor-level design parameters. @@ -416,52 +498,90 @@ The code describing this LUT is: + -**This example shows:** - * The difference between ``input_buffer`` and ``lut_input_buffer`` and that they are independent. - * How each blocks is defined +This example shows: + - A 6-input LUT which is configurable by 64 SRAM cells. + - The multiplexer inside LUT will be built with transmission gate using circuuit model ``inv1x`` + - There are no internal buffered inserted to any intermediate stage of a LUT + +Fracturable LUT Example +````````````````````````` + +.. code-block:: xml + + + + + + + + + + + + + + + + +This example shows: + - Fracturable 6-input LUT which is configurable by 65 SRAM cells. + - Intermedate buffers are added to every two stages of the internal multiplexer + - There is a SRAM cell to switch the operating mode of this LUT, configured by a configuration-chain flip-flop ``ccff`` + - The last input ``in[5]`` of LUT will be tri-stated in dual-LUT5 mode. + - An 2-input OR gate will be wired to the last input ``in[5]`` to tri-state the input. The mode-select SRAM will be wired to an input of the OR gate. + It means that when the mode-selection bit is '1', the LUT will operate in dual-LUT5 mode. + - There will be two outputs wired to the 5th stage of routing multiplexer (the outputs of dual 5-input LUTs) + - By default, the mode-selection configuration bit will be '1', indicating that by default the LUT will operate in dual-LUT5 mode. Flip-Flops ~~~~~~~~~~ +Template +```````` + .. code-block:: xml - + - - - - - + + + + + .. note:: The circuit designs of flip-flops are highly dependent on the technology node and well optimized by engineers. Therefore, FPGA-Verilog/SPICE requires users to provide their customized FF Verilog/SPICE/Verilog netlists. A sample Verilog/SPICE netlist of FF can be found in the directory SpiceNetlists in the released package. - The information of input and output buffer should be clearly specified according to the customized Verilog/SPICE netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. + The information of input and output buffer should be clearly specified according to the customized SPICE netlist! The existence of input/output buffers will influence the decision in creating SPICE testbenches, which may leads to larger errors in power analysis. - FPGA-Verilog/SPICE currently support only one clock domain in the FPGA. Therefore there should be only one clock port to be defined and the size of the clock port should be 1. +.. note:: FPGA-Verilog/SPICE currently support only one clock domain in the FPGA. Therefore there should be only one clock port to be defined and the size of the clock port should be 1. -Instructions of defining design parameters: +.. option:: -* **circuit_model type:** can be ``ff`` or ``scff``. FF is typical Flip-Flop, SCFF is Scan-Chain Flip-Flop + - ``type="ccff|ff"`` Specify the type of a flip-flop. ``ff`` is a regular flip-flop while ``ccff`` denotes a configuration-chain flip-flop -* **port:** three types of ports (``input``, ``output`` and ``clock``) should be defined. If the user provides a customized Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. +.. note:: A flip-flop should have three types of ports, ``input``, ``output`` and ``clock``. -.. note:: In a valid FPGA architecture, users should provide at least either a SCFF or a SRAM, so that the configurations can loaded to core logic. +.. note:: If the user provides a customized Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. -**FF example** +.. note:: In a valid FPGA architecture, users should provide at least either a ``ccff`` or ``sram`` circuit model, so that the configurations can loaded to core logic. -:numref:`fig_ff` illustrates an example of LUT modeling, which consists of input/output buffers and a transmission-gate-based tree structure. +Flip-Flop example +````````````````` + +:numref:`fig_ff` illustrates an example of regular flip-flop. .. _fig_ff: .. figure:: ./figures/FF.png - :scale: 100% + :scale: 50% :alt: FF symbol An example of classical Flip-Flop. @@ -470,27 +590,28 @@ The code describing this FF is: .. code-block:: xml - - - - - - + + + + + + -**This example shows:** - * Circuit model type as ``ff`` - * The verilog netlist file associated to this component ``ff.v`` - * 3 ports, ``Set``, ``Reset`` and ``clk``, defined as global +This example shows: + - A regular flip-flop which is defined in a Verilog netlist ``ff.v`` and a SPICE netlist ``ff.sp`` + - The flip-flop has ``set`` and ``reset`` functionalities + - The flip-flop port names defined differently in standard cell library and VPR architecture. The ``lib_name`` capture the port name defined in standard cells, while ``prefix`` capture the port name defined in ``pb_type`` of VPR architecture file -**SCFF example** +Configuration-chain Flip-flop Example +````````````````````````````````````` -:numref:`fig_scff` illustrates an example of LUT modeling, which consists of input/output buffers and a transmission-gate-based tree structure. +:numref:`fig_ccff` illustrates an example of scan-chain flop-flop used to build a configuration chain. -.. _fig_scff: +.. _fig_ccff: .. figure:: ./figures/scff.png - :scale: 100% + :scale: 50% :alt: SCFF symbol An example of a Scan-Chain Flip-Flop. @@ -499,85 +620,103 @@ The code describing this FF is: .. code-block:: xml - + - + -**This example shows:** - * Circuit model type as ``scff`` - * The verilog netlist file associated to this component ``scff.v`` - * 1 port, ``clk``, defined as global +This example shows: + - A configuration-chain flip-flop which is defined in a Verilog netlist ``ccff.v`` and a SPICE netlist ``ccff.sp`` + - The flip-flop has a global clock port, ``CK``, which will be wired a global programming clock Hard Logics ~~~~~~~~~~~ +Template +```````` + .. code-block:: xml - + - - - - + + + + .. note:: Hard logics are defined for non-configurable resources in FPGA architectures, such as adders, multipliers and RAM blocks. Their circuit designs are highly dependent on the technology node and well optimized by engineers. - As more functional units are included in FPGA architecture, it is impossible to auto-generate these functional units [3]. - Therefore, FPGA-Verilog/SPICE requires users to provide their customized Verilog/SPICE netlists. A sample Verilog/SPICE netlist of a 1-bit adder can be found in the directory SpiceNetlists in the released package. + As more functional units are included in FPGA architecture, it is impossible to auto-generate these functional units. + Therefore, FPGA-Verilog/SPICE requires users to provide their customized Verilog/SPICE netlists. - The information of input and output buffer should be clearly specified according to the customized Verilog/SPICE netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. +.. note:: Examples can be found in hard_logic_example_link_ -Instructions of defining design parameters: +.. _hard_logic_example_link: https://github.com/LNIS-Projects/OpenFPGA/tree/master/openfpga_flow/VerilogNetlists -* **port:** two types of ports (``input`` and ``output``) should be defined. If the user provides a user-defined Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. +.. note:: The information of input and output buffer should be clearly specified according to the customized Verilog/SPICE netlist! The existence of input/output buffers will influence the decision in creating SPICE testbenches, which may leads to larger errors in power analysis. + +1-bit Full Adder Example +```````````````````````` + +.. code-block:: xml + + + + + + + + + + + Routing Wire Segments ~~~~~~~~~~~~~~~~~~~~~ -FPGA-Verilog/SPICE provides two types of Verilog/SPICE models for the wire segments in FPGA architecture: +FPGA architecture requires two type of wire segments: - * One type is called ``wire``, which targets the local wires inside the logic blocks. The wire has one input and one output, directly connecting the output of a driver and the input of the downstream unit, respectively - * The other type is called ``chan_wire``, especially targeting the channel wires. The channel wires have one input and two outputs, one of which is connected to the inputs of Connection Boxes while the other is connected to the inputs of Switch Boxes. Two outputs are created because from the view of layout, the inputs of Connection Boxes are typically connected to the middle point of channel wires, which has less parasitic resistances and capacitances than connected to the ending point. + - ``wire``, which targets the local wires inside the logic blocks. The wire has one input and one output, directly connecting the output of a driver and the input of the downstream unit, respectively + - ``chan_wire``, especially targeting the channel wires. The channel wires have one input and two outputs, one of which is connected to the inputs of Connection Boxes while the other is connected to the inputs of Switch Boxes. Two outputs are created because from the view of layout, the inputs of Connection Boxes are typically connected to the middle point of channel wires, which has less parasitic resistances and capacitances than connected to the ending point. + +Template +```````` .. code-block:: xml - + - - - - - + + + + + .. note:: FPGA-Verilog/SPICE can auto-generate the Verilog/SPICE model for wires while also allows users to provide their customized Verilog/SPICE netlists. - The information of input and output buffer should be clearly specified according to the customized netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. +.. note:: The information of input and output buffer should be clearly specified according to the customized netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. -Instructions of defining design parameters: +.. option:: -* **type:** can be [``wire`` | ``chan_wire``]. The Verilog/SPICE model wire targets the local wire inside the logic block while the chan_wire targets the channel wires in global routing. + - ``model_type="pi|T"`` Specify the type of RC models for this wire segement. Currently, OpenFPGA supports the π-type and T-type multi-level RC models. + - ``R=""`` Specify the total resistance of the wire + - ``C=""`` Specify the total capacitance of the wire. + - ``num_level=""`` Specify the number of levels of the RC wire model. -* **port:** two types of ports (``input`` and ``output``) should be defined. If the user provides an customized Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. +.. note:: wire parameters are essential for FPGA-SPICE to accurately model wire parasitics -* **wire_param:** - - * **model_type:** can be [``pi`` | ``T``], corresponding to the π-type and T-type RC wire models. - * **res_val:** specify the total resistance of the wire - * **cap_val:** specify the total capacitance of the wire. - * **level:** specify the number of levels of the RC wire model. - -**Chan-Wire example** +Routing Track Wire Example +`````````````````````````` :numref:`fig_wire` depicts the modeling for a length-2 channel wire. .. _fig_wire: .. figure:: ./figures/wire.png - :scale: 100% + :scale: 80% :alt: map to buried treasure An example of a length-2 channel wire modeling @@ -589,46 +728,45 @@ The code describing this wire is: - + -**This example shows** - * How to use the ``wire_param`` for a π-type RC wire model - * How to use this circuit_model to auto-generate the Verilog/SPICE netlist +This example shows + - A routing track wire has 1 input and output + - The routing wire will be modelled as a 1-level π-type RC wire model with a total resistance of 103.84Ohm and a total capacitance of 13.89fF I/O pads ~~~~~~~~ +Template +```````` + .. code-block:: xml - + - - - - - + + + + + .. note:: The circuit designs of I/O pads are highly dependent on the technology node and well optimized by engineers. Therefore, FPGA-Verilog/SPICE requires users to provide their customized Verilog/SPICE/Verilog netlists. A sample Verilog/SPICE netlist of an I/O pad can be found in the directory SpiceNetlists in the released package. - The information of input and output buffer should be clearly specified according to the customized netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. +.. note:: The information of input and output buffer should be clearly specified according to the customized netlist! The existence of input/output buffers will influence the decision in creating testbenches, which may leads to larger errors in power analysis. -Instructions of defining design parameters: +I/O Pad Example +``````````````` -* **port:** four types of ports (``input``, ``output``, ``inout`` and ``sram``) should be defined. If the user provides a user-defined Verilog/SPICE netlist, the bandwidth of ports should be defined to the same as the Verilog/SPICE netlist. - -**IO-pad example** - -:numref:`fig_iopad` depicts an IO-Pad. +:numref:`fig_iopad` depicts an I/O pad. .. _fig_iopad: .. figure:: ./figures/iopad.png - :scale: 100% + :scale: 50% :alt: IO-Pad symbol An example of an IO-Pad @@ -637,16 +775,19 @@ The code describing this IO-Pad is: .. code-block:: xml - + + + + + - - - - + + + -**This example shows** - - * The association of the verilog netlist file ``io.v`` - * The inout pad port_type, which means as inout as output. - * The instantiation of a SCFF as sram +This example shows + - A general purpose I/O cell defined in Verilog netlist ``io.sp`` and SPICE netlist ``io.sp`` + - The I/O cell has an ``inout`` port as the bi-directional port + - The directionality of I/O can be controlled by a configuration-chain flip-flop defined in circuit model ``ccff`` + - If unused, the I/O cell have be configured to '1'