support for java-11 made a bit cleaner
This commit is contained in:
		
							parent
							
								
									776bb9cbfe
								
							
						
					
					
						commit
						fca8399d0f
					
				| 
						 | 
				
			
			@ -688,7 +688,9 @@ VOID Instruction(INS ins, VOID *v) {
 | 
			
		|||
 | 
			
		||||
	UINT32 memOperands = INS_MemoryOperandCount(ins);
 | 
			
		||||
 | 
			
		||||
	if (INS_IsControlFlow(ins))//INS_IsBranchOrCall(ins))//INS_IsIndirectBranchOrCall(ins))
 | 
			
		||||
	//if (INS_IsIndirectBranchOrCall(ins))//old versions of PIN
 | 
			
		||||
	if (INS_IsBranchOrCall(ins))//use this for older versions of PIN like 97554
 | 
			
		||||
	//if (INS_IsControlFlow(ins))//use this for newer versions of PIN like 98332
 | 
			
		||||
	{
 | 
			
		||||
		INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR) BrnFun, IARG_THREAD_ID,
 | 
			
		||||
				IARG_BRANCH_TARGET_ADDR, IARG_BRANCH_TAKEN, IARG_INST_PTR,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
PIN_KIT ?=/home/rajshekar/softwares/pin-98332/
 | 
			
		||||
PIN_KIT ?=/mnt/remote_scratch/softwares/pin-97554/
 | 
			
		||||
CXX=$(shell make PIN_ROOT=$(PIN_KIT) VAR=CXX -f pin_makefile print_var)
 | 
			
		||||
LINKER=$(shell make PIN_ROOT=$(PIN_KIT) VAR=LINKER -f pin_makefile print_var)
 | 
			
		||||
TOOL_CXXFLAGS=$(shell make PIN_ROOT=$(PIN_KIT) VAR=TOOL_CXXFLAGS -f pin_makefile print_var)
 | 
			
		||||
| 
						 | 
				
			
			@ -60,21 +60,23 @@ $(BINDIR)/shmem.$(OBJ_EXTENSION): $(COMMDIR)/IPCBase.h $(COMMDIR)/shm/shmem.h  $
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
################################ JNI stuff comes here ############################################
 | 
			
		||||
#JNIPACKAGE = emulatorinterface.communication.shm.SharedMem #use this for java-8
 | 
			
		||||
JNIPACKAGE = ../../simulator/emulatorinterface/communication/shm/SharedMem.java #use this for java-11
 | 
			
		||||
#JNINCLUDE =-I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -I/usr/lib/jvm/java-8-openjdk-amd64/include #use this for java-8
 | 
			
		||||
JNINCLUDE =-I/usr/lib/jvm/java-11-openjdk-amd64/include/linux -I/usr/lib/jvm/java-11-openjdk-amd64/include #use this for java-11
 | 
			
		||||
JNILinkingFlags = -shared -Wall $(POSITION_INDEPENDENCE)
 | 
			
		||||
#JAVAH = javah -jni #use this for java-8
 | 
			
		||||
JAVAH = javac #use this for java-11
 | 
			
		||||
JAVAHCOMMAND = $(JAVAH) -classpath $(TOPBINDIR) -h $(JNIBINDIR) $(JNIPACKAGE); mv $(JNIBINDIR)/emulatorinterface_communication_shm_SharedMem.h $(JNIBINDIR)/SharedMem.h
 | 
			
		||||
ifeq ($(shell java -version 2>&1|grep 1.8.0 >/dev/null; printf $$?),0)
 | 
			
		||||
	JNIPACKAGE = emulatorinterface.communication.shm.SharedMem #use this for java-8
 | 
			
		||||
	JNINCLUDE =-I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -I/usr/lib/jvm/java-8-openjdk-amd64/include #use this for java-8
 | 
			
		||||
	JAVAH = javah -jni #use this for java-8
 | 
			
		||||
	JAVAHCOMMAND = $(JAVAH) -classpath $(TOPBINDIR) -o $(JNIBINDIR)/SharedMem.h $(JNIPACKAGE) #use this for java-8	
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
$(JNIBINDIR)/libshmlib.$(LIB_EXTENSION): $(JNIBINDIR)/SharedMem.h $(COMMDIR)/shm/JNIShm.c $(COMMDIR)/common.h
 | 
			
		||||
	$(shell $(JNICOMMAND))
 | 
			
		||||
 | 
			
		||||
$(JNIBINDIR)/SharedMem.h: $(TOPBINDIR)/emulatorinterface/communication/shm/SharedMem.class
 | 
			
		||||
	#$(JAVAH) -classpath $(TOPBINDIR) -o $(JNIBINDIR)/SharedMem.h $(JNIPACKAGE) #use this for java-8
 | 
			
		||||
	$(JAVAH) -classpath $(TOPBINDIR) -h $(JNIBINDIR) $(JNIPACKAGE) #use this line and the next for java-11
 | 
			
		||||
	mv $(JNIBINDIR)/emulatorinterface_communication_shm_SharedMem.h $(JNIBINDIR)/SharedMem.h
 | 
			
		||||
	$(JAVAHCOMMAND)
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -rf $(BINDIR) $(JNIBINDIR)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,12 +31,12 @@ TDP = 15W
 | 
			
		|||
		<!--Currently we support following (emulator,communication) combinations : -->
 | 
			
		||||
		<!--(pin, sharedMemory), (qemu, sharedMemory), (qemu, network), (none, file)-->
 | 
			
		||||
		<!--(pin,file) combination can be used to collect execution trace of an application in a compressed file-->
 | 
			
		||||
		<EmulatorType>none</EmulatorType> <!--pin,qemu-->
 | 
			
		||||
		<EmulatorType>pin</EmulatorType> <!--pin,qemu-->
 | 
			
		||||
		
 | 
			
		||||
		<!--NOTE only file interface supports the execution of multiple benchmarks inside tejas-->
 | 
			
		||||
		<!--if you are reading the packets from a file, the emulator must be set to none-->
 | 
			
		||||
		<!--multiple benchmarks are specified using arguments to the simulator-->
 | 
			
		||||
		<CommunicationType>file</CommunicationType>  <!--file,sharedMemory,network-->
 | 
			
		||||
		<CommunicationType>sharedMemory</CommunicationType>  <!--file,sharedMemory,network-->
 | 
			
		||||
		
 | 
			
		||||
		<!--We can use tejas as an interface to create a compressed (gzip) trace file using the emulator-->
 | 
			
		||||
		<!--Set this option to true if you want to create a trace file of the benchmark execution-->
 | 
			
		||||
| 
						 | 
				
			
			@ -49,11 +49,11 @@ TDP = 15W
 | 
			
		|||
		<!--We do not allow overwriting of trace files. So if a tracefile with same name is pre-existing, kindly rename it-->
 | 
			
		||||
		<BasenameForTraceFiles>/home/rajshekar/projects/tejas/tests/test1_trace</BasenameForTraceFiles>
 | 
			
		||||
		
 | 
			
		||||
		<PinTool>/home/rajshekar/softwares/pin-98332/</PinTool>
 | 
			
		||||
		<PinInstrumentor>/home/rajshekar/projects/tejas/workspace/Tejas/src/emulator/pin/obj-pin/causalityTool.so</PinInstrumentor>
 | 
			
		||||
		<PinTool>/mnt/remote_scratch/softwares/pin-97554/</PinTool>
 | 
			
		||||
		<PinInstrumentor>/mnt/remote_scratch1/rajshekar/projects/tejas/workspace/Tejas/src/emulator/pin/obj-pin/causalityTool.so</PinInstrumentor>
 | 
			
		||||
		<QemuTool>TODO/home/prathmesh/workspace/qemu/x86_64-linux-user/qemu-x86_64 /home/prathmesh/tmp/testQemu.o</QemuTool>
 | 
			
		||||
		<ShmLibDirectory>/home/rajshekar/projects/tejas/workspace/Tejas/src/emulator/pin/obj-comm/</ShmLibDirectory>
 | 
			
		||||
		<GetBenchmarkPIDScript>/home/rajshekar_resources/tejas_configs/getBenchmarkPID.sh</GetBenchmarkPIDScript>
 | 
			
		||||
		<ShmLibDirectory>/mnt/remote_scratch1/rajshekar/projects/tejas/workspace/Tejas/src/emulator/pin/obj-comm/</ShmLibDirectory>
 | 
			
		||||
		<GetBenchmarkPIDScript>/home/rajshekar/resources/tejas_configs/getBenchmarkPID.sh</GetBenchmarkPIDScript>
 | 
			
		||||
		<KillEmulatorScript>/home/rajshekar/resources/tejas_configs/killAllDescendents.sh</KillEmulatorScript>
 | 
			
		||||
	</Emulator>
 | 
			
		||||
	
 | 
			
		||||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ TDP = 15W
 | 
			
		|||
		<pinpointsSim>false</pinpointsSim>
 | 
			
		||||
		<pinpointsFile>/mnt/srishtistr0/scratch/rajshekar/tejas/PinPoints_working_directory/soplex.test.Data/t.sorted</pinpointsFile>
 | 
			
		||||
		<NumInsToIgnore>00000000</NumInsToIgnore>	<!--Ignores these many profilable instructions from the start of the program-->
 | 
			
		||||
		<subsetSim>false</subsetSim>
 | 
			
		||||
		<subsetSim>true</subsetSim>
 | 
			
		||||
		<subsetSimSize>2000000</subsetSimSize>
 | 
			
		||||
		<markerFunctions>false</markerFunctions>
 | 
			
		||||
		<startSimMarker>add</startSimMarker>
 | 
			
		||||
| 
						 | 
				
			
			@ -112,12 +112,12 @@ TDP = 15W
 | 
			
		|||
			<PipelineType>outOfOrder</PipelineType>	<!--inOrder,outOfOrder(set issue width for multi-issue in-order)-->
 | 
			
		||||
			
 | 
			
		||||
			<BranchPredictor>
 | 
			
		||||
				<Predictor_Mode>TAGE</Predictor_Mode>	<!-- Legal Values are NoPredictor, PerfectPredictor, AlwaysTaken, AlwaysNotTaken, Tournament, Bimodal, GAg, GAp, GShare, PAg, PAp, TAGE, TAGE-SC-L -->
 | 
			
		||||
				<Predictor_Mode>TAGE-SC-L</Predictor_Mode>	<!-- Legal Values are NoPredictor, PerfectPredictor, AlwaysTaken, AlwaysNotTaken, Tournament, Bimodal, GAg, GAp, GShare, PAg, PAp, TAGE, TAGE-SC-L -->
 | 
			
		||||
				<PCBits>8</PCBits>
 | 
			
		||||
				<BHRsize>16</BHRsize>
 | 
			
		||||
				<BranchMispredPenalty>17</BranchMispredPenalty>	<!--Branch misprediction penalty--><!-- https://www.7-cpu.com/cpu/Skylake.html -->
 | 
			
		||||
				<SaturatingBits>2</SaturatingBits>
 | 
			
		||||
				<TAGESCLLibDirectory>/home/rajshekar/projects/tejas/workspace/Tejas/src/simulator/pipeline/branchpredictor/TAGESCL/</TAGESCLLibDirectory>
 | 
			
		||||
				<TAGESCLLibDirectory>/mnt/remote_scratch1/rajshekar/projects/tejas/workspace/Tejas/src/simulator/pipeline/branchpredictor/TAGESCL/</TAGESCLLibDirectory>
 | 
			
		||||
				<LeakageEnergy>0.0178</LeakageEnergy>
 | 
			
		||||
				<DynamicEnergy>0.0962</DynamicEnergy>
 | 
			
		||||
			</BranchPredictor>			
 | 
			
		||||
| 
						 | 
				
			
			@ -477,7 +477,7 @@ TDP = 15W
 | 
			
		|||
		<Interconnect>NOC</Interconnect>
 | 
			
		||||
		
 | 
			
		||||
		<NOC>
 | 
			
		||||
			<NocConfigFile>/home/rajshekar/resources/tejas_configs/config_2core_kabylake_NocConfig.txt</NocConfigFile>
 | 
			
		||||
			<NocConfigFile>/nfs_home/rajshekar/resources/tejas_configs/config_2core_kabylake_NocConfig.txt</NocConfigFile>
 | 
			
		||||
			<NocSelScheme>STATIC</NocSelScheme>
 | 
			
		||||
			<NocNumberOfBuffers>4</NocNumberOfBuffers>
 | 
			
		||||
			<NocPortType>FCFS</NocPortType>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,11 @@
 | 
			
		|||
javaver=java-11
 | 
			
		||||
ifeq ($(shell java -version 2>&1|grep 1.8.0 >/dev/null; printf $$?),0)
 | 
			
		||||
	javaver=java-8
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
all:
 | 
			
		||||
	javac -h . TAGESCLInvoker.java
 | 
			
		||||
	#gcc -fPIC -I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/ -shared -o libnative.so pipeline_branchpredictor_TAGESCL_TAGESCLInvoker.cc
 | 
			
		||||
	gcc -fPIC -I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/ -shared -o libnative.so pipeline_branchpredictor_TAGESCL_TAGESCLInvoker.cc
 | 
			
		||||
	gcc -fPIC -I/usr/lib/jvm/$(javaver)-openjdk-amd64/include/ -I/usr/lib/jvm/$(javaver)-openjdk-amd64/include/linux/ -shared -o libnative.so pipeline_branchpredictor_TAGESCL_TAGESCLInvoker.cc
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.h
 | 
			
		||||
	rm -f *.class
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue