summaryrefslogtreecommitdiff
path: root/src/model_generation.py
diff options
context:
space:
mode:
authorRahul P2020-05-29 13:03:43 +0530
committerGitHub2020-05-29 13:03:43 +0530
commiteb0d0f10acea802310ee7218482c42ab9dd2e544 (patch)
treeecb2c939902375a19548fb539b61a67f07aa9578 /src/model_generation.py
parenta28522ac35da6f275f6ca73c47006b39c8a6725f (diff)
parent4618b501f3194dd148d0ad255670e4ae436860a8 (diff)
downloadnghdl-eb0d0f10acea802310ee7218482c42ab9dd2e544.tar.gz
nghdl-eb0d0f10acea802310ee7218482c42ab9dd2e544.tar.bz2
nghdl-eb0d0f10acea802310ee7218482c42ab9dd2e544.zip
Merge pull request #1 from bladen-martin/master
Changed mechanism to terminate testbench - replaced process id mechanism with socket method
Diffstat (limited to 'src/model_generation.py')
-rw-r--r--src/model_generation.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model_generation.py b/src/model_generation.py
index da8e272..dcb0788 100644
--- a/src/model_generation.py
+++ b/src/model_generation.py
@@ -268,7 +268,8 @@ class ModelGeneration:
if (fptr)
{
char line[20];
- while(fscanf(fptr, "%s", line) == 1) {
+ int line_port;
+ while(fscanf(fptr, "%s %d\\n", line, &line_port) == 2) {
ip_count++;
}
@@ -284,7 +285,7 @@ class ModelGeneration:
fptr = fopen(ip_filename, "a");
if (fptr)
{
- fprintf(fptr, "%s\\n", my_ip);
+ fprintf(fptr, "%s %d\\n", my_ip, sock_port);
fclose(fptr);
} else {
perror("Client - cannot open Common_IP file ");