mirror of https://github.com/YosysHQ/icestorm.git
Cleanups for PREFIX patch
This commit is contained in:
parent
873baf773a
commit
04e6143457
|
|
@ -265,17 +265,11 @@ void read_config()
|
|||
void read_chipdb()
|
||||
{
|
||||
char buffer[1024];
|
||||
char path[1024];
|
||||
|
||||
//-- If the PREFIX initial character is ~ expand it the
|
||||
//-- home directory
|
||||
if (strlen(PREFIX)>0 && PREFIX[0]=='~')
|
||||
snprintf(path, 1024, "%s%s", getenv("HOME"), &PREFIX[1]);
|
||||
if (PREFIX[0] == '~' && PREFIX[1] == '/')
|
||||
snprintf(buffer, 1024, "%s%s/share/icebox/chipdb-%s.txt", getenv("HOME"), PREFIX+1, config_device.c_str());
|
||||
else
|
||||
snprintf(path, 1024, "%s", PREFIX);
|
||||
|
||||
//-- Chipdb file with full path
|
||||
snprintf(buffer, 1024, "%s/share/icebox/chipdb-%s.txt", path, config_device.c_str());
|
||||
snprintf(buffer, 1024, "%s/share/icebox/chipdb-%s.txt", PREFIX, config_device.c_str());
|
||||
|
||||
FILE *fdb = fopen(buffer, "r");
|
||||
if (fdb == nullptr) {
|
||||
|
|
@ -283,7 +277,6 @@ void read_chipdb()
|
|||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
std::string mode;
|
||||
int current_net = -1;
|
||||
int tile_x = -1, tile_y = -1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue