mirror of https://github.com/YosysHQ/icestorm.git
Fix handling of a port name like CLKHF_FABRIC in icetime
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
4cdf41c840
commit
c1d7ef8b52
|
|
@ -1283,12 +1283,18 @@ std::string ecnetname_to_vlog(std::string ec_name)
|
||||||
std::string end = ec_name.substr(last_+1);
|
std::string end = ec_name.substr(last_+1);
|
||||||
size_t nidx = 0;
|
size_t nidx = 0;
|
||||||
|
|
||||||
int num = std::stoi(end, &nidx, 10);
|
int num = 0;
|
||||||
if(nidx == end.length()) {
|
try {
|
||||||
return base + "[" + std::to_string(num) + "]";
|
num = std::stoi(end, &nidx, 10);
|
||||||
} else {
|
if(nidx == end.length()) {
|
||||||
|
return base + "[" + std::to_string(num) + "]";
|
||||||
|
} else {
|
||||||
|
return ec_name;
|
||||||
|
}
|
||||||
|
} catch(std::invalid_argument e) { // Not numeric and stoi throws exception
|
||||||
return ec_name;
|
return ec_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string make_dsp_ip(int x, int y, std::string net, std::string &primnet)
|
std::string make_dsp_ip(int x, int y, std::string net, std::string &primnet)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue