diff options
author | whitequark <whitequark@whitequark.org> | 2020-06-25 15:11:47 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2020-06-26 08:36:07 +0000 |
commit | 89e0cc8078ecbb57ca450cc6c8a40f6b634b8c9c (patch) | |
tree | e34454964eff6bf4d14f40b4f1c271cadea6d1fa /ice40/resource | |
parent | dc209f6344545196de8bf4de7abff2fcbd55732e (diff) | |
download | nextpnr-89e0cc8078ecbb57ca450cc6c8a40f6b634b8c9c.tar.gz nextpnr-89e0cc8078ecbb57ca450cc6c8a40f6b634b8c9c.tar.bz2 nextpnr-89e0cc8078ecbb57ca450cc6c8a40f6b634b8c9c.zip |
Simplify and improve chipdb embedding/loading.
Diffstat (limited to 'ice40/resource')
-rw-r--r-- | ice40/resource/chipdb.rc | 7 | ||||
-rw-r--r-- | ice40/resource/embed.cc | 32 | ||||
-rw-r--r-- | ice40/resource/resource.h | 6 |
3 files changed, 0 insertions, 45 deletions
diff --git a/ice40/resource/chipdb.rc b/ice40/resource/chipdb.rc deleted file mode 100644 index 0b248d74..00000000 --- a/ice40/resource/chipdb.rc +++ /dev/null @@ -1,7 +0,0 @@ -#include "resource.h" - -IDR_CHIPDB_384 BINARYFILE "ice40/chipdb/chipdb-384.bin" -IDR_CHIPDB_1K BINARYFILE "ice40/chipdb/chipdb-1k.bin" -IDR_CHIPDB_5K BINARYFILE "ice40/chipdb/chipdb-5k.bin" -IDR_CHIPDB_U4K BINARYFILE "ice40/chipdb/chipdb-u4k.bin" -IDR_CHIPDB_8K BINARYFILE "ice40/chipdb/chipdb-8k.bin" diff --git a/ice40/resource/embed.cc b/ice40/resource/embed.cc deleted file mode 100644 index 048ac474..00000000 --- a/ice40/resource/embed.cc +++ /dev/null @@ -1,32 +0,0 @@ -#include <cstdio> -#include <windows.h> -#include "nextpnr.h" -#include "resource.h" - -NEXTPNR_NAMESPACE_BEGIN - -const char *chipdb_blob_384; -const char *chipdb_blob_1k; -const char *chipdb_blob_5k; -const char *chipdb_blob_u4k; -const char *chipdb_blob_8k; - -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_384 = LoadFileInResource(IDR_CHIPDB_384, BINARYFILE, size); - chipdb_blob_1k = LoadFileInResource(IDR_CHIPDB_1K, BINARYFILE, size); - chipdb_blob_5k = LoadFileInResource(IDR_CHIPDB_5K, BINARYFILE, size); - chipdb_blob_u4k = LoadFileInResource(IDR_CHIPDB_U4K, BINARYFILE, size); - chipdb_blob_8k = LoadFileInResource(IDR_CHIPDB_8K, BINARYFILE, size); -} - -NEXTPNR_NAMESPACE_END diff --git a/ice40/resource/resource.h b/ice40/resource/resource.h deleted file mode 100644 index 4dacbf61..00000000 --- a/ice40/resource/resource.h +++ /dev/null @@ -1,6 +0,0 @@ -#define BINARYFILE 256 -#define IDR_CHIPDB_384 101 -#define IDR_CHIPDB_1K 102 -#define IDR_CHIPDB_5K 103 -#define IDR_CHIPDB_8K 104 -#define IDR_CHIPDB_U4K 105 |