diff --git a/code/VSched.c b/code/VSched.c index 16eee71..76ca9f5 100644 --- a/code/VSched.c +++ b/code/VSched.c @@ -383,7 +383,11 @@ VPROC_RTN_TYPE VSched (VSCHED_PARAMS) // don't process here with the level interrupt code and just return. if (Interrupt && ns[node]->VUserIrqCB != NULL) { +#ifndef VPROC_VHDL return 0; +#else + return; +#endif } // Send message to VUser with VPDataIn value diff --git a/f_vproc.vhd b/f_vproc.vhd index 81ce22c..f1393b6 100644 --- a/f_vproc.vhd +++ b/f_vproc.vhd @@ -95,7 +95,7 @@ begin variable DataInSamp : integer; variable IntSamp : integer; - variable IntSampLast : integer; + variable IntSampLast : integer := 0; variable RdAckSamp : std_logic; variable WRAckSamp : std_logic; @@ -109,7 +109,6 @@ begin -- Cleanly sample the inputs DataInSamp := to_integer(signed(DataIn)); - IntSampLast := IntSamp; IntSamp := to_integer(signed("0" & Interrupt)); RdAckSamp := RDAck; WRAckSamp := WRAck; @@ -139,6 +138,7 @@ begin -- new value if IntSamp /= IntSampLast then VIrq(to_integer(unsigned(Node)), IntSamp); + IntSampLast := IntSamp; end if; -- If tick, write or a read has completed (or in last cycle)... diff --git a/python/modules/pyvproc.py b/python/modules/pyvproc.py index 26b42ab..a360e3b 100644 --- a/python/modules/pyvproc.py +++ b/python/modules/pyvproc.py @@ -33,12 +33,12 @@ class PyVProcClass : api = None # Constructor - def __init__(self, nodeIn, cmodulename = "./PyVproc.so") : + def __init__(self, nodeIn, cmodulename = "./PyVProc.so") : self.node = nodeIn self.api = self.__loadPyModule(cmodulename) # Method to load Python C module - def __loadPyModule(self, name = "./PyVproc.so") : + def __loadPyModule(self, name = "./PyVProc.so") : module = CDLL(name) module.argtypes = [c_int32] diff --git a/python/src/PythonVProc.c b/python/src/PythonVProc.c index a924dfb..2360036 100644 --- a/python/src/PythonVProc.c +++ b/python/src/PythonVProc.c @@ -46,37 +46,37 @@ static regirqfunc_p VregIrq; static int BindToApiFuncs(void) { void* hdl = dlopen("VProc.so", RTLD_NOW | RTLD_GLOBAL); - + if (hdl == NULL) { fprintf(stderr, "***ERROR: failed to load shared object\n"); return 1; } - + if ((Vwrite = (wfunc_p)dlsym(hdl, "VWrite")) == NULL) { fprintf(stderr, "***ERROR: failed to find symbol VWrite\n"); return 1; } - + if ((Vread = (rfunc_p)dlsym(hdl, "VRead")) == NULL) { fprintf(stderr, "***ERROR: failed to find symbol VRead\n"); return 1; } - + if ((Vtick = (tkfunc_p)dlsym(hdl, "VTick")) == NULL) { fprintf(stderr, "***ERROR: failed to find symbol VTick\n"); return 1; } - + if ((VregIrq = (regirqfunc_p)dlsym(hdl, "VRegIrq")) == NULL) { fprintf(stderr, "***ERROR: failed to find symbol VRegIrq\n"); return 1; } - + return 0; } @@ -95,7 +95,7 @@ int RunPython(const int node) char strbuf[DEFAULTSTRBUFSIZE]; int status; int rtnval = 0; - + if (status = BindToApiFuncs()) { return status; @@ -151,7 +151,7 @@ int RunPython(const int node) fprintf(stderr, "***Error: RunPython() : Failed to load \"%s\"\n", strbuf); return 1; } - + if (Py_FinalizeEx() < 0) { return 120; diff --git a/python/test/makefile b/python/test/makefile index a728e8c..63ee42d 100644 --- a/python/test/makefile +++ b/python/test/makefile @@ -110,7 +110,6 @@ CFLAGS = -fPIC \ -I${MODEL_TECH}/../include \ -DVP_MAX_NODES=${MAX_NUM_VPROC} \ -DMODELSIM \ - -DDISABLE_LEVEL_INT \ -D_REENTRANT # Common flags for vsim diff --git a/python/test/makefile.ica b/python/test/makefile.ica index b2ad392..becb547 100644 --- a/python/test/makefile.ica +++ b/python/test/makefile.ica @@ -188,4 +188,4 @@ gui : rungui #------------------------------------------------------ clean: - @rm -rf ${VPROC_PLI} ${VLIB} obj sim *.vcd + @rm -rf ${PYVRPOC_PLI} ${VPROC_PLI} ${VLIB} obj sim *.vcd