| @@ -3,23 +3,25 @@ | |||||
| read -p "Enter your student username (the one you use on badboard): " username | read -p "Enter your student username (the one you use on badboard): " username | ||||
| echo "Cleaning your project" | echo "Cleaning your project" | ||||
| ./sbt.sh clean | |||||
| # ./sbt.sh clean | |||||
| echo "Creating archive" | echo "Creating archive" | ||||
| mkdir wrap | mkdir wrap | ||||
| mkdir wrap/project | |||||
| cp -r src ./wrap/ | cp -r src ./wrap/ | ||||
| cp build.sbt ./wrap | cp build.sbt ./wrap | ||||
| cp project/Dependencies.scala ./wrap/project/Dependencies.scala | cp project/Dependencies.scala ./wrap/project/Dependencies.scala | ||||
| cp project/build.properties ./wrap/project/build.properties | cp project/build.properties ./wrap/project/build.properties | ||||
| cp sbt.sh ./wrap | cp sbt.sh ./wrap | ||||
| tar czfv $username.gz wrap | |||||
| (cd ./wrap/; tar czfv $username.gz .) | |||||
| mv ./wrap/$username.gz . | |||||
| rm -rf ./wrap | rm -rf ./wrap | ||||
| echo "Unwrapping and testing your wrapped package" | echo "Unwrapping and testing your wrapped package" | ||||
| mkdir wrapTest | mkdir wrapTest | ||||
| tar -C ./wrapTest -xvf $username.gz | tar -C ./wrapTest -xvf $username.gz | ||||
| ./wrapTest/wrap/sbt.sh test | |||||
| ./wrapTest/sbt.sh test | |||||
| rm -rf ./wrapTest | rm -rf ./wrapTest | ||||
| echo "If the test output looked good then you're good to go!" | echo "If the test output looked good then you're good to go!" | ||||
| @@ -22,6 +22,15 @@ | |||||
| Keep in mind that this is just a high level sketch, omitting many details as well | Keep in mind that this is just a high level sketch, omitting many details as well | ||||
| entire features (for instance branch logic) | 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. | #+CAPTION: A very high level processor schematic. Registers, Instruction and data memory are already implemented. | ||||
| [[./Images/FiveStage.png]] | [[./Images/FiveStage.png]] | ||||
| @@ -26,7 +26,7 @@ object Parser { | |||||
| def branchZ : (Parser[Int], Parser[String]) = (reg <~ sep, label) | def branchZ : (Parser[Int], Parser[String]) = (reg <~ sep, label) | ||||
| def arith : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, reg) | 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) | def stringWs(s: String) : Parser[String] = many(whitespace) ~> string(s) <~ many1(whitespace) | ||||
| @@ -144,7 +144,6 @@ object Parser { | |||||
| val multipleInstructions: Parser[List[Op]] = List( | 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)) => { | stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitHiLo(20))).mapN{ case(rd, (hi, lo)) => { | ||||
| say("hello?") | say("hello?") | ||||
| List( | List( | ||||
| @@ -155,7 +154,7 @@ object Parser { | |||||
| // NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I! | // NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I! | ||||
| // NOTE: USES A SPECIAL REGISTER | // NOTE: USES A SPECIAL REGISTER | ||||
| // NOTE: PROBABLY BROKEN, NOT EXHAUSTIVELY TESTED!!! | // 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) => { | case (rd, offset, rs1) if (offset % 4 == 3) => { | ||||
| val placeHolder = if(rd == Reg("a0").value) Reg("a1").value else Reg("a0").value | val placeHolder = if(rd == Reg("a0").value) Reg("a1").value else Reg("a0").value | ||||
| List( | List( | ||||