diff --git a/cMIPS/bin/build.sh b/cMIPS/bin/build.sh index 70d5ef2c52a421d662db477e55dcfd58db9acc2f..d372760297fd6d9cc3f2fa1598419f88ccb08fc8 100755 --- a/cMIPS/bin/build.sh +++ b/cMIPS/bin/build.sh @@ -36,7 +36,7 @@ exit 1 if [ ! -v tree ] ; then # you must set the location of the cMIPS root directory in the variable tree # tree=${HOME}/cMIPS - # tree=${HOME}/cmips-code/cMIPS + # tree=${HOME}/cmips/cMIPS export tree="$(echo $PWD | sed -e 's:^\(/.*/cMIPS\)/.*:\1:')" fi @@ -59,7 +59,6 @@ if [ $pkg_vhd -nt $c_ld -o\ "${bin}"/edMemory.sh -v || errorED || exit 1 fi -# cd "${obj}" cd "${srcVHDL}" @@ -67,7 +66,7 @@ simulator=tb_cmips pkg="packageWires.vhd packageMemory.vhd packageExcp.vhd" -src="altera.vhd macnica.vhd aux.vhd memory.vhd cache.vhd instrcache.vhd ram.vhd rom.vhd units.vhd io.vhd uart.vhd fpu.vhd pipestages.vhd exception.vhd core.vhd tb_cMIPS.vhd" +src="aux.vhd altera.vhd macnica.vhd memory.vhd cache.vhd instrcache.vhd ram.vhd rom.vhd units.vhd io.vhd uart.vhd fpu.vhd pipestages.vhd exception.vhd core.vhd tb_cMIPS.vhd" # build simulator #ghdl --clean @@ -86,9 +85,9 @@ src="altera.vhd macnica.vhd aux.vhd memory.vhd cache.vhd instrcache.vhd ram.vhd # NOTE: when you add a new sourcefile to this project, you must include it -# with "ghdl -i newFile.vhd" so that learns about it. It may be -# a good idea to remove ./.last_import fo force a full rebuild. -# Of course, newFile.vhd must be added to the $src variable. +# with "ghdl -i newFile.vhd" so that ghdl learns about it. It may be +# a good idea to remove ./.last_import to force a full rebuild. +# Of course, newFile.vhd must be added to the $src variable (above). # if never imported sources, do it now if [ ! -f .last_import ] ; then diff --git a/cMIPS/bin/run.sh b/cMIPS/bin/run.sh index c6daeb6516a76bff94c8b7348870be06ce73e706..17daa4d7f3aa743f8459eba18d252ea95335d6d4 100755 --- a/cMIPS/bin/run.sh +++ b/cMIPS/bin/run.sh @@ -40,7 +40,7 @@ OPTIONS: -t T number of time-units to run (default ${length}) -u U unit of time scale {m,u,n,p} (default ${unit}s) -n send simulator output do /dev/null, else to v_cMIPS.vcd - -w invoke GTKWAVE + -w invoke GTKWAVE -- stdin will not read input from keyboard -v F gtkwave configuration file (e.g. pipe.sav, default v.sav) EOF } @@ -77,10 +77,19 @@ gfile=${gtkwconf%%.sav} sav="${tree}"/${gfile}.sav -"${bin}"/build.sh &&\ -"${simulator}" --ieee-asserts=disable --stop-time=${length}${unit}s \ - --vcd=${visual} -# --wave=${visual%.vcd}.ghw +"${bin}"/build.sh || ( usage ; exit 1) -test -v $WAVE || gtkwave -O /dev/null ${visual} ${sav} +options="--ieee-asserts=disable --stop-time=${length}${unit}s --vcd=${visual}" + +if [ -v $WAVE ] ; then + + exec "${simulator}" $options + +else + + "${simulator}" $options || gtkwave -O /dev/null ${visual} ${sav} + +fi + +# --wave=${visual%.vcd}.ghw \ No newline at end of file