Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Laboratorinis darbas 6
# Maksim Norkin
# Programos direktorija
FOLDER=$(pwd)
# Konfiguracijos direktorija
CONFIG_DIR="config"
# Rezultatu directorija
RESULTS_DIR="results"
# Sim dir
SIM_DIR="/home/maksim/Documents/Ketvirtas_semestras/Kompiuteriu_architektura/simplesim-3.0"
# sim-cache
SIM_OUTORDER="$SIM_DIR/sim-outorder"
# testine programa
TEST_PROGRAM="$SIM_DIR/tests/bin.little/test-math"
# pipevieweris
PIPEVIEWER="$SIM_DIR/pipeview.pl"
# Kuriame du katalogus konfiguracijos failams ir simuliacijos rezultatams saugoti
if [ ! -d "$CONFIG_DIR" ]; then
echo "Creating configuration directory .."
mkdir $CONFIG_DIR
fi
if [ ! -d "$RESULTS_DIR" ]; then
echo "Creating rezults directory .."
mkdir $RESULTS_DIR
fi
$SIM_OUTORDER -ptrace $RESULTS_DIR/foo.trc :100 $TEST_PROGRAM
$PIPEVIEWER $RESULTS_DIR/foo.trc > $RESULTS_DIR/pipe.rez
awk '/@ 436/,/@ 443/' $FOLDER/$RESULTS_DIR/pipe.rez | pbmtext -builtin fixed -space=1 | pnmcrop | pnmpad -white -l10 -r10 -t10 -b10 > pipe.pnm
convert pipe.pnm pipe.jpg
rm pipe.pnm
rm report.tex
echo "\documentclass[11pt,a4paper]{article}" >> report.tex
echo "\usepackage[left=25mm,right=10mm,top=10mm,bottom=20mm]{geometry}" >> report.tex
echo "\usepackage[utf8x]{inputenc}" >> report.tex
echo "\usepackage[L7x]{fontenc}" >> report.tex
echo "\usepackage[lithuanian]{babel}" >> report.tex
echo "\usepackage{graphicx}" >> report.tex
echo "\begin{document}" >> report.tex
echo "\title{Laboratorinis darbas nr.6}" >> report.tex
echo "\author{Maksim Norkin}" >> report.tex
echo "\date{\today}" >> report.tex
echo "\maketitle" >> report.tex
echo "\begin{center}" >> report.tex
echo "\includegraphics[width=400pt,height=500pt]{pipe.jpg}" >> report.tex
echo "\end{center}" >> report.tex
echo "\end{document}" >> report.tex
pdflatex report.tex
evince report.pdf &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment