nextpnr/himbaechel/uarch/ng-ultra/extra_data.h
Miodrag Milanović 5a807110de
Adding NanoXplore NG-Ultra support (#1397)
* ng-ultra: new architecture

* Implementation as in D2 deliverable

* Support for nxdesignsuite-24.0.0.0-20240429T102300

* Save memory by directly outputing json

* Add support for bidirectional IOs

* cleanup

* Create BFRs properly

* Add IOM insertion

* Cleanup

* Block certain pips depending of DDFR mode

* Add LUT bypass to improve routability

* Add bypass for CSC mode of GCK

* Fix IOM case

* Initial memory support

* Better RF/XRF handling

* fix

* RF placement and legalization

* Disconnect non available ports for NX_RAM

* cleanup

* Add RFB/RAM context support for latest release

* Remove ports that must not be used

* Proper port used only on RFB

* Add structure for clock sinks

* Use cell type where applicable

* Add clock sinks for other cell types

* Validation check fixes

* Commented too restrictive placement

* Added more crossbar wire type

* Hande IO termination input

* Fail early due to NX tools limitation for now

* Validations and fixes for RAM I/Os

* Fix for latest version of tools

* Use ctx->idf where applicable

* warn if RAM ports are not actually used

* Fix IOM packing

* Fix CY packing

* Change how constants are handled on CY

* Post placement optimization for CY

* Address comments for PR

* pack and export  GCK, WFG and PLL

* Cover more global routing cases

* Constraing to location if provided

* Place at LOC

* Pack and export DSP

* wip

* wip

* notes

* wip

* wip

* Validate DSPs

* DSP cascading

* Check mandatory parameters for DSP

* existing gck

* wip

* export all the rest for bitstream

* CDC packing

* add more sinks

* place FIFO

* map rest of FIFO ports

* enable pll by default

* cleanup

* Initial XLUT support

* Fix statistics

* Properly duplicate GCKs

* RRSTO and WRSTO are not used on XFIFO

* Fix for latest version of JSON format

* Implement GCK limitations

* cleanup

* cleanup

* Add more signals and use lowskew name

* cleanup code a bit

* Fix wfb

* detect cascaded GCKs

* Handle DFR

* Route dfr clock properly

* Cleanup

* Cleanup bitstream code

* Review issues addressed

* Move helper routines

* Expose private members for unit tests

* cleanup

* remove scale factor

* make all location helper arrays static

* Addressed review comments

* Support post-routing CSC and SCC

* Support NX_BFF

* Place CSS and SCC only on allowed locations

* Support latest Impulse

* ng_ultra: Expand bounding box further for left-edge IO

Signed-off-by: gatecat <gatecat@ds0.me>

* Export all IO parameters in bitstream

* Handle new CSV order or parameters and additional validation

* Add some more undocumented values for CSV

* Support for old and new CSV formats

* Initial DDFR support

* Display warning message once per file

* Address review issues

* Fix crash on memory access

* Make boundbox fit NG-Ultra internal design

* Update attributes after dff rewrite

* Implement basic NG-Ultra LUT-DFF unit tests

* Always use first seen xbar input

Signed-off-by: gatecat <gatecat@ds0.me>

* Simplified crossbar pip detection

* Change order to prevent issues with some unconnected constants

* Pack LUT and multiple DFF in stripe

* Place DFF chains

* Improve large DFF chains

* Rename to pack_dff_chains

* Better use XLUTs when possible

* pack output DFF together with XLUT

* option to disable XLUT optimiziations

* Make more optimizations optional

* fix to use pre-increment

* GCK for lowskew signals

* Bugfix for nets that are not part of lowskew network

* Fix bitstream export for PLL cell

* Remove separate route lowskew

* Allow WFG mode 2

* Merge inverter into GCK

* Add CSC per TILE when needed

* Improve reusage of existing cell for CSC

* Take preferred CSC

* Cleanup

* When in place CSC size not important

* Cleanup

* Reset and Load restriction

* make csc optimisation optional

* Proper count for IO resources

* Detect when there is no next cell for DSP chain

* Do not incorporate loops in XLUT

* Check if output exists

* Update copyright for delivery

* Make building NG-Ultra chip database optional, follow filename convention

* Ported drawing code to new API

* Update expandBoundingBox for NG-Ultra

* Copyright and license update

* Add README information

* cleanup and constids

* Using ctx->idf where applicable

* remove if_using_basecluster

* refactor extra data usage

* refactor to use create_cell_ptr only

* optimized getCSC

* optimize critical path a bit

* clangformat

* disable clangformat where applicable

---------

Signed-off-by: gatecat <gatecat@ds0.me>
Co-authored-by: Lofty <dan.ravensloft@gmail.com>
Co-authored-by: gatecat <gatecat@ds0.me>
2024-12-04 09:00:05 +01:00

266 lines
5.4 KiB
C

/*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2024 The Project Beyond Authors.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifndef NGULTRA_EXTRA_DATA_H
#define NGULTRA_EXTRA_DATA_H
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN
NPNR_PACKED_STRUCT(struct NGUltraTileInstExtraDataPOD {
int32_t name;
uint8_t lobe;
uint8_t tile_type;
uint16_t dummy2;
});
NPNR_PACKED_STRUCT(struct NGUltraPipExtraDataPOD {
int32_t name;
uint16_t type;
uint8_t input;
uint8_t output;
});
NPNR_PACKED_STRUCT(struct NGUltraBelExtraDataPOD { int32_t flags; });
struct GckConfig
{
explicit GckConfig(BelId belid)
{
bel = belid;
si1 = IdString();
si2 = IdString();
used = false;
}
BelId bel;
IdString si1;
IdString si2;
bool used;
};
enum TILETypeZ
{
BEL_LUT_Z = 0,
BEL_LUT_MAX_Z = 31,
BEL_CY_Z = 32,
BEL_XLUT_Z = BEL_CY_Z + 4,
BEL_RF_Z = BEL_XLUT_Z + 8,
BEL_XRF_Z = BEL_RF_Z + 2,
BEL_FIFO_Z = BEL_XRF_Z + 1,
BEL_XFIFO_Z = BEL_FIFO_Z + 2,
BEL_CDC_Z = BEL_XFIFO_Z + 1,
BEL_XCDC_Z = BEL_CDC_Z + 2
};
enum ClusterPlacement
{
PLACE_CY_CHAIN = 1024,
PLACE_CY_FE1,
PLACE_CY_FE2,
PLACE_CY_FE3,
PLACE_CY_FE4,
PLACE_XLUT_FE1,
PLACE_XLUT_FE2,
PLACE_XLUT_FE3,
PLACE_XLUT_FE4,
PLACE_XRF_I1,
PLACE_XRF_I2,
PLACE_XRF_I3,
PLACE_XRF_I4,
PLACE_XRF_I5,
PLACE_XRF_I6,
PLACE_XRF_I7,
PLACE_XRF_I8,
PLACE_XRF_I9,
PLACE_XRF_I10,
PLACE_XRF_I11,
PLACE_XRF_I12,
PLACE_XRF_I13,
PLACE_XRF_I14,
PLACE_XRF_I15,
PLACE_XRF_I16,
PLACE_XRF_I17,
PLACE_XRF_I18,
PLACE_XRF_I19,
PLACE_XRF_I20,
PLACE_XRF_I21,
PLACE_XRF_I22,
PLACE_XRF_I23,
PLACE_XRF_I24,
PLACE_XRF_I25,
PLACE_XRF_I26,
PLACE_XRF_I27,
PLACE_XRF_I28,
PLACE_XRF_I29,
PLACE_XRF_I30,
PLACE_XRF_I31,
PLACE_XRF_I32,
PLACE_XRF_I33,
PLACE_XRF_I34,
PLACE_XRF_I35,
PLACE_XRF_I36,
PLACE_XRF_RA1,
PLACE_XRF_RA2,
PLACE_XRF_RA3,
PLACE_XRF_RA4,
PLACE_XRF_RA5,
PLACE_XRF_RA6,
PLACE_XRF_RA7,
PLACE_XRF_RA8,
PLACE_XRF_RA9,
PLACE_XRF_RA10,
PLACE_XRF_WA1,
PLACE_XRF_WA2,
PLACE_XRF_WA3,
PLACE_XRF_WA4,
PLACE_XRF_WA5,
PLACE_XRF_WA6,
PLACE_XRF_WE,
PLACE_XRF_WEA,
PLACE_DSP_CHAIN,
PLACE_CDC_AI1,
PLACE_CDC_AI2,
PLACE_CDC_AI3,
PLACE_CDC_AI4,
PLACE_CDC_AI5,
PLACE_CDC_AI6,
PLACE_CDC_BI1,
PLACE_CDC_BI2,
PLACE_CDC_BI3,
PLACE_CDC_BI4,
PLACE_CDC_BI5,
PLACE_CDC_BI6,
PLACE_CDC_ASRSTI,
PLACE_CDC_ADRSTI,
PLACE_CDC_BS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O_WRSTI1,
PLACE_FIFO_RRSTI1,
PLACE_FIFO_WRSTI2,
PLACE_FIFO_RRSTI2,
PLACE_FIFO_WRSTI3,
PLACE_FIFO_RRSTI3,
PLACE_FIFO_WRSTI4,
PLACE_FIFO_RRSTI4,
PLACE_FIFO_WEQ1,
PLACE_FIFO_REQ1,
PLACE_FIFO_WEQ2,
PLACE_FIFO_REQ2,
PLACE_LUT_CHAIN,
PLACE_DFF_CHAIN,
};
enum PipExtra
{
PIP_EXTRA_CROSSBAR = 1,
PIP_EXTRA_MUX = 2,
PIP_EXTRA_BYPASS = 3,
PIP_EXTRA_LUT_PERMUTATION = 4,
PIP_EXTRA_INTERCONNECT = 5,
PIP_EXTRA_VIRTUAL = 6,
};
enum BelExtra
{
BEL_EXTRA_FE_CSC = 1,
BEL_EXTRA_FE_SCC = 2,
};
enum TileTypeExtra
{
TILE_EXTRA_FABRIC = 0,
TILE_EXTRA_TUBE = 1,
TILE_EXTRA_SOC = 2,
TILE_EXTRA_RING = 3,
TILE_EXTRA_FENCE = 4
};
NEXTPNR_NAMESPACE_END
#endif