Browse Source

introduced procedures for getting input/output port data address

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8401 8c9fc860-2736-0410-a75d-ab315db34111
eth.morozova 7 years ago
parent
commit
c4e0bf3050
1 changed files with 16 additions and 0 deletions
  1. 16 0
      source/Zynq.AcAxisIo.Mod

+ 16 - 0
source/Zynq.AcAxisIo.Mod

@@ -100,6 +100,22 @@ VAR
 
 
 		RETURN TRUE;
 		RETURN TRUE;
 	END GetOutput;
 	END GetOutput;
+	
+	PROCEDURE GetOutputDataAddr*(out: Output): ADDRESS;
+	VAR portDesc: POINTER {UNSAFE} TO PortDesc;
+	BEGIN
+		portDesc := SYSTEM.VAL(ADDRESS,out);
+		ASSERT(portDesc # NIL);
+		RETURN portDesc.portAddr;
+	END GetOutputDataAddr;
+	
+	PROCEDURE GetInputDataAddr*(inp: Input): ADDRESS;
+	VAR portDesc: POINTER {UNSAFE} TO PortDesc;
+	BEGIN
+		portDesc := SYSTEM.VAL(ADDRESS,inp);
+		ASSERT(portDesc # NIL);
+		RETURN portDesc.portAddr+8;
+	END GetInputDataAddr;
 
 
 	(*
 	(*
 		Acquire exclusive access to a resource
 		Acquire exclusive access to a resource