소스 검색

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 년 전
부모
커밋
c4e0bf3050
1개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      source/Zynq.AcAxisIo.Mod

+ 16 - 0
source/Zynq.AcAxisIo.Mod

@@ -100,6 +100,22 @@ VAR
 
 		RETURN TRUE;
 	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