Skip to content

Commit eeddcd0

Browse files
committed
Store an SHA256 digest of the architecture file
1 parent 1a0ce97 commit eeddcd0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libarchfpga/src/physical_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,8 @@ typedef struct s_switchblock_inf{
10301030
/* Detailed routing architecture */
10311031
typedef struct s_arch t_arch;
10321032
struct s_arch {
1033+
char* architecture_id; //Secure hash digest of the architecture file to uniquely identify this architecture
1034+
10331035
t_chan_width_dist Chans;
10341036
enum e_switch_block_type SBType;
10351037
std::vector<t_switchblock_inf> switchblocks;

libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "vtr_log.h"
5151
#include "vtr_util.h"
5252
#include "vtr_matrix.h"
53+
#include "vtr_digest.h"
5354

5455
#include "arch_types.h"
5556
#include "arch_util.h"
@@ -173,6 +174,9 @@ void XmlReadArch(const char *ArchFile, const bool timing_enabled,
173174
ArchFile);
174175
}
175176

177+
//Create a unique identifier for this architecture file based on it's contents
178+
arch->architecture_id = vtr::strdup(vtr::secure_digest_file(ArchFile).c_str());
179+
176180
/* Parse the file */
177181
pugi::xml_document doc;
178182
pugiutil::loc_data loc_data;

0 commit comments

Comments
 (0)