Created
June 21, 2017 11:43
-
-
Save akafael/4f31841261da01cd3ae4893adc086ea7 to your computer and use it in GitHub Desktop.
Contador de Instruções para estudo de Complexidade de Algoritmo implementado no Mars Mips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MARS_MIPS="/opt/mars_mips/Mars45_Custom4.jar" | |
INDEX=0; | |
MAX_INDEX=19; | |
PROGRAM='primeNumbers.s' | |
OUT="Index,IC" | |
while [ $INDEX -le $MAX_INDEX ]; do | |
INSTRUCTION_COUNT=$(echo $INDEX |\ | |
java -jar $MARS_MIPS ic $PROGRAM|\ | |
tail -2); | |
echo $INDEX,$INSTRUCTION_COUNT | |
INDEX=$((INDEX + 1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
O script envia um número como parâmetro para o programa a ser analisado e retorna o valor de entrada junto do quantidade de instruções executadas. Pode ser usado em conjunto com algum progrma para plotar os dados ou apenas gerar um csv através do comando
mipsInstructionCounter.sh > saida.csv