summaryrefslogtreecommitdiff
path: root/src/model_generation.py
diff options
context:
space:
mode:
authorrahul2019-10-22 11:28:44 +0530
committerrahul2019-10-22 11:28:44 +0530
commitd472bf02bbb957dafa1227277b0421f52c9d7375 (patch)
tree1e852cd4ff28e835eaaf009e539334898c50959a /src/model_generation.py
parent76241122c16990ee003df89391c85ee478ea0dca (diff)
downloadnghdl-d472bf02bbb957dafa1227277b0421f52c9d7375.tar.gz
nghdl-d472bf02bbb957dafa1227277b0421f52c9d7375.tar.bz2
nghdl-d472bf02bbb957dafa1227277b0421f52c9d7375.zip
Multiple models for each instance
Diffstat (limited to 'src/model_generation.py')
-rw-r--r--src/model_generation.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/model_generation.py b/src/model_generation.py
index 3df4676..9615f8e 100644
--- a/src/model_generation.py
+++ b/src/model_generation.py
@@ -241,7 +241,10 @@ client_setup_ip='''
int ip_count = 0;
char* my_ip = malloc(16);
- fptr = fopen("/tmp/NGHDL_COMMON_IP.txt", "r");
+ char ip_filename[40];
+ sprintf(ip_filename, "/tmp/NGHDL_COMMON_IP_%d.txt", getpid());
+
+ fptr = fopen(ip_filename, "r");
if (fptr)
{
char line[20];
@@ -258,7 +261,7 @@ client_setup_ip='''
sprintf(my_ip, "127.0.%d.1", (ip_count+1)%256);
}
- fptr = fopen("/tmp/NGHDL_COMMON_IP.txt", "a");
+ fptr = fopen(ip_filename, "a");
if (fptr)
{
fprintf(fptr, "%s\\n", my_ip);