diff options
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.h | 3 | ||||
-rw-r--r-- | ecp5/config.h | 1 | ||||
-rw-r--r-- | ecp5/resource/chipdb.rc | 5 | ||||
-rw-r--r-- | ecp5/resource/embed.cc | 28 | ||||
-rw-r--r-- | ecp5/resource/resource.h | 4 | ||||
-rwxr-xr-x | ecp5/trellis_import.py | 2 |
6 files changed, 42 insertions, 1 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h index 1ddc4003..cd103b12 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -22,6 +22,7 @@ #error Include "arch.h" via "nextpnr.h" only. #endif +#include <set> #include <sstream> NEXTPNR_NAMESPACE_BEGIN @@ -453,6 +454,7 @@ struct Arch : BaseCtx bel_to_cell[bel] = cell; cells[cell]->bel = bel; cells[cell]->belStrength = strength; + refreshUiBel(bel); } void unbindBel(BelId bel) @@ -462,6 +464,7 @@ struct Arch : BaseCtx cells[bel_to_cell[bel]]->bel = BelId(); cells[bel_to_cell[bel]]->belStrength = STRENGTH_NONE; bel_to_cell[bel] = IdString(); + refreshUiBel(bel); } Loc getBelLocation(BelId bel) const diff --git a/ecp5/config.h b/ecp5/config.h index 637069e9..038ddbf0 100644 --- a/ecp5/config.h +++ b/ecp5/config.h @@ -21,6 +21,7 @@ #define ECP5_CONFIG_H #include "nextpnr.h" +#include <map> NEXTPNR_NAMESPACE_BEGIN diff --git a/ecp5/resource/chipdb.rc b/ecp5/resource/chipdb.rc new file mode 100644 index 00000000..7191f581 --- /dev/null +++ b/ecp5/resource/chipdb.rc @@ -0,0 +1,5 @@ +#include "resource.h" + +IDR_CHIPDB_25K BINARYFILE "..\chipdbs\chipdb-25k.bin" +IDR_CHIPDB_45K BINARYFILE "..\chipdbs\chipdb-45k.bin" +IDR_CHIPDB_88K BINARYFILE "..\chipdbs\chipdb-85k.bin" diff --git a/ecp5/resource/embed.cc b/ecp5/resource/embed.cc new file mode 100644 index 00000000..adbb7781 --- /dev/null +++ b/ecp5/resource/embed.cc @@ -0,0 +1,28 @@ +#include <cstdio> +#include <windows.h> +#include "nextpnr.h" +#include "resource.h" + +NEXTPNR_NAMESPACE_BEGIN + +const char *chipdb_blob_25k; +const char *chipdb_blob_45k; +const char *chipdb_blob_85k; + +const char *LoadFileInResource(int name, int type, DWORD &size) +{ + HMODULE handle = ::GetModuleHandle(NULL); + HRSRC rc = ::FindResource(handle, MAKEINTRESOURCE(name), MAKEINTRESOURCE(type)); + HGLOBAL rcData = ::LoadResource(handle, rc); + size = ::SizeofResource(handle, rc); + return static_cast<const char *>(::LockResource(rcData)); +} +void load_chipdb() +{ + DWORD size = 0; + chipdb_blob_25k = LoadFileInResource(IDR_CHIPDB_25K, BINARYFILE, size); + chipdb_blob_45k = LoadFileInResource(IDR_CHIPDB_45K, BINARYFILE, size); + chipdb_blob_85k = LoadFileInResource(IDR_CHIPDB_85K, BINARYFILE, size); +} + +NEXTPNR_NAMESPACE_END
\ No newline at end of file diff --git a/ecp5/resource/resource.h b/ecp5/resource/resource.h new file mode 100644 index 00000000..1a18bee2 --- /dev/null +++ b/ecp5/resource/resource.h @@ -0,0 +1,4 @@ +#define BINARYFILE 256 +#define IDR_CHIPDB_25K 101 +#define IDR_CHIPDB_45K 102 +#define IDR_CHIPDB_85K 103 diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index d60ab6f4..99e9078f 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -275,7 +275,7 @@ def write_database(dev_name, chip, ddrg, endianness): bba.l("tiletype_names", "RelPtr<char>") - for tt in tiletype_names: + for tt, idx in sorted(tiletype_names.items(), key=lambda x: x[1]): bba.s(tt, "name") bba.l("chip_info") |