summaryrefslogtreecommitdiff
path: root/src/ghdlserver
diff options
context:
space:
mode:
authorFahim2015-08-14 17:43:46 +0530
committerFahim2015-08-14 17:43:46 +0530
commitddb01dcab87a6179d20d7de76550a61c5f7db7d8 (patch)
tree3daa0da40759f937855b413c836edc4b1917aed6 /src/ghdlserver
parent31834c1879c87d40a92e9023586e6a6b9a699bf6 (diff)
parent5701df61772ab92c53b07cf7a6add1138b40bcf1 (diff)
downloadnghdl-ddb01dcab87a6179d20d7de76550a61c5f7db7d8.tar.gz
nghdl-ddb01dcab87a6179d20d7de76550a61c5f7db7d8.tar.bz2
nghdl-ddb01dcab87a6179d20d7de76550a61c5f7db7d8.zip
Merge pull request #11 from ambikeshwar1991/master
Changes for flexible client server port no.
Diffstat (limited to 'src/ghdlserver')
-rwxr-xr-xsrc/ghdlserver/Vhpi_Package.vhdl4
-rw-r--r--src/ghdlserver/ghdlserver.c4
-rw-r--r--src/ghdlserver/ghdlserver.h5
3 files changed, 7 insertions, 6 deletions
diff --git a/src/ghdlserver/Vhpi_Package.vhdl b/src/ghdlserver/Vhpi_Package.vhdl
index febc00b..0c0baac 100755
--- a/src/ghdlserver/Vhpi_Package.vhdl
+++ b/src/ghdlserver/Vhpi_Package.vhdl
@@ -8,7 +8,7 @@ package Vhpi_Foreign is
-----------------------------------------------------------------------------
-- foreign Vhpi function
-----------------------------------------------------------------------------
- procedure Vhpi_Initialize;
+ procedure Vhpi_Initialize(sock_port : in integer);
attribute foreign of Vhpi_Initialize : procedure is "VHPIDIRECT Vhpi_Initialize";
procedure Vhpi_Close; -- close .
@@ -36,7 +36,7 @@ package body Vhpi_Foreign is
-----------------------------------------------------------------------------
-- subprogram bodies for foreign vhpi routines. will never be called
-----------------------------------------------------------------------------
- procedure Vhpi_Initialize is
+ procedure Vhpi_Initialize(sock_port: in integer) is
begin
assert false report "fatal: this should never be called" severity failure;
end Vhpi_Initialize;
diff --git a/src/ghdlserver/ghdlserver.c b/src/ghdlserver/ghdlserver.c
index 68c9941..603f925 100644
--- a/src/ghdlserver/ghdlserver.c
+++ b/src/ghdlserver/ghdlserver.c
@@ -369,9 +369,9 @@ void set_non_blocking(int sock_id)
}
-void Vhpi_Initialize()
+void Vhpi_Initialize(int sock_port)
{
-
+ DEFAULT_SERVER_PORT = sock_port;
/*Taking time info for log*/
time_t systime;
systime = time(NULL);
diff --git a/src/ghdlserver/ghdlserver.h b/src/ghdlserver/ghdlserver.h
index 07cccb6..ad82385 100644
--- a/src/ghdlserver/ghdlserver.h
+++ b/src/ghdlserver/ghdlserver.h
@@ -13,7 +13,6 @@
#define MAX_BUF_SIZE 4096
//Defualt port number
-#define DEFAULT_SERVER_PORT 5000
//unlikely to have more than 16 active
//threads talking to the TB?
@@ -22,6 +21,8 @@
+int DEFAULT_SERVER_PORT;
+
//Payload Handling
int extract_payload(char* receive_buffer,char* payload, int max_n);
//void print_payload(FILE* log_file,char* send_buffer, int wlength, int nwords);
@@ -47,7 +48,7 @@ void set_non_blocking(int sock_id);
void Data_Send(int sockid);
//Vhpi Function
-void Vhpi_Initialize();
+void Vhpi_Initialize(int sock_port);
void Vhpi_Close();
void Vhpi_Listen();
void Vhpi_Send();