diff options
| author | YRabbit <rabbit@yrabbit.cyou> | 2022-11-25 20:49:26 +1000 | 
|---|---|---|
| committer | YRabbit <rabbit@yrabbit.cyou> | 2022-11-25 20:49:26 +1000 | 
| commit | ec53ae0c3ba7778f41274f05f4561a335a4b0b90 (patch) | |
| tree | 85cf51a2deb5ac85cbdb6494b41e214f4fc041cc | |
| parent | c61d490bd4577dccb164fd94368c44cfc7905876 (diff) | |
| download | nextpnr-ec53ae0c3ba7778f41274f05f4561a335a4b0b90.tar.gz nextpnr-ec53ae0c3ba7778f41274f05f4561a335a4b0b90.tar.bz2 nextpnr-ec53ae0c3ba7778f41274f05f4561a335a4b0b90.zip  | |
gowin: add information about pin configurations
Includes information on additional pin functions such as RPLL_C_IN, GCLKC_3, SCLK and others.
This allows a decision to be made about special network routing of such pins
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
| -rw-r--r-- | gowin/arch.cc | 15 | ||||
| -rw-r--r-- | gowin/arch.h | 11 | 
2 files changed, 22 insertions, 4 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index e6eeced3..756580e0 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -666,6 +666,17 @@ const PairPOD *pairLookup(const PairPOD *list, const size_t len, const int dest)      return nullptr;  } +const PinPOD *pinLookup(const PinPOD *list, const size_t len, const int idx) +{ +    for (size_t i = 0; i < len; i++) { +        const PinPOD *pin = &list[i]; +        if (pin->index_id == idx) { +            return pin; +        } +    } +    return nullptr; +} +  bool aliasCompare(GlobalAliasPOD i, GlobalAliasPOD j)  {      return (i.dest_row < j.dest_row) || (i.dest_row == j.dest_row && i.dest_col < j.dest_col) || @@ -947,9 +958,9 @@ void Arch::read_cst(std::istream &in)          case ioloc: { // IO_LOC name pin              IdString pinname = id(match[2]);              pinline = match[2]; -            const PairPOD *belname = pairLookup(package->pins.get(), package->num_pins, pinname.index); +            const PinPOD *belname = pinLookup(package->pins.get(), package->num_pins, pinname.index);              if (belname != nullptr) { -                std::string bel = IdString(belname->src_id).str(this); +                std::string bel = IdString(belname->loc_id).str(this);                  it->second->setAttr(IdString(ID_BEL), bel);              } else {                  if (std::regex_match(pinline, match_pinloc, iobelre)) { diff --git a/gowin/arch.h b/gowin/arch.h index 994b6d98..0591e41a 100644 --- a/gowin/arch.h +++ b/gowin/arch.h @@ -140,10 +140,17 @@ NPNR_PACKED_STRUCT(struct PartnumberPOD {      uint32_t speed_id;  }); +NPNR_PACKED_STRUCT(struct PinPOD { +    uint16_t index_id; +    uint16_t loc_id; +    uint32_t num_cfgs; +    RelPtr<uint32_t> cfgs; +}); +  NPNR_PACKED_STRUCT(struct PackagePOD {      uint32_t name_id;      uint32_t num_pins; -    RelPtr<PairPOD> pins; +    RelPtr<PinPOD> pins;  });  NPNR_PACKED_STRUCT(struct VariantPOD { @@ -475,7 +482,7 @@ struct Arch : BaseArch<ArchRanges>      void route_gowin_globals(Context *ctx);      // chip db version -    unsigned int const chipdb_version = 1; +    unsigned int const chipdb_version = 2;      std::vector<IdString> cell_types;  | 
