3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2025-02-26 09:51:44 -08:00 committed by GitHub
commit 9d3b7f7474
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1019 additions and 10 deletions

View file

@ -1683,6 +1683,19 @@ public:
RTLIL::Cell *driverCell() const { log_assert(driverCell_); return driverCell_; };
RTLIL::IdString driverPort() const { log_assert(driverCell_); return driverPort_; };
int from_hdl_index(int hdl_index) {
int zero_index = hdl_index - start_offset;
int rtlil_index = upto ? width - 1 - zero_index : zero_index;
return rtlil_index >= 0 && rtlil_index < width ? rtlil_index : INT_MIN;
}
int to_hdl_index(int rtlil_index) {
if (rtlil_index < 0 || rtlil_index >= width)
return INT_MIN;
int zero_index = upto ? width - 1 - rtlil_index : rtlil_index;
return zero_index + start_offset;
}
#ifdef WITH_PYTHON
static std::map<unsigned int, RTLIL::Wire*> *get_all_wires(void);
#endif

View file

@ -416,8 +416,11 @@ std::string make_temp_dir(std::string template_str)
# endif
char *p = strdup(template_str.c_str());
log_assert(p);
char *res = mkdtemp(p);
log_assert(res != NULL);
if (!res)
log_error("mkdtemp failed for '%s': %s [Error %d]\n",
p, strerror(errno), errno);
template_str = p;
free(p);