From 559a5c83600a8066f52b56e9f1ab10860955a8d6 Mon Sep 17 00:00:00 2001 From: peteraa Date: Mon, 9 Sep 2019 15:56:18 +0200 Subject: [PATCH] Fix up deliver script --- deliver.sh | 8 +++++--- exercise.org | 9 +++++++++ src/test/scala/RISCV/Parser.scala | 5 ++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/deliver.sh b/deliver.sh index f64f668..180e209 100755 --- a/deliver.sh +++ b/deliver.sh @@ -3,23 +3,25 @@ read -p "Enter your student username (the one you use on badboard): " username echo "Cleaning your project" -./sbt.sh clean +# ./sbt.sh clean echo "Creating archive" mkdir wrap +mkdir wrap/project cp -r src ./wrap/ cp build.sbt ./wrap cp project/Dependencies.scala ./wrap/project/Dependencies.scala cp project/build.properties ./wrap/project/build.properties cp sbt.sh ./wrap -tar czfv $username.gz wrap +(cd ./wrap/; tar czfv $username.gz .) +mv ./wrap/$username.gz . rm -rf ./wrap echo "Unwrapping and testing your wrapped package" mkdir wrapTest tar -C ./wrapTest -xvf $username.gz -./wrapTest/wrap/sbt.sh test +./wrapTest/sbt.sh test rm -rf ./wrapTest echo "If the test output looked good then you're good to go!" diff --git a/exercise.org b/exercise.org index a5459e3..cd9ebe5 100644 --- a/exercise.org +++ b/exercise.org @@ -22,6 +22,15 @@ Keep in mind that this is just a high level sketch, omitting many details as well entire features (for instance branch logic) + *Important* + When you are done, use the provided ./deliver.sh script to pack up the archive. + If you're unable to run bash scripts then please ensure that you deliver a *zip* archive. + Not .rar or anything else, just use zip because my grading script knows how to handle that + in addition to the one used by deliver.sh + named after your username. Nothing more, nothing less, just your username. + This archive should be runnable as is, thus you need to include all the necessary files. + (I may or may not diff the tests to check if you're screwing with them) + #+CAPTION: A very high level processor schematic. Registers, Instruction and data memory are already implemented. [[./Images/FiveStage.png]] diff --git a/src/test/scala/RISCV/Parser.scala b/src/test/scala/RISCV/Parser.scala index 50da76d..24ded7a 100644 --- a/src/test/scala/RISCV/Parser.scala +++ b/src/test/scala/RISCV/Parser.scala @@ -26,7 +26,7 @@ object Parser { def branchZ : (Parser[Int], Parser[String]) = (reg <~ sep, label) def arith : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, reg) - def arithImm : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, hex | int) + def arithImm : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, (hex | int)) def stringWs(s: String) : Parser[String] = many(whitespace) ~> string(s) <~ many1(whitespace) @@ -144,7 +144,6 @@ object Parser { val multipleInstructions: Parser[List[Op]] = List( - // stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitLoHi(20))).mapN{ case(rd, (hi, lo)) => { stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitHiLo(20))).mapN{ case(rd, (hi, lo)) => { say("hello?") List( @@ -155,7 +154,7 @@ object Parser { // NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I! // NOTE: USES A SPECIAL REGISTER // NOTE: PROBABLY BROKEN, NOT EXHAUSTIVELY TESTED!!! - stringWs("lh") ~> (reg <~ sep, int <~ char('('), reg <~ char(')')).mapN{ + stringWs("lh") ~> (reg <~ sep, (hex | int) <~ char('('), reg <~ char(')')).mapN{ case (rd, offset, rs1) if (offset % 4 == 3) => { val placeHolder = if(rd == Reg("a0").value) Reg("a1").value else Reg("a0").value List(